🤔 Introducing APISIX AI Gateway – Built for LLMs and AI workloads. Learn More

mcp-bridge

Description

The mcp-bridge Plugin bridges an HTTP client speaking the Model Context Protocol (MCP) over SSE to a stdio-based MCP server. APISIX spawns the configured command as a backend process and relays messages between the SSE connection and the process’s standard input and output.

WARNING

The mcp-bridge Plugin is deprecated and will be removed in a future release. We recommend not using it for new deployments.

Attributes

NameTypeRequiredDefaultDescription
commandstringTrueCommand used to launch the MCP server process, e.g. npx.
argsarray[string]FalseArguments passed to the command.
base_uristringFalse""Base URI used to build the SSE and message endpoint paths.

Example usage

Create a Route with the mcp-bridge Plugin, pointing command and args at the MCP server you want to expose:

curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
  -H "X-API-KEY: ${admin_key}" \
  -d '{
    "id": "mcp-route",
    "uri": "/mcp/*",
    "plugins": {
      "mcp-bridge": {
        "base_uri": "/mcp",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/"]
      }
    }
  }'

An MCP client can then connect to the SSE endpoint at /mcp/sse and exchange messages through /mcp/message.