MCP Configs2026年5月14日·1 分钟阅读

mcporter — TypeScript API Wrapper for MCPs

A TypeScript-first wrapper to call MCP tools as a typed API or package them as a CLI; verified 4399★, pushed 2026-05-14.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 94/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Mcp
安装
Pnpm|Npm|Brew
信任
信任等级:Established
入口
mcporter
通用 CLI 安装命令
npx tokrepo install 66d97d29-dfb4-5d21-b021-d98ae7935530
介绍

mcporter 把 MCP 工具封装成 TypeScript API,也可打包成 CLI 做脚本化调用,适合把工具参数与返回值固化为可测试模块,减少 agent 乱填;已验证 4399★,更新于 2026-05-14。

Best for: 希望把 MCP 工具调用做成类型安全 API 的 TypeScript 团队

Works with: Node.js 运行环境;可用于 MCP 工具提供方与 CLI 脚本化流程(见 README)

Setup time: 6-12 minutes

Key facts (verified)

  • GitHub:4399 stars · 281 forks;最近更新 2026-05-14。
  • 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。
  • README 中可对照的入口:mcporter

Main

  • 把 MCP 调用当 API:把工具调用封装成类型化函数,让 agent/app 逻辑保持清晰。

  • 原型阶段先用 CLI;接口稳定后再改为库方式集成,减少脚本漂移。

  • 把传输层抽离:统一 MCP provider 的连接方式,降低环境切换成本。

  • 用类型与示例固化工具契约:减少 agent 对参数的臆测与误填。

README (excerpt)

MCPorter 🧳 - Call MCPs from TypeScript or as CLI

MCPorter header banner

npm version CI Status Platforms MIT License

TypeScript runtime, CLI, and code-generation toolkit for the Model Context Protocol.

MCPorter helps you lean into the "code execution" workflows highlighted in Anthropic's Code Execution with MCP guidance: discover the MCP servers already configured on your system, call them directly, compose richer automations in TypeScript, and mint single-purpose CLIs when you need to share a tool. All of that works out of the box -- no boilerplate, no schema spelunking.

Key Capabilities

  • Zero-config discovery. createRuntime() merges your home config (~/.mcporter/mcporter.json[c], or $XDG_CONFIG_HOME/mcporter/mcporter.json[c] when set) first, then config/mcporter.json, plus Cursor/Claude/Codex/Windsurf/OpenCode/VS Code imports, expands ${ENV} placeholders, and pools connections so you can reuse transports across multiple calls.
  • One-command CLI generation. mcporter generate-cli turns any MCP server definition into a ready-to-run CLI, with optional bundling/compilation and metadata for easy regeneration.
  • Typed tool clients. mcporter emit-ts emits .d.ts interfaces or ready-to-run client wrappers so agents/tests can call MCP servers with strong TypeScript types without hand-writing plumbing.
  • Friendly composable API. createServerProxy() exposes tools as ergonomic camelCase methods, automatically applies JSON-schema defaults, validates required arguments, and hands back a CallResult with .text(), .markdown(), .json(), .images(), and .content() helpers.

Source-backed notes

  • README 给出安装方式:pnpm add mcporternpm install -g mcporter,以及 Homebrew tap。
  • GitHub topics 包含 mcpcli(已通过 GitHub API 复核)。
  • 仓库为 MIT 许可且近期更新(已通过 GitHub API 复核)。

FAQ

  • 有 CLI 吗?:有:README 提供 npm install -g mcporter,并可用 mcporter --help 查看用法。
  • 必须用 TypeScript 吗?:不必须:CLI 只要有 Node.js 就能用;但库的最佳体验在 TypeScript。
  • 许可证是什么?:MIT(已通过 GitHub 许可证元数据复核)。
🙏

来源与感谢

Created by openclaw. Licensed under MIT.

openclaw/mcporter — ⭐ 4399

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产