Skip to content

Repository files navigation

Xiaozhi MCP Adapter

中文:
这是一个给小智反向 MCP 接入场景使用的桥接器。它会主动连接小智提供的反向接入地址,并把一个或多个标准 MCP 服务挂到这条连接后面。

English:
This is a bridge for XiaoZhi reverse MCP access. It actively connects to XiaoZhi-provided reverse endpoints and exposes one or more standard MCP servers through that connection.

运行 / Run

本地运行 / Local:

pip install -r requirements.txt
npm install --prefix ui-new
npm run build --prefix ui-new
copy .env.example .env
python app.py

中文:打开 http://127.0.0.1:8765
English: Open http://127.0.0.1:8765.

鉴权与持久化 / Auth And Persistence

中文:
从现在开始,不再要求你手动预先创建 auth_config.json
容器默认把持久化目录设为 /app/data,首次进入网页时:

  • 如果还没有管理员配置
  • 或者密码仍然是弱密码

页面会强制进入初始化流程,并自动把鉴权文件写到:

/app/data/auth_config.json

English:
You no longer need to manually create auth_config.json before first start.
The container now uses /app/data as the persistent data directory. On first visit, if admin auth is missing or still weak, the setup page will initialize it automatically and write:

/app/data/auth_config.json

配置 / Config

中文:默认配置文件是 mcp_config.json
English: The default config file is mcp_config.json.

示例 / Example:

{
  "upstreams": [
    {
      "name": "xiaozhi-a",
      "endpoint": "wss://your-xiaozhi-endpoint"
    }
  ],
  "mcpServers": {
    "example-remote-mcp": {
      "type": "streamablehttp",
      "url": "http://your-mcp-server:8000/mcp"
    }
  },
  "bindings": [
    {
      "upstream": "xiaozhi-a",
      "server": "example-remote-mcp"
    }
  ]
}

中文说明:

  • 如果 upstreamsbindings 为空,适配器仍然会兼容 MCP_ENDPOINT
  • mcpServers 支持 streamablehttphttpssestdio

English notes:

  • If upstreams and bindings are empty, the adapter still falls back to MCP_ENDPOINT
  • mcpServers supports streamablehttp, http, sse, and stdio

Docker

docker compose up --build -d

中文:
不需要手动创建 auth_config.json
只要保证 docker-compose.yml 同目录下有一个可持久化的 data/ 目录即可,程序会自己把鉴权配置写进去。

English:
You do not need to manually create auth_config.json.
Just keep a persistent data/ directory next to docker-compose.yml, and the app will write auth config there automatically.

前端 / UI

中文:React 管理台在 ui-new
English: The React admin console lives under ui-new.

About

一个为小智机器人打造的MCP适配器,可以快速便捷的为小智添加MCP工具,支持标准MCP协议和多种添加方式

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages