远程MCP CLI客户端(FastMCP)
用于从不支持远程MCP的AI代理通过CLI执行一次快照的客户端。
安装,安装
单独使用此存储库时
uv sync在其他开发文件夹中使用时(推荐)
- 将此存储库克隆到开发文件夹
- 在动态输入提示中单击
.gitignore将克隆的文件夹名称添加到 - 在此存储库中
uv sync执行
例:
git clone rmcp-client
echo "rmcp-client/" >> .gitignore
cd rmcp-client
uv sync使用uvx进行一次命令初始化(推荐)
在空目录中运行时fastmcp-remote-mcp-client/ 创建文件夹 此存储库的内容将在其中展开。
uvx --from git+https://github.com/ekozmdev/fastmcp-remote-mcp-client init实行后,以人能读的形式 AGENTS.md 中所述修改相应参数的值。 此文件夹包含 **/* 写了 .gitignore 来修改标记元素的显示属性 单击功能区上 .gitignore 而需要与环境混合的每条反射光线,进行环境采样。
配置文件
mcp_servers.json 将条目添加到项目根目录,然后定义目标。
{
"mcpServers": {
"deepwiki": {
"transport": "http",
"url": "https://mcp.deepwiki.com/mcp"
},
"microsoft-learn": {
"transport": "http",
"url": "https://learn.microsoft.com/api/mcp"
},
"aws-knowledge": {
"transport": "http",
"url": "https://knowledge-mcp.global.api.aws"
},
"context7": {
"transport": "http",
"url": "https://mcp.context7.com/mcp"
}
}
}※Context7即使没有API键也在确认动作,但可能有使用限制。
使用方法
工具列表
python -m rmcp_client.cli list-tools --server deepwiki工具运行
python -m rmcp_client.cli call-tool \
--server deepwiki \
--tool ask_question \
--args '{"repoName":"vercel/ai","question":"目的を要約して"}'动作确认完毕(2026-01-31)
- DeepWiki:
list-tools/call-tool(ask_question) - 微软学习:
list-tools/call-tool(microsoft_docs_search) - AWS知识MCP:
list-tools/call-tool(aws___search_documentation) - 上下文7:
list-tools/call-tool(resolve-library-id,query-docs)
出力仕様
list-tools/call-tool仅JSON(标准输出)。- 失败时也向标准输出返回JSON,结束代码为
1。 - JSON以UTF-8输出,非ASCII不转义。
init将人能读的说明文输出到标准输出。
CLI仕様(抜粋)
--server是必需的- 配置文件为
mcp_servers.json固定 call-tool的,之--args仅限JSON对象
温暖的光芒
init 将此存储库的内容展开到指定目录。 默认值为 fastmcp-remote-mcp-client/ 中所述修改相应参数的值。 展开目标必须为空目录。
uvx --from git+https://github.com/ekozmdev/fastmcp-remote-mcp-client init
uvx --from git+https://github.com/ekozmdev/fastmcp-remote-mcp-client init AI代理指令(粘贴)
请将以下内容添加到开发中使用的AI代理的指令文件中。
リモートMCPはこのCLIを介して呼び出すこと。
コマンドは毎回ワンショットで実行し、標準出力のJSONのみを解析する。
このCLIは専用リポジトリ内で実行するため、必ずツールのフォルダへ移動してから `uv run` する。
使い方:
- ツール一覧:
cd
uv run python -m rmcp_client.cli list-tools --server
- ツール呼び出し:
cd
uv run python -m rmcp_client.cli call-tool --server --tool --args ''
注意:
- --server は必須
- --args は必ずJSONオブジェクト
- エラーも標準出力にJSONで返る