rikarazome/prolog-reasoner
by Various
SWI-Prolog as a logic calculator for LLMs — MCP server and Python library
MCP
rikarazome/prolog-reasoner
Added 1 June 2026
Overview
A tool that provides an MCP server and Python library to use SWI-Prolog as a logic calculator for large language models. It enables LLMs to perform logical reasoning by invoking Prolog queries through a standardized interface.
Best for
Best for
Developers building LLM agents that need reliable, rule-based logical inference
Use cases
- Running rule-based inference tasks within an LLM workflow
- Validating logical constraints generated by an LLM
- Combining natural language output with Prolog's deterministic deduction
How to use
Install
pip install prolog-reasoner Tools exposed
prolog_coderule_basesmax_resultsLLM_PROVIDERLLM_API_KEYLLM_MODELLLM_TEMPERATURELLM_TIMEOUT_SECONDSSWIPL_PATHEXECUTION_TIMEOUT_SECONDSRULES_DIRBUNDLED_RULES_DIRMAX_RULE_SIZEMAX_RULE_PROMPT_BYTESLOG_LEVELLLM-onlymulti-step
Tested with
Claude Desktop, Claude Code, ChatGPT
Notes
A tool that provides an MCP server and Python library to use SWI-Prolog as a logic calculator for large language models. It enables LLMs to perform logical reasoning by invoking Prolog queries through a standardized interface.
8 stars on GitHub. Last updated 2026-05-01. Licensed MIT.
Use cases
- Running rule-based inference tasks within an LLM workflow
- Validating logical constraints generated by an LLM
- Combining natural language output with Prolog’s deterministic deduction
Pros
- Leverages Prolog’s mature reasoning engine for consistent logical output
- Exposes logic calculus as an MCP server, compatible with LLM tool-use patterns
- Simple Python library for embedding Prolog query execution
Cons
- Small community and limited production usage (8 GitHub stars)
- Requires familiarity with Prolog syntax and logic programming
- Narrow focus only useful if LLM task needs formal deductive reasoning
Indexed from awesome-mcp-servers-punkpeye and enriched against its public facts.
Pros
- Leverages Prolog's mature reasoning engine for consistent logical output
- Exposes logic calculus as an MCP server, compatible with LLM tool-use patterns
- Simple Python library for embedding Prolog query execution
Cons
- Small community and limited production usage (8 GitHub stars)
- Requires familiarity with Prolog syntax and logic programming
- Narrow focus only useful if LLM task needs formal deductive reasoning
Pairs with
Other entries in the index that connect to this one. Click through to see the chain.
Get the free Developer’s Field Guide
A 27-page field guide to the AI coding workflow with Claude. Claude Code, MCP servers, the prompt patterns that work, and what to delegate. Free.
Enter your work email. We send it straight over, plus a few short notes worth knowing. Unsubscribe any time.