Skip to content
本站由雨云提供云计算服务

MCP

MCP (Model Context Protocol) is a new open standard protocol for establishing secure bidirectional connections between large language models and data sources. Simply put, it extracts function tools as independent services, allowing AstrBot to remotely invoke these function tools via the MCP protocol, which then return results to AstrBot.

image

AstrBot v3.5.0 supports the MCP protocol, enabling you to add multiple MCP servers and use function tools from MCP servers.

image

Initial Configuration

MCP servers are typically launched using uv or npm, so you need to install these two tools.

For uv, you can install it directly via pip. Quick installation via AstrBot WebUI:

image

Just enter uv.

If you're deploying AstrBot with Docker, you can also execute the following command for quick installation:

bash
docker exec astrbot python -m pip install uv

If you're deploying AstrBot from source, please install it within the created virtual environment.

For npm, you need to install node.

If you're deploying AstrBot from source or using one-click installation, please refer to Download Node.js to download to your local machine.

If you're using Docker to deploy AstrBot, you need to install node in the container (future AstrBot Docker images will include node by default). Please execute the following commands:

bash
sudo docker exec -it astrbot /bin/bash
apt update && apt install curl -y
export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist
# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 22
# Verify version:
node -v
nvm current
npm -v
npx -v

After installing node, you need to restart AstrBot to apply the new environment variables.

Installing MCP Servers

If you're deploying AstrBot with Docker, please install MCP servers in the data directory.

An Example

I want to install an MCP server for querying papers on Arxiv and found this repository: arxiv-mcp-server. Referring to its README,

We extract the necessary information:

json
{
    "command": "uv",
    "args": [
        "tool",
        "run",
        "arxiv-mcp-server",
        "--storage-path", "data/arxiv"
    ]
}

Configure it in the AstrBot WebUI:

image

That's it.

Reference links:

  1. Learn how to use MCP here: Model Context Protocol
  2. Get commonly used MCP servers here: awesome-mcp-servers, Model Context Protocol servers, MCP.so

Deployed on Rainyun Logo