The MCP-Logic server is built with Python and integrates with Prover9/Mace4 to provide automated reasoning capabilities for AI systems through a clean MCP interface.
MCP-Logic
An MCP server for automated first-order logic reasoning using Prover9 and Mace4.
Features
Theorem Proving - Prove logical statements with Prover9
Model Finding - Find finite models with Mace4
Counterexample Finding - Show why statements don't follow
Syntax Validation - Pre-validate formulas with helpful error messages
Categorical Reasoning - Built-in support for category theory proofs
Self-Contained - All dependencies install automatically
Related MCP server: didlogic_mcp
Quick Start
Installation
Linux/macOS:
Windows:
The setup script automatically:
Downloads and builds LADR (Prover9 + Mace4)
Creates Python virtual environment
Installs all dependencies
Generates Claude Desktop config
Claude Desktop Integration
Add to your Claude Desktop MCP config (auto-generated at claude-app-config.json):
Important: Replace /absolute/path/to/mcp-logic with your actual repository path.
Available Tools
Tool | Purpose |
prove | Prove statements using Prover9 |
check-well-formed | Validate formula syntax with detailed errors |
find-model | Find finite models satisfying premises |
find-counterexample | Find counterexamples showing statements don't follow |
verify-commutativity | Generate FOL for categorical diagram commutativity |
get-category-axioms | Get axioms for category/functor/group/monoid |
Example Usage
Prove a Theorem
Result: ✓ THEOREM PROVED
Find a Counterexample
Result: Model found where P(a) is true but P(b) is false, proving the conclusion doesn't follow.
Verify Categorical Diagram
Result: FOL premises and conclusion to prove that f∘g = h.
Running Locally
Instead of Claude Desktop, run the server directly:
Linux/macOS:
Windows:
Project Structure
What's New in v0.2.0
Enhanced Features:
✅ Mace4 model finding and counterexample detection
✅ Detailed syntax validation with position-specific errors
✅ Categorical reasoning support (category theory axioms, commutativity verification)
✅ Structured JSON output from all tools
✅ Self-contained installation (no manual path configuration)
Development
Run tests:
Test components directly:
Documentation
ENHANCEMENTS.md- Quick reference for v0.2.0 featuresDocuments/- Detailed analysis and exampleswalkthrough.md- Implementation details (in artifacts)
Troubleshooting
"Prover9 not found" error:
Run the setup script:
./linux-setup-script.shorwindows-setup-mcp-logic.batCheck that
ladr/bin/prover9andladr/bin/mace4exist
Server not updating:
Restart Claude Desktop after code changes
Check logs for syntax errors
Syntax validation warnings:
Use lowercase for predicates/functions (e.g.,
man(x)notMan(x))Add spaces around operators for clarity
Balance all parentheses
License
MIT
Credits
Prover9/Mace4: William McCune's LADR library
LADR Repository: laitep/ladr
Appeared in Searches
- A server for finding information about Chinese metaphysics and mysticism
- Comparison of Python-based tools for converting TeX to Lean
- Tools for Converting LaTeX Mathematics to Lean Formalizations
- Recommended helper server for automating TeX to Lean conversions in GRAD-5 repository
- Tools and Systems for Math, AI, and Proof Verification with Bug Detection and Auto Fixing