LR

llm4rocq/rocq-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

52 stars 19 forks 质量 80 趋势 8Apache-2.0

llm4rocq/rocq-mcp 是从 https://github.com/llm4rocq/rocq-mcp. 导入的 MCP 服务器候选。

概览

llm4rocq/rocq-mcp 是从 https://github.com/llm4rocq/rocq-mcp. 导入的 MCP 服务器候选。

概述(AI 翻译)

一个用于Rocq(前称Coq)证明开发的MCP服务器。它将编译、验证、查询和交互式策略步进作为MCP工具,使LLM代理能够编写和检查Rocq证明。

  • 十三个MCP工具由pet(Rocq的coq-lsp交互后端)支持。
  • 交互式工具。 检查证明目标,搜索环境,逐步操作战术。
  • 分阶段验证。 对承认、公理和陈述不匹配的沙盒审计。
  • 状态在调用间缓存以实现快速迭代。

本README上的说明。 以下章节主要面向AI代理使用这些工具(及其简报的人工操作员)的详细参考文档。

先修条件

  • Rocq / Coq —— rocq c 必须在你的 PATH 上。如果工作区包含 _RocqProject 或 _CoqProject 文件,服务器会解析其加载路径标志([-Q, -R, -I)。对于 dune 项目(没有 _CoqProject 但有一个 dune-project 文件),服务器会通过 dune coq top 自动检测加载路径——对于现代 (using rocq ...) 项目,则通过 dune rocq top 自动检测一次 [(coq.theory ...) / (rocq.theory …

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

rocq-mcp

An MCP server for Rocq (formerly Coq) proof development. It exposes compilation, verification, querying, and interactive tactic stepping as MCP tools, so that LLM agents can write and check Rocq proofs.

  • Thirteen MCP tools backed by pet (Rocq’s coq-lsp interactive backend).
  • Interactive tools. Inspect proof goals, search the environment, step through tactics.
  • Staged verification. Sandboxed audit of admits, axioms, and statement mismatches.
  • State is cached across calls for fast iteration.

A note on this README. The sections that follow are detailed reference documentation aimed primarily at AI agents consuming these tools (and the human operators briefing them).

Prerequisites

  • Rocq / Coq – rocq c must be on your PATH. If the workspace contains a _RocqProject or _CoqProject file, the server parses it for load-path flags (-Q, -R, -I). For dune projects (no _CoqProject but a dune-project file present), the server auto-detects load paths via dune coq top — or dune rocq top for modern (using rocq ...) projects — once per (coq.theory ...) / (rocq.theory ...) stanza, so multi-theory workspaces resolve cross-theory imports correctly, and writes a _RocqProject file in the workspace so that coq-lsp also picks them up. This generated file stays in the workspace and should be added to .gitignore. Otherwise it defaults to -Q Test.
  • pet (from coq-lsp) – recommended. Powers the interactive tools (rocq_query, rocq_assumptions, rocq_start, rocq_check, rocq_step_multi, rocq_toc, rocq_notations) and the proof-state enrichment / multi-error walker on rocq_compile_file. Without pet you fall back to rocq c-only operation: rocq_compile, rocq_compile_file (first error only, no goals), rocq_verify, rocq_diag — a substantial reduction in what an agent can do.
  • Python 3.11+

Installation

Using uv:

# Install (includes pytanque for interactive tools)
uv pip install -e .

For development (includes pytest):

uv pip install -e ".[dev]"

Tools

The server exposes thirteen MCP tools:

Compilation tools (compiler-based, no pytanque needed)

Tool Description
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "rocq-mcp": { "command": "rocq-mcp", "env": { "ROCQ_WORKSPACE": "/path/to/your/rocq/project" } } } }