Skip to main content
MCP server CX Codex

Prolog Reasoner — Claude Code MCP server: what it does, how to install

Connects an SWI-Prolog solver to your coding assistant. Handles combinatorial search, constraint satisfaction, and multi-step inference.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add prolog-reasoner -- uvx prolog-reasoner
Open on GitHub

What Prolog Reasoner does

Language models regularly struggle with deterministic deduction and state searches. This server provides an external engine for those calculations. The model writes the facts, while the underlying Prolog runtime verifies constraints and computes exact answers.

The tool exposes execute_prolog alongside four functions for rule base management: save_rule_base, list_rule_bases, get_rule_base, and delete_rule_base. You can store fixed system rules under names between 1 and 64 characters to avoid pasting them repeatedly. It supports CLP(FD) constraint solving, negation-as-failure, and an optional execution proof trace.

Without SWI-Prolog 9.0 or newer on your system PATH, queries will fail to execute. The package also demands Python 3.10 or higher. Running the MCP server needs no API keys, as queries run locally on your machine.

What it helps with

  • solve constraint satisfaction problems with CLP(FD)
  • run multi-step deterministic deduction without logic hallucinations
  • store reusable domain axioms across multiple agent calls
  • inspect execution traces to debug reasoning paths

Example prompts for the agent

  • Check if the schedule satisfies all constraints using SWI-Prolog.
  • Store these piece movement rules under the name chess_moves.
  • Run execute_prolog with query mortal(X) against the socrates rule base.

How to install Prolog Reasoner

Platform CLI

claude mcp add prolog-reasoner -- uvx prolog-reasoner

uvx runs the command named after the package; if the README names another one, use uvx --from prolog-reasoner <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Prolog Reasoner

How do I install Prolog Reasoner in Claude Code?

Run claude mcp add prolog-reasoner -- uvx prolog-reasoner. The tool will automatically register with your environment.

What does Prolog Reasoner do?

It provides an interface for LLMs to run SWI-Prolog code, evaluate logic queries, and parse output structures. It also lets you persist modular rule sets locally.

Does the MCP server require an OpenAI or Anthropic API key?

No, the server operates locally without LLM credentials. API tokens are only necessary if you run the standalone Python translation library.

Similar MCP servers

All MCP servers for AI and ML →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor