mcp-connector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MCP Connector

MCP 连接器

Connect to any MCP (Model Context Protocol) server and interact with its tools, resources, and prompts.
连接至任意MCP(Model Context Protocol)服务器,与其工具、资源和提示词进行交互。

Supported Transports

支持的传输方式

  • stdio — Launch a local MCP server as a subprocess (e.g.
    npx @modelcontextprotocol/server-filesystem /path
    )
  • sse — Connect to a remote MCP server via HTTP Server-Sent Events
  • streamable-http — Connect via the newer streamable HTTP transport (POST with SSE response)
  • stdio — 将本地MCP服务器作为子进程启动(例如
    npx @modelcontextprotocol/server-filesystem /path
  • sse — 通过HTTP Server-Sent Events连接远程MCP服务器
  • streamable-http — 通过较新的流式HTTP传输方式连接(带SSE响应的POST请求)

Usage Flow

使用流程

  1. Browse available servers with
    mcp_browse
    (or filter by category)
  2. Connect by name from the registry:
    mcp_connect(name="coingecko")
  3. Discover available tools/resources with
    mcp_list_tools
    or
    mcp_list_resources
  4. Use them via
    mcp_call_tool
    or
    mcp_read_resource
  5. Disconnect when done with
    mcp_disconnect
  1. 使用
    mcp_browse
    浏览可用服务器(或按类别筛选)
  2. 通过注册表中的名称连接:
    mcp_connect(name="coingecko")
  3. 使用
    mcp_list_tools
    mcp_list_resources
    发现可用的工具/资源
  4. 通过
    mcp_call_tool
    mcp_read_resource
    使用它们
  5. 使用完毕后通过
    mcp_disconnect
    断开连接

Pre-configured Registry

预配置注册表

A curated list of MCP servers is maintained in
config/mcp_servers.yaml
. Connect to any of them by name — no URL or transport details needed:
mcp_connect(name="coingecko")     # Crypto market data
mcp_connect(name="exa")           # Neural web search
mcp_connect(name="dexpaprika")    # DEX data across chains
Use
mcp_browse()
to see all available servers, or filter by category:
mcp_browse(category="blockchain")
mcp_browse(category="developer")
Some servers require environment variables (API keys). The tool will tell you which ones are missing.
我们在
config/mcp_servers.yaml
中维护了一份精选的MCP服务器列表。只需通过名称即可连接其中任意服务器——无需提供URL或传输细节:
mcp_connect(name="coingecko")     # 加密货币市场数据
mcp_connect(name="exa")           # 神经网络网页搜索
mcp_connect(name="dexpaprika")    # 跨链DEX数据
使用
mcp_browse()
查看所有可用服务器,或按类别筛选:
mcp_browse(category="blockchain")
mcp_browse(category="developer")
部分服务器需要环境变量(API密钥)。工具会提示您缺少哪些变量。

Ad-hoc Connections

临时连接

You can still connect to any MCP server not in the registry by providing transport details:
您仍可通过提供传输细节,连接至注册表中未收录的任意MCP服务器:

stdio (local subprocess)

stdio(本地子进程)

mcp_connect(
    name="fs",
    transport="stdio",
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
)
mcp_connect(
    name="fs",
    transport="stdio",
    command="npx",
    args=["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
)

SSE (HTTP Server-Sent Events)

SSE(HTTP Server-Sent Events)

mcp_connect(
    name="remote-tools",
    transport="sse",
    url="https://mcp.example.com/sse"
)
mcp_connect(
    name="remote-tools",
    transport="sse",
    url="https://mcp.example.com/sse"
)

Streamable HTTP

Streamable HTTP

mcp_connect(
    name="api-server",
    transport="streamable-http",
    url="https://mcp.example.com/mcp"
)
mcp_connect(
    name="api-server",
    transport="streamable-http",
    url="https://mcp.example.com/mcp"
)

Using Connected Servers

使用已连接的服务器

Call a tool

调用工具

mcp_call_tool(
    server="coingecko",
    tool="get_price",
    arguments={"coin": "bitcoin"}
)
mcp_call_tool(
    server="coingecko",
    tool="get_price",
    arguments={"coin": "bitcoin"}
)

Read a resource

读取资源

mcp_read_resource(
    server="remote-tools",
    uri="file:///data/config.json"
)
mcp_read_resource(
    server="remote-tools",
    uri="file:///data/config.json"
)

Notes

注意事项

  • Connections persist for the duration of the session
  • Multiple servers can be connected simultaneously
  • Server names must be unique — reconnecting with the same name replaces the old connection
  • Environment variables can be passed to stdio servers via the
    env
    parameter
  • Registry entries are in
    config/mcp_servers.yaml
    — add new servers there (no code changes needed)
  • 连接在会话期间保持有效
  • 可同时连接多个服务器
  • 服务器名称必须唯一——使用相同名称重新连接会替换旧连接
  • 可通过
    env
    参数将环境变量传递给stdio服务器
  • 注册表条目位于
    config/mcp_servers.yaml
    中——可在此添加新服务器(无需修改代码)