mcporter 是一个用于直接与 MCP(Model Context Protocol)服务器交互的命令行工具,支持通过 HTTP 或 stdio 两种方式连接。它的主要用途是让用户在不依赖其他客户端的情况下,列出、配置、认证、调用和检查 MCP 服务器及其工具。
主要能力
- 列出服务器与工具:使用 mcporter list 查看可用服务器,使用 mcporter list <server> --schema 查看指定服务器的工具结构。
- 调用工具:支持多种调用方式,包括选择器语法(如 mcporter call linear.list_issues team=ENG limit:5)、函数语法(如 mcporter call "linear.create_issue(title: "Bug")")、完整 URL(如 mcporter call https://api.example.com/mcp.fetch url:https://example.com)、stdio 方式(如 mcporter call --stdio "bun run ./server.ts" scrape url=https://example.com)以及 JSON 参数(如 mcporter call <server.tool> --args '{"limit":5}')。
- 认证与配置:支持 OAuth 认证(mcporter auth <server | url> [--reset]),以及配置管理命令 mcporter config list|get|add|remove|import|login|logout。
- 守护进程管理:提供 mcporter daemon start|status|stop|restart 命令。
- 代码生成:支持生成 CLI(mcporter generate-cli --server <name> 或 --command <url>)、检查 CLI(mcporter inspect-cli <path> [--json])以及生成 TypeScript 客户端或类型(mcporter emit-ts <server> --mode client|types)。
使用方式
快速开始可依次执行 mcporter list、mcporter list <server> --schema、mcporter call <server.tool> key=value。调用工具时可根据场景选择选择器、函数语法、完整 URL、stdio 或 JSON 参数。认证使用 mcporter auth,配置使用 mcporter config 系列命令。
配置与输出
默认配置文件路径为 ./config/mcporter.json,可通过 --config 覆盖。建议使用 --output json 获取机器可读的结果。
适用场景
适用于需要直接与 MCP 服务器交互、调试或集成 MCP 工具的开发与运维场景,包括列出工具、调用工具、管理认证与配置、生成 CLI 或 TypeScript 代码等。
限制
关于平台支持、收费模式、价格、具体效果等事实,资料中暂未提供。