用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/L-LesterYu/OpenClaw-hot-skills-zh --skill mcporter命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | mcporter |
| description | 使用 mcporter CLI 列出、配置、认证和调用 MCP 服务器/工具(HTTP 或 stdio),包括临时服务器、配置编辑和 CLI/类型生成。 |
MCPorter 是 TypeScript 运行时、CLI 和代码生成工具包,专为 Model Context Protocol (MCP) 设计。帮助您发现系统中已配置的 MCP 服务器,直接调用它们,在 TypeScript 中组合更丰富的自动化,并在需要共享工具时创建单一用途的 CLI。
零配置发现:createRuntime() 自动合并您的主目录配置(~/.mcporter/mcporter.json[c])、项目配置(config/mcporter.json),以及 Cursor/Claude/Codex/Windsurf/OpenCode/VS Code 的导入,扩展 ${ENV} 占位符,并池化连接以便在多个调用中重用传输。
一键 CLI 生成:mcporter generate-cli 将任何 MCP 服务器定义转换为可运行的 CLI,支持可选的打包/编译和用于轻松重新生成的元数据。
类型化工具客户端:mcporter emit-ts 生成 .d.ts 接口或可运行的客户端包装器,使代理/测试可以用强 TypeScript 类型调用 MCP 服务器,无需手写管道代码。
友好的组合式 API:createServerProxy() 将工具公开为符合人体工程学的 camelCase 方法,自动应用 JSON-schema 默认值,验证必需参数,并返回带有 .text()、.markdown()、.json()、.images() 和 .content() 助手的 CallResult。
OAuth 和 stdio 人体工程学:内置 OAuth 缓存、日志跟踪和 stdio 包装器,让您可以从同一接口使用 HTTP、SSE 和 stdio 传输。
临时连接:将 CLI 指向任何 MCP 端点(HTTP 或 stdio),无需触碰配置,稍后如果需要可以持久化。期望浏览器登录的托管 MCP(Supabase、Vercel 等)会被自动检测——只需运行 mcporter auth <url>,CLI 会即时将定义提升为 OAuth。
MCPorter 自动发现您已在 Cursor、Claude Code/Desktop、Codex 或本地覆盖中配置的 MCP 服务器。您可以立即使用 npx 尝试——无需安装。
# 冒号分隔的标志(shell 友好)
npx mcporter call linear.create_comment issueId:ENG-123 body:'看起来不错!'
# 函数调用风格(匹配 `mcporter list` 的签名)
npx mcporter call 'linear.create_comment(issueId: "ENG-123", body: "看起来不错!")'
# 列出所有已配置的服务器
npx mcporter list
# 列出特定服务器的详细信息(包含 schema)
npx mcporter list context7 --schema
# 列出远程 MCP 服务器的所有工具
npx mcporter list https://mcp.linear.app/mcp --all-parameters
# 列出临时 stdio 服务器
npx mcporter list --stdio "bun run ./local-server.ts" --env TOKEN=xyz
# 使用冒号语法调用工具
npx mcporter call linear.create_comment issueId:ENG-123 body:'评论内容'
# 使用函数调用语法
npx mcporter call 'linear.create_comment(issueId: "ENG-123", body: "评论内容")'
# 调用远程服务器
npx mcporter call https://mcp.linear.app/mcp linear.create_comment issueId:ENG-123 body:'评论'
# 添加新服务器到配置
npx mcporter config add myserver --http-url https://example.com/mcp
# 编辑配置
npx mcporter config edit
# 查看配置
npx mcporter config show
# 对需要 OAuth 的服务器进行认证
npx mcporter auth https://mcp.linear.app/mcp
# 查看认证状态
npx mcporter auth status
# 生成 TypeScript 类型定义
npx mcporter emit-ts linear --output ./types
# 生成 CLI
npx mcporter generate-cli linear --output ./my-linear-cli
可以连接到任何 MCP 端点而无需修改配置:
# HTTP 服务器
npx mcporter list https://example.com/mcp
# Stdio 服务器
npx mcporter list --stdio "node ./server.js" --env API_KEY=xyz
# 持久化临时服务器
npx mcporter list https://example.com/mcp --persist --name myserver
大多数命令支持 --json 标志以获得结构化输出:
# JSON 格式列出服务器
npx mcporter list --json
# 使用 jq 过滤
npx mcporter list --json | jq '.[] | select(.name == "linear")'
使用 --verbose 查看详细的配置源信息:
npx mcporter list --verbose
虽然可以使用 npx 直接运行,但也可以全局安装:
# 使用 npm
npm install -g mcporter
# 使用 pnpm
pnpm add -g mcporter
# 使用 bun
bun install -g mcporter
MCPorter 会按以下顺序查找配置文件:
~/.mcporter/mcporter.json 或 ~/.mcporter/mcporter.jsonc(主目录配置)config/mcporter.json(项目配置)支持在配置中使用环境变量占位符:
{
"servers": {
"myserver": {
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}
--help 标志查看任何命令的详细帮助--json 和 --jq 进行灵活的数据提取和处理--verbose 查看配置来源和调试信息mcporter auth 处理需要 OAuth 的服务器--persist 将临时服务器保存到配置npx mcporter list <server-name> --schema
npx mcporter auth <server-url>
npx mcporter call <server-name>.<tool-name> <args>
# 使用 --json 获取结构化输出
result=$(npx mcporter call mytool param1:value1 --json)
echo "$result" | jq '.data'
MIT License