SkillTide Submit
Official description7 sourcesMCP servers8d ago
rikarazome/prolog-reasoner

rikarazome/prolog-reasoner

SWI-Prolog as a logic calculator for LLMs — MCP server and Python library
View on GitHub ↗Direct link · no redirect page
Config template (adjust for your client)
claude mcp add prolog-reasoner -- npx -y prolog-reasoner
A pasteable skeleton generated from the repository name. Check the project README for the exact package and arguments.
Star count
12 ★ · rikarazome/prolog-reasoner · read from the repository page · (checked 2026-10-16 20:00:20)
Source
collected from the punkpeye/awesome-mcp-servers list · type: MCP server
Harvest history
first seen 2026-10-09 · last seen 2026-10-16 · seen 32× · listed by 7 sources
Score
score 703 · 12 ★ · 7 sources · mcp
FAQ (answers come from our records)
How do I install it?
We did not find an install command for this repository (our install coverage is only about 4%). Check its README or releases page.
Who is it for?
We filed it under these tags: MCP 服务. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository rikarazome/prolog-reasoner;first catalogued 2026-10-09;last seen 2026-10-16。There is no official certification or quality rating here — we record sources and dates only.
Third-party quality signals

prolog-reasoner

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

SWI-Prolog as a "logic calculator" for LLMs — available as an MCP server and a Python library. Eliminate the black box from LLM logical reasoning.
LLMs excel at natural language but struggle with formal logic. Prolog excels at logical reasoning but can't process natural language. **prolog-reasoner** bridges this gap by exposing SWI-Prolog execution to LLMs.
Does it help?
On the built-in 30-problem logic benchmark:
| Pipeline | Accuracy |
|----------|----------|
| LLM-only (claude-sonnet-4-6) | 22/30 (73.3%) |
| **LLM + prolog-reasoner** | **27/30 (90.0%)** |
The gap concentrates in constraint satisfaction and multi-step reasoning — the combinatorial territory LLMs are weak on and Prolog is strong on. Full breakdown below.
Why it works
LLMs pattern-match; Prolog actually searches and solves. When the LLM writes its problem down as Prolog, two things happen at once:
- Prolog handles the combinatorial work LLMs are weak on — constraint satisfaction, multi-step inference, exhaustive search.
- The reasoning exists as code you can read, re-run, and debug. When it goes wrong, you see the exact Prolog that failed and why.
Two ways to use it
- **MCP server** — Claude (or any MCP client) calls it as a logic solver during conversation. **Rule bases** let the LLM save stable domain rules once and reference them by name per call.
- **Python library** — full NL→Prolog pipeline with self-correction. Requires OpenAI or Anthropic.
Features
- **MCP tools**: execute_prolog for arbitrary SWI-Prolog execution, plus list_rule_bases / get_rule_base / save_rule_base / delete_rule_base for reusable named rule bases (v14)
- **Rule bases**: save stable Prolog rules once (e.g. chess move rules, legal axioms) and reference them by name from execute_prolog so the LLM only writes the situation-specific facts per call
- **Transparent intermediate representation**: the Prolog code is the audit trail — inspect, modify, or verify before execution
- **CLP(FD) support**: constraint logic programming for scheduling and optimization
- **Negation-as-failure, recursion, all standard SWI-Prolog features**
- **Library mode**: NL→Prolog translation with self-correction loop (OpenAI / Anthropic)
Requirements
- Python ≥ 3.10
- SWI-Prolog installed and on PATH (≥ 9.0)
- API key for OpenAI or Anthropic — **only for library mode**, not for the MCP server
Installation
MCP Server Setup
The MCP server exposes five tools — execute_prolog runs Prolog code written by the connected LLM, and four rule-base tools manage named, reusable Prolog modules. It does **not** call any external LLM API, so no API key is required.
Claude Desktop / Claude Code
Or, if prolog-reasoner is installed directly:
Docker (SWI-Prolog bundled)
Use Docker if you don't want to install SWI-Prolog locally:
Tool reference
**execute_prolog(prolog_code, query, rule_bases=None, max_results=100, trace=False)**
- prolog_code — Prolog facts and rules (string)
- query — Prolog query to run, e.g. "mortal(X)" (string)
- rule_bases — optional list of saved rule base names to prepend to prolog_code (in order). Use this to reuse stable domain rules across calls without re-sending them
- max_results — cap the number of solutions returned (default 100)
- trace — when True, attach a structured proof tree per solution to metadata.proof_trace. Opt-in sub-feature; has performance overhead and does not support CLP(FD), higher-order predicates, or assert/retract.
Returns a JSON object with success, output, query, error, and metadata.
On success, metadata includes execution_time_ms, result_count, truncated, and rule_bases_used. When rule bases were requested, rule_base_load_ms is also attached (disk I/O timing). On failure, metadata also includes error_category (one of syntax_error, undefined_predicate, unbound_variable, type_error, domain_error, evaluation_error, permission_error, timeout, trace_mechanism_error, unknown) and error_explanation — a natural-language hint for the connected LLM (or human) to decide how to fix the Prolog code.
Source
awesome · https://github.com/rikarazome/prolog-reasoner
Browse by field
MCP servers
Traction
12 ★
added
yesterday

More in MCP servers

All 5,525 in MCP servers →

Filed under

Every tag opens the full list for that filter. Counts are the live catalogue figures.

Browse all fields →

← Back to index