Get the FREE Ultimate OpenClaw Setup Guide →

mcp-rocq

RoCQ (Coq Reasoning Server)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio angrysky56-mcp-rocq uv --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 \
  --env COQ_PATH="path to coqtop binary" \
  --env COQ_LIB_PATH="path to coq library directory"

How to use

MCP-RoCQ is a Model Context Protocol server that provides advanced reasoning capabilities by integrating with the Coq proof assistant. It exposes tooling for dependent type checking, inductive type definitions, and property proving, enabling structured and automated interaction with Coq through an MCP-compatible interface. The server communicates via a structured protocol (XML-based in this project as per description) and surfaces detailed feedback for type errors and proof attempts, helping you reason about terms, types, and properties within Coq contexts.

To use the server, configure the MCP host (as shown in the configuration example) and submit requests for type checking, inductive type definitions, or property proofs. Type checking requests send a term and an expected type to verify compatibility within a given context. Inductive type requests define constructors and verify their well-formedness within Coq. Property proving requests supply a statement and optional tactics or automation cues to drive a proof attempt. The tooling is designed to provide structured responses with success/failure signals, proof obligations, and diagnostic messages to guide refinement of terms or proof scripts.

How to install

Prerequisites:

  • Coq Platform 8.19 (2024.10) installed on your system
  • Python and uv (uvx) available for the environment you will use
  • Git for cloning the repository

Step-by-step installation:

  1. Install Coq Platform 8.19 (2024.10)

  2. Clone the MCP-RoCQ repository

  3. Set up the Python/uv environment (uvx)

    • On Windows with Python: uv venv ./venv/Scripts/activate uv pip install -e .
    • On Unix-like systems, adapt paths accordingly: uv venv source venv/bin/activate uv pip install -e .
  4. Validate the installation

    • Ensure the mcp_rocq entry point is discoverable by uv and that the Coq paths in the configuration point to your Coq Platform installation.
  5. Run the MCP server

    • Use the provided mcp_config example as a basis to start the server via your MCP host manager (Claude App, mcphost, etc.).

Additional notes

Notes and tips:

  • Ensure the Coq Platform paths (coqtop.exe and lib/coq) match your actual installation directory. Adjust the --coq-path and --lib-path values accordingly.
  • If you encounter syntax or protocol issues, verify that the MCP host client uses the expected XML/JSON messaging structure the RoCQ server expects.
  • When updating Coq, some tactics or Verward proofs may require updates to the coercions or library imports; keep your Coq libraries in sync with your proof code.
  • If you observe import or module resolution errors, double-check the Coq library path provided to the server and ensure Coq can locate the standard library and any required user libraries.
  • For debugging, enable verbose logging in the MCP host and capture responses from RoCQ to pinpoint where syntax or type mismatches occur.

Related MCP Servers

Sponsor this space

Reach thousands of developers