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:
VS Code users must also enable Agent mode (for Copilot Chat) and add the following to settings.json:
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:
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:
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:
Docker
You can also run the X-UI MCP server using Docker:
Or use docker-compose to run both the documentation site and MCP server:
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.
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.