The MCP-RoCQ server provides advanced logical reasoning capabilities through integration with the Coq proof assistant. It enables automated dependent type checking, inductive type definitions, and property proving with both custom tactics and automation through a structured Model Context Protocol interface.
First, you need to install the Coq Platform 8.19 (2024.10). Coq is a formal proof management system that provides a formal language to write mathematical definitions, executable algorithms, and theorems.
You can download and install it from: https://github.com/coq/platform
git clone https://github.com/angrysky56/mcp-rocq.git
cd mcp-rocq
uv venv
./venv/Scripts/activate
uv pip install -e .
Alternatively, you can install dependencies using pip:
pip install -r requirements.txt
To configure MCP-RoCQ with Claude App or mcphost, you need to create a JSON configuration. Adjust the paths according to your Coq installation and repository location:
{
"mcp-rocq": {
"command": "uv",
"args": [
"--directory",
"F:/GithubRepos/mcp-rocq",
"run",
"mcp_rocq",
"--coq-path",
"F:/Coq-Platform~8.19~2024.10/bin/coqtop.exe",
"--lib-path",
"F:/Coq-Platform~8.19~2024.10/lib/coq"
]
}
}
The MCP-RoCQ server provides three main capabilities that you can access via JSON requests:
Use this capability to verify terms against expected types:
{
"tool": "type_check",
"args": {
"term": "<term to check>",
"expected_type": "<type>",
"context": ["relevant", "modules"]
}
}
Create custom inductive data types with this capability:
{
"tool": "define_inductive",
"args": {
"name": "Tree",
"constructors": [
"Leaf : Tree",
"Node : Tree -> Tree -> Tree"
],
"verify": true
}
}
Prove logical properties using tactics and automation:
{
"tool": "prove_property",
"args": {
"property": "<statement>",
"tactics": ["<tactic sequence>"],
"use_automation": true
}
}
Each of these capabilities accepts specific parameters as shown in the examples above. The server responds with results, including whether operations succeeded or failed, along with detailed error information when necessary.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-rocq" '{"command":"uv","args":["--directory","F:/GithubRepos/mcp-rocq","run","mcp_rocq","--coq-path","F:/Coq-Platform~8.19~2024.10/bin/coqtop.exe","--lib-path","F:/Coq-Platform~8.19~2024.10/lib/coq"]}'
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-rocq": {
"command": "uv",
"args": [
"--directory",
"F:/GithubRepos/mcp-rocq",
"run",
"mcp_rocq",
"--coq-path",
"F:/Coq-Platform~8.19~2024.10/bin/coqtop.exe",
"--lib-path",
"F:/Coq-Platform~8.19~2024.10/lib/coq"
]
}
}
}
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.json2. Add this to your configuration file:
{
"mcpServers": {
"mcp-rocq": {
"command": "uv",
"args": [
"--directory",
"F:/GithubRepos/mcp-rocq",
"run",
"mcp_rocq",
"--coq-path",
"F:/Coq-Platform~8.19~2024.10/bin/coqtop.exe",
"--lib-path",
"F:/Coq-Platform~8.19~2024.10/lib/coq"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect