Connect Local MCP Servers to MCPX
You can run MCP servers from source and connect them to MCPX locally. This gives you full control over the server code and behavior.
In this example, we’ll walk through using the Todoist MCP server as a local server.
1
Clone and Build the Server
Download the server repository and build it locally.
# Clone the server repository
git clone https://github.com/Doist/todoist-mcp.git
# Install dependencies and build
cd todoist-mcp
npm install
npm run build
cd ..
This will produce a compiled server in todoist-mcp/dist
.
2
Prepare Directory Structure
Organize your project folders for running MCPX.
# Create the servers directory
mkdir -p servers
# Copy the built server to the servers directory
cp -r todoist-mcp ./servers/todoist-mcp
# Create a config directory for your mcp.json file
mkdir -p config
3
Configure mcp.json
Define your local server inside mcp.json.
nano config/mcp.json
Example mcp.json
:
{
"mcpServers": {
"todoist-mcp": {
"command": "node",
"args": ["/lunar/servers/todoist-mcp/bin/index.js"],
"env": {
"TODOIST_API_KEY": "YOUR_TODOIST_API_KEY"
}
}
}
}
Make sure the path matches the location inside the Docker container.
4
Run MCPX with Docker
Mount the local config and server folders into the container.
docker run --rm --pull always -v ./config:/lunar/packages/mcpx-server/config -v ./servers:/lunar/servers -p 9000:9000 -p 5173:5173 -p 9001:9001 -p 3000:3000 --name mcpx us-central1-docker.pkg.dev/prj-common-442813/mcpx/mcpx:latest