Enterprise DNA
M MCP Servers Developer low

rikarazome/prolog-reasoner

by Various

SWI-Prolog as a logic calculator for LLMs — MCP server and Python library

R

MCP

rikarazome/prolog-reasoner

Added 1 June 2026

#anthropic #claude #llm #logic-programming #mcp #mcp-server #prolog #python

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_code
  • rule_bases
  • max_results
  • LLM_PROVIDER
  • LLM_API_KEY
  • LLM_MODEL
  • LLM_TEMPERATURE
  • LLM_TIMEOUT_SECONDS
  • SWIPL_PATH
  • EXECUTION_TIMEOUT_SECONDS
  • RULES_DIR
  • BUNDLED_RULES_DIR
  • MAX_RULE_SIZE
  • MAX_RULE_PROMPT_BYTES
  • LOG_LEVEL
  • LLM-only
  • multi-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.

Free 27-page guide

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.

No spam. Unsubscribe any time.

Running a business, not writing the code? See the MCP servers picked for operators, and get your first one wired up with us.

Operator picks