This server implements the Model Context Protocol (MCP), allowing for standardized interaction with AI models. MCP-X provides a unified interface for sending prompts to models and receiving responses, making it easier to work with AI models regardless of their underlying implementation.
You can install the MCP server package using pip:
pip install mcp-x
After installation, you can start the MCP server using the following command:
mcp-x run
This will start the server with default settings, typically listening on localhost port 8000.
You can customize the server configuration by specifying options:
mcp-x run --host 0.0.0.0 --port 8080
MCP-X allows you to connect to different AI models. Specify the model you want to use:
mcp-x run --model gpt-3.5-turbo
To send a prompt to the model, make a POST request to the /prompt
endpoint:
curl -X POST http://localhost:8000/prompt \
-H "Content-Type: application/json" \
-d '{"prompt": "Explain quantum computing in simple terms", "max_tokens": 100}'
To retrieve information about available models:
curl http://localhost:8000/models
You can configure MCP-X using environment variables:
MCP_HOST
: Specify the host address (default: localhost)MCP_PORT
: Specify the port number (default: 8000)MCP_MODEL
: Default model to useMCP_API_KEY
: Your API key for accessing models that require authenticationFor example:
export MCP_PORT=9000
export MCP_MODEL=gpt-4
mcp-x run
For any persistent issues, check the server logs for more detailed error information.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-x" '{"command":"python","args":["-m","mcp_x"]}'
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": {
"mcp-x": {
"command": "python",
"args": [
"-m",
"mcp_x"
]
}
}
}
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": {
"mcp-x": {
"command": "python",
"args": [
"-m",
"mcp_x"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect