The zkMCP server provides a Model Context Protocol implementation for zero-knowledge proofs using circom. It enables you to build circuits, perform trusted setup, generate and verify zero-knowledge proofs without revealing sensitive information.
Before installing the server, ensure you have the following prerequisites:
Follow these steps to set up the zkMCP server:
Clone the repository:
git clone https://github.com/yourusername/zkMCP.git
cd zkMCP/server
Install dependencies:
npm install
Build the server:
npm run build
Add the server to your MCP settings configuration file:
{
"mcpServers": {
"zkproof": {
"command": "node",
"args": ["/path/to/zkMCP/server/build/index.js"],
"env": {
"ZKINTRO_DIR": "/path/to/circom/projects"
},
"disabled": false,
"autoApprove": []
}
}
}
Make sure to replace /path/to/zkMCP/server/build/index.js
with the actual path to the built server and /path/to/circom/projects
with the directory where your circom projects are located.
The zkMCP server provides four main functionalities:
You can build circuits from Circom files. This is the first step in the zero-knowledge proof workflow.
After building a circuit, you need to perform a trusted setup, which is a crucial cryptographic ceremony required for generating and verifying proofs.
Once the trusted setup is complete, you can generate zero-knowledge proofs for your circuits with appropriate inputs.
Finally, you can verify proofs to ensure they are valid without revealing the underlying data.
One included example demonstrates age verification without revealing birth date:
The age verification example shows how to:
This demonstrates the practical privacy-preserving capabilities of zero-knowledge proofs in a real-world scenario.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.