mcpshim
by mcpshim·★ 59·综合分 46
MCPShim 将远程 MCP 服务器转换为本地 CLI 命令,在单个守护进程中处理认证和工具调用。
概述
MCPShim 是一个基于 Go 的轻量级解决方案,由守护进程 (mcpshimd) 和 CLI 客户端 (mcpshim) 组成,将远程 MCP 服务器与本地 shell 工作流桥接。它在单个位置处理 MCP 生命周期问题,包括会话管理、发现、重试和 OAuth 流程,同时将 MCP 工具作为标准 CLI 命令公开,具有参数映射和结构化 JSON 输出。这消除了脚本或代理中自定义每服务器布线的需要。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您需要将多个 MCP 服务器集成到 shell 工作流或 AI 代理中,而不想为每个服务器实现自定义身份验证和会话管理时,选择 MCPShim。
什么时候不要选它
如果您需要对 MCP 服务器进行直接编程访问,而不希望通过 CLI 抽象层,或者您正在构建紧密耦合的应用程序,守护进程的开销不值得,则不要选择 MCPShim。
此 server 暴露的工具
从 README 抽取出 12 个工具statusDisplay MCPShim daemon status
serversList registered MCP servers
toolsList tools for all or one server
inspect--server s --tool tShow detailed schema of a specific tool
call--server s --tool t --arg valueExecute a tool call with arguments
add--name s --url ... [--alias a]Register a new MCP endpoint
set auth--server s --header K=VSet authentication headers for a server
remove--name sRemove a registered server
reloadReload daemon configuration
login--server s [--manual]Complete OAuth login flow for a server
history[--server s] [--tool t] [--limit n]Show persisted call history
script[--install] [--dir ~/.local/bin]Generate or install shell alias wrappers for tools
可对比工具
安装
安装
- 从源码安装:
go install github.com/mcpshim/mcpshim/cmd/mcpshimd@latest
go install github.com/mcpshim/mcpshim/cmd/mcpshim@latest- 配置:
mkdir -p ~/.config/mcpshim
cp configs/mcpshim.example.yaml ~/.config/mcpshim/config.yaml- 启动守护进程:
mcpshimd- 使用 CLI:
mcpshim servers
mcpshim tools --server notion
mcpshim call --server notion --tool search --query "项目"对于 Claude Desktop,添加到 config.json:
{
"mcpServers": {
"mcpshim": {
"command": "mcpshimd",
"args": []
}
}
}FAQ
- MCPShim 如何处理认证?
- MCPShim 通过守护进程集中处理认证。它支持 OAuth 流程,并在收到 401 响应时自动启动登录。认证头存储在 SQLite 数据库中。
- 我可以在任何 MCP 服务器上使用 MCPShim 吗?
- 是的,MCPShim 设计用于任何 MCP 服务器,无论传输方式(HTTP、WebSocket)或认证方法如何。它会使用特定的 URL 和传输协议注册服务器。
mcpshim 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。