远程MCP CLI客户端

一个通过命令行接口(CLI)从非远程MCP兼容的AI代理进行一次性执行的客户端工具。

  • by ekozmdev
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 ekozmdev/fastmcp-remote-mcp-client

使用说明

远程MCP CLI客户端(FastMCP)

用于从不支持远程MCP的AI代理通过CLI执行一次快照的客户端。

安装,安装

单独使用此存储库时

uv sync

在其他开发文件夹中使用时(推荐)

  1. 将此存储库克隆到开发文件夹
  2. 在动态输入提示中单击 .gitignore 将克隆的文件夹名称添加到
  3. 在此存储库中 uv sync 执行

例:

git clone <this-repo> 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 <dest>

AI代理指令(粘贴)

请将以下内容添加到开发中使用的AI代理的指令文件中。

リモートMCPはこのCLIを介して呼び出すこと。
コマンドは毎回ワンショットで実行し、標準出力のJSONのみを解析する。
このCLIは専用リポジトリ内で実行するため、必ずツールのフォルダへ移動してから `uv run` する。

使い方:
- ツール一覧:
  cd <path/to/fastmcp-remote-mcp-client>
  uv run python -m rmcp_client.cli list-tools --server <server-name>
- ツール呼び出し:
  cd <path/to/fastmcp-remote-mcp-client>
  uv run python -m rmcp_client.cli call-tool --server <server-name> --tool <tool-name> --args '<json-object>'

注意:
- --server は必須
- --args は必ずJSONオブジェクト
- エラーも標準出力にJSONで返る