Model Context Protocol (MCP) for X-UI

Access the official X-UI docs and code examples in your AI client.

What is MCP?

The Model Context Protocol (MCP) is an open standard for connecting AI assistants to real, trusted sources of documentation and code. For X-UI users, this means you get answers that are accurate, up-to-date, and directly reference the official docs.

To learn more about MCP, see the official documentation.

Why use MCP?

Popular AI coding assistants are excellent at providing answers, especially to straightforward questions. But when faced with deeper, more complex questions that require understanding concepts from multiple parts of the documentation, they often hallucinate links, cite non-existent documentation, or provide answers that are hard to verify.

MCP solves these problems by:

  • Quoting real, direct sources in answers
  • Linking to actual documentation—no imaginary links that lead to 404s
  • Using component code from officially published registries

Installation and Setup

The sections below detail how to set up the X-UI MCP in popular agentic coding environments.

VS Code, Cursor, Windsurf

Open the MCP configuration (Settings → MCP → Add Server) and add the following:

json
"mcpServers": {
  "x-ui-mcp": {
    "type": "stdio",
    "command": "npx",
    "args": ["-y", "@xdev-asia/x-ui-mcp-server@latest"]
  }
}

VS Code users must also enable Agent mode (for Copilot Chat) and add the following to settings.json:

json
"chat.mcp.enabled": true,
"chat.mcp.discovery.enabled": true

JetBrains IDEs

Open the MCP configuration (Settings → Tools → AI Assistant → Model Context Protocol (MCP)) and add the following:

  • Name: X-UI MCP
  • Command: npx
  • Arguments: -y @xdev-asia/x-ui-mcp-server@latest

Click OK and Apply.

Zed

Search for agent: add context server in the Command Palette and add the following:

json
{
  "x-ui-mcp-server": {
    "command": {
      "path": "npx",
      "args": ["-y", "@xdev-asia/x-ui-mcp-server@latest"],
      "env": {}
    }
  }
}

Claude Code

Claude Code is Anthropic's agentic coding tool that runs in your terminal. You can add the X-UI MCP server via the command line:

bash
claude mcp add x-ui-mcp -- npx -y @xdev-asia/x-ui-mcp-server@latest

By default, this installs the MCP server to local-scope of the project you are working on. If you want the MCP server to always be available to all projects on your machine, install it to user-scope:

bash
claude mcp add x-ui-mcp -s user -- npx -y @xdev-asia/x-ui-mcp-server@latest

Docker

You can also run the X-UI MCP server using Docker:

bash
# Build MCP server image
docker build -t x-ui-mcp -f packages/mcp-server/Dockerfile .

# Run MCP server
docker run -it x-ui-mcp

Or use docker-compose to run both the documentation site and MCP server:

bash
# Start all services
docker-compose up -d

# View docs at http://localhost:3000

LLMs.txt

X-UI also provides an llms.txt file for AI/LLM consumption. This file is automatically generated during build and contains information about all available components.

text
https://x-ui.xdev.asia/llms.txt

Troubleshooting

MCP connection errors

Make sure you have Node.js 18+ installed and that npx is available in your PATH.

MCP not being used in responses

Ensure your AI client has MCP enabled. In VS Code, check that chat.mcp.enabled is set to true. In Cursor, verify the MCP server shows as "Connected" in the settings.