Lunar MCPX serves as an aggregator for Model Context Protocol (MCP) servers, streamlining the integration and management of multiple MCP servers dynamically. It enables developers to manage connections to various MCP-compatible services through simple configuration changes, allowing for rapid integration without coding.
Using Docker is the simplest way to get MCPX running:
docker pull lunar/mcpx:latest
docker run -p 8080:8080 lunar/mcpx:latest
This will start the MCPX server on port 8080 of your local machine.
For local installation, you'll need to:
Follow these steps:
# Clone the repository
git clone https://github.com/mcpx/mcpx.git
cd mcpx
# Install dependencies
npm install
# Start the server
npm start
MCPX is configured through a JSON configuration file that defines the MCP servers it connects to.
Create a config.json
file:
{
"servers": [
{
"name": "openai",
"host": "api.openai.com",
"port": 443,
"protocol": "https",
"apiKey": "YOUR_OPENAI_API_KEY"
},
{
"name": "anthropic",
"host": "api.anthropic.com",
"port": 443,
"protocol": "https",
"apiKey": "YOUR_ANTHROPIC_API_KEY"
}
],
"defaultServer": "openai"
}
You can also configure MCPX using environment variables:
export MCPX_PORT=8080
export MCPX_DEFAULT_SERVER=openai
export MCPX_OPENAI_API_KEY=your_api_key
export MCPX_ANTHROPIC_API_KEY=your_api_key
Once MCPX is running, you can connect MCP-compatible clients to it. MCPX accepts connections on the configured port (default: 8080).
For example, to connect Claude Desktop:
http://localhost:8080
)MCPX allows dynamically switching between different MCP backends:
# Using curl to switch the active model
curl -X POST http://localhost:8080/api/config/default -H "Content-Type: application/json" -d '{"server": "anthropic"}'
You can verify your MCPX instance is running correctly:
curl http://localhost:8080/health
This should return a 200 OK response with status information.
MCPX includes a control plane interface that helps you inspect live traffic and manage your instance. To access it:
http://localhost:8080/control
in your web browserThe control plane provides:
For troubleshooting, check the MCPX logs:
# When running with Docker
docker logs <container_id>
# When running locally
npm run logs
For more detailed information about features, architecture, and advanced options, visit the official documentation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcpx" '{"command":"npx","args":["-y","@thelunarcompany/mcpx"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"mcpx": {
"command": "npx",
"args": [
"-y",
"@thelunarcompany/mcpx"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"mcpx": {
"command": "npx",
"args": [
"-y",
"@thelunarcompany/mcpx"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect