Xray MCP Server

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.

Category
访问服务器

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 documentation
  • xray://docs/transports - Transport documentation
  • xray://docs/security - Security documentation
  • xray://examples/server-vless-reality - VLESS+REALITY server example
  • xray://examples/client-vless-reality - VLESS+REALITY client example
  • xray://examples/server-vmess-ws-tls - VMess+WS+TLS server example
  • xray://examples/server-trojan-tls - Trojan+TLS server example
  • xray://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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选