This MCP server enables AI models to interact with Yuque knowledge platform, providing tools for document management, searches, and statistical analysis through the Yuque API.
Clone the repository:
git clone https://github.com/Henryhaoson/Yueque-MCP-Server.git
cd Yueque-MCP-Server
Install dependencies:
npm install
Create an environment file:
cp .env.example .env
(Optional) Add your Yuque API token to the .env
file:
YUQUE_API_TOKEN=your_yuque_api_token_here
You can also provide the token via query parameters when connecting to the server.
# HTTP server mode
npm run dev
# CLI stdio mode
npm run dev:cli
Build the project first:
npm run build
Then run in HTTP or CLI mode:
# HTTP server mode
npm run start
# CLI stdio mode
npm run start:cli
Build and start the container:
docker-compose up -d
View logs:
docker-compose logs -f
Stop the service:
docker-compose down
Configure via environment variables or in the .env
file:
# Example .env file
PORT=3000
YUQUE_API_TOKEN=your_token_here
YUQUE_API_BASE_URL=https://www.yuque.com/api/v2
Build the Docker image:
docker build -t yuque-mcp-server .
Run the container:
docker run -d -p 3000:3000 --name yuque-mcp-server yuque-mcp-server
With environment variables:
docker run -d -p 3000:3000 \
-e YUQUE_API_TOKEN=your_token_here \
-e YUQUE_API_BASE_URL=https://www.yuque.com/api/v2 \
--name yuque-mcp-server yuque-mcp-server
This MCP server can be used with AI models that support the Model-Context-Protocol, allowing them to interact with Yuque through defined tools:
When connecting to the SSE endpoint, you can override environment configurations with query parameters:
Example:
http://localhost:3000/sse?accessToken=your_token_here&baseUrl=https://custom.yuque.api/v2
This allows dynamic configuration without modifying the .env file. Each SSE connection can use different configurations, enabling the same server instance to serve multiple users or environments simultaneously.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "yuque" '{"command":"npm","args":["run","start:cli"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"yuque": {
"command": "npm",
"args": [
"run",
"start:cli"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"yuque": {
"command": "npm",
"args": [
"run",
"start:cli"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect