Xray MCP Server
Enables generation and validation of Xray-core proxy configurations using natural language. Supports VLESS, VMess, Trojan, and Shadowsocks protocols with automatic key generation and multiple transport/security options including REALITY.
README
Xray MCP Server
A Model Context Protocol (MCP) server for generating Xray-core configurations using natural language. This server allows LLMs to create server and client configurations for various proxy protocols.
Features
- Protocol Support: VLESS, VMess, Trojan, Shadowsocks
- Transport Support: TCP, WebSocket, gRPC, XHTTP
- Security Support: None, TLS, REALITY
- Automatic Key Generation: UUID, X25519 key pairs, Short IDs, Passwords
- Configuration Validation: Syntax and semantic validation
- Example Configurations: Ready-to-use templates
- Documentation: Built-in protocol, transport, and security documentation
Installation
npm install
npm run build
Usage with Cursor
Add to your Cursor MCP settings (~/.cursor/mcp.json):
{
"mcpServers": {
"xray-mcp": {
"command": "node",
"args": ["/path/to/xray-mcp/dist/index.js"]
}
}
}
Available Tools
Configuration Generation
generate_server_config
Generate Xray server configuration with specified protocol, transport, and security options.
Example:
Generate a VLESS server with REALITY on port 443
generate_client_config
Generate Xray client configuration for connecting to a proxy server.
Example:
Create a client config for VLESS+REALITY server at example.com:443
Key Generation
generate_uuid
Generate a new UUID v4 for VLESS/VMess authentication.
generate_x25519_keypair
Generate X25519 key pair for REALITY (returns private and public keys).
generate_short_id
Generate a random short ID for REALITY authentication.
generate_password
Generate a random password for Trojan or Shadowsocks.
generate_ss2022_key
Generate a base64 key for Shadowsocks 2022.
Utilities
validate_config
Validate an Xray configuration for syntax and semantic errors.
list_protocols
List all supported proxy protocols with descriptions.
list_transports
List all supported transport types with descriptions.
list_security
List all supported security types with descriptions.
list_reality_targets
List recommended target sites for REALITY.
Available Resources
xray://docs/protocols- Protocol documentationxray://docs/transports- Transport documentationxray://docs/security- Security documentationxray://examples/server-vless-reality- VLESS+REALITY server examplexray://examples/client-vless-reality- VLESS+REALITY client examplexray://examples/server-vmess-ws-tls- VMess+WS+TLS server examplexray://examples/server-trojan-tls- Trojan+TLS server examplexray://examples/server-shadowsocks-2022- Shadowsocks 2022 server example
Example Conversations
Create a VLESS+REALITY Server
User: Create a VLESS server with REALITY on port 443, targeting microsoft.com
Assistant: (calls generate_server_config with appropriate parameters)
Create Matching Client Config
User: Generate a client config to connect to this server
Assistant: (calls generate_client_config with server details)
Generate Keys
User: Generate a new UUID and X25519 key pair for REALITY
Assistant: (calls generate_uuid and generate_x25519_keypair)
Supported Configurations
Protocols
| Protocol | Description | Auth Type |
|---|---|---|
| VLESS | Lightweight, supports XTLS Vision | UUID |
| VMess | Classic V2Ray protocol | UUID |
| Trojan | HTTPS-mimicking | Password |
| Shadowsocks | Simple and fast | Password |
Transports
| Transport | CDN Support | REALITY Support |
|---|---|---|
| TCP | No | Yes |
| WebSocket | Yes | No |
| gRPC | Partial | Yes |
| XHTTP | Yes | Yes |
Security
| Security | Certificate Required | Description |
|---|---|---|
| None | No | No encryption |
| TLS | Yes | Standard TLS |
| REALITY | No | Advanced camouflage |
Development
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.