Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Logicprove that if all men are mortal and Socrates is a man, then Socrates is mortal"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Logic
A self-contained MCP server for first-order logic reasoning, implemented in TypeScript with no external binary dependencies.
Original: https://github.com/angrysky56/mcp-logic/
Features
Core Reasoning
Theorem Proving — Prove logical statements using resolution
Model Finding — Find finite models satisfying premises
Counterexample Detection — Find models showing conclusions don't follow
Syntax Validation — Pre-validate formulas with detailed error messages
Engine Federation
Multi-Engine Architecture — Automatic engine selection based on formula structure
Prolog Engine (Tau-Prolog) — Efficient for Horn clauses, Datalog, equality reasoning
SAT Engine (MiniSat) — Handles general FOL and non-Horn formulas
Engine Parameter — Explicit engine selection:
'prolog','sat', or'auto'
Advanced Logic
Arithmetic Support — Built-in predicates:
lt,gt,plus,minus,times,dividesEquality Reasoning — Reflexivity, symmetry, transitivity, congruence axioms
CNF Clausification — Transform FOL to Conjunctive Normal Form
DIMACS Export — Export CNF for external SAT solvers
MCP Protocol
Session-Based Reasoning — Incremental knowledge base construction
Axiom Resources — Browsable axiom libraries (category theory, Peano, ZFC, etc.)
Reasoning Prompts — Templates for proof by contradiction, formalization, etc.
Verbosity Control — Token-efficient responses for LLM chains
Infrastructure
Self-Contained — Pure npm dependencies, no external binaries
Structured Errors — Machine-readable error information with suggestions
254 Tests — Comprehensive test coverage
Quick Start
Installation
Running the Server
Or for development with auto-reload:
Claude Desktop / MCP Client Configuration
Add to your MCP configuration:
Available Tools
Core Reasoning Tools
Tool | Description |
prove | Prove statements using resolution with engine selection |
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/monoid/group |
Session Management Tools
Tool | Description |
create-session | Create a new reasoning session with TTL |
assert-premise | Add a formula to a session's knowledge base |
query-session | Query the accumulated KB with a goal |
retract-premise | Remove a specific premise from the KB |
list-premises | List all premises in a session |
clear-session | Clear all premises (keeps session alive) |
delete-session | Delete a session entirely |
Engine Selection
The prove tool supports automatic or explicit engine selection:
Engine | Best For | Capabilities |
| Horn clauses, Datalog | Equality, arithmetic, efficient unification |
| Non-Horn formulas, SAT problems | Full FOL, CNF solving |
| Default — selects based on formula | Analyzes clause structure |
The response includes engineUsed to show which engine was selected:
Arithmetic and Equality
Arithmetic Support
Enable with enable_arithmetic: true:
Built-in predicates: lt, gt, le, ge, plus, minus, times, divides, mod
Equality Reasoning
Enable with enable_equality: true:
Automatically injects reflexivity, symmetry, transitivity, and congruence axioms.
MCP Resources
Browse axiom libraries via the MCP resources protocol:
Resource URI | Description |
| Category theory axioms |
| Monoid structure |
| Group axioms |
| Peano arithmetic |
| ZFC set theory basics |
| Propositional tautologies |
| Aristotelian syllogism patterns |
| Available reasoning engines (JSON) |
MCP Prompts
Reasoning templates for common tasks:
Prompt | Description |
| Set up proof by contradiction |
| Check formula equivalence |
| Natural language to FOL translation guide |
| Diagnose unsatisfiable premises |
| Explain proven theorem |
Verbosity Control
All tools support a verbosity parameter:
Level | Description | Use Case |
| Just success/result | Token-efficient LLM chains |
| + message, bindings, engineUsed | Default balance |
| + Prolog program, statistics | Debugging |
Minimal response: { "success": true, "result": "proved" }
Formula Syntax
This server uses first-order logic (FOL) syntax compatible with Prover9:
Quantifiers
all x (...)— Universal quantification (∀x)exists x (...)— Existential quantification (∃x)
Connectives
->— Implication (→)<->— Biconditional (↔)&— Conjunction (∧)|— Disjunction (∨)-— Negation (¬)
Predicates and Terms
Predicates:
man(x),loves(x, y),greater(x, y)Constants:
socrates,a,bVariables:
x,y,z(lowercase, typically single letters)Functions:
f(x),successor(n)Equality:
x = y
Examples
Tool Usage Examples
1. Prove a Theorem (with Engine Selection)
2. Prove with SAT Engine (Non-Horn)
3. Find a Counterexample
4. Session-Based Reasoning
Project Structure
Technical Details
Engine Federation
The EngineManager automatically selects the best engine:
Formula Analysis — Clausifies input to determine structure
Horn Check — If all clauses are Horn, uses Prolog
SAT Fallback — Non-Horn formulas route to MiniSat
Explicit Override —
engineparameter forces specific engine
CNF Clausification
The clausifier transforms arbitrary FOL to CNF:
Eliminate biconditionals and implications
Push negations inward (NNF)
Standardize variable names
Skolemize existentials
Drop universal quantifiers
Distribute OR over AND
Extract clauses
DIMACS Export
For external SAT solver interop:
Structured Errors
All errors include machine-readable information:
API Reference
prove
check-well-formed
find-model / find-counterexample
Session Tools
Limitations
Inference Depth — Complex proofs may exceed limits
Model Size — Finder limited to domains ≤10 elements
SAT Variables — Arithmetic not supported in SAT engine
Higher-Order — Only first-order logic supported
Troubleshooting
"No proof found" for valid theorem
Increase
inference_limitfor complex proofsTry
engine: 'sat'for non-Horn formulasEnable
enable_equalityif using equality
Model finder returns "no_model"
Increase
max_domain_sizeCheck for contradictory premises
Session errors
Check session hasn't expired (default: 30 min)
Use
list-premisesto inspect state
Development
License
MIT
Contributing
Fork the repository
Create a feature branch
Run tests:
npm testSubmit a pull request