home / mcp / xray mcp server

Xray MCP Server

Provides an MCP server to generate Xray-core server/client configurations with protocol, transport, and security options.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "clcc2019-xray-mcp": {
      "command": "node",
      "args": [
        "/path/to/xray-mcp/dist/index.js"
      ]
    }
  }
}

You can generate, validate, and manage Xray-based server and client configurations through an MCP server that runs locally. This MCP server enables you to specify protocols, transports, and security options, and to automatically create ready-to-use configurations for Xray-core. It also supports key and credential generation to simplify secure deployments.

How to use

You connect your MCP client to the local MCP server to generate and validate configurations. Start by ensuring the MCP server is installed and built, then run the MCP with the local command shown here. Use the MCP client to request a server configuration by choosing your desired protocol, transport, and security settings, and to request a matching client configuration to connect to that server. You can generate authentication data such as UUIDs and X25519 keys as needed for REALITY-enabled setups, and you can validate generated configurations before applying them.

How to install

Prerequisites: you need Node.js and npm installed on your system.

npm install
npm run build

Additional sections

Configuration and operational notes come from the built-in tools and templates. You can generate server and client configurations, create keys and credentials, and validate your configurations before use. Real-time examples include creating a VLESS+REALITY setup, generating a UUID, and producing a matching client configuration to connect to the server.

Available tools

generate_server_config

Create an Xray server configuration by selecting protocol, transport, and security options.

generate_client_config

Create a client configuration to connect to a server with the chosen options.

generate_uuid

Generate a new UUID v4 for authentication.

generate_x25519_keypair

Generate an X25519 key pair for REALITY authentication.

generate_short_id

Create 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.

validate_config

Check an Xray configuration for syntax and semantic correctness.

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 REALITY target sites.