Prolog Reasoner MCP Server

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.

Local serverstdioPython

What is the Prolog Reasoner MCP server?

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. The prolog reasoner mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 1 defined tool rather than through you.

What it actually does

  • 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

Adding it to your client

prolog-reasoner on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Its toolset

Everything the assistant can do here goes through one of these:

  • Results — Measured on anthropic/claude-sonnet-4-6, single run over 30 problems:

Configuration

You will need 3 environment variables: LLM_API_KEY, SWIPL_PATH, PROLOG_REASONER_LLM_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • 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

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the prolog reasoner mcp server does with a few real requests.

When to reach for it

This sits in the AI and media services group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Prolog Reasoner's toolset — Results — is a fair guide to whether it matches your workflow. It is maintained by rikarazome; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
ResultsMeasured on anthropic/claude-sonnet-4-6, single run over 30 problems:

How to install the Prolog Reasoner MCP server

```json
{
  "mcpServers": {
    "prolog-reasoner": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "prolog-reasoner"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • 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
VariableDescriptionRequired
LLM_API_KEYCredential the server authenticates with.Yes
SWIPL_PATHFilesystem location the server is allowed to use.Optional
PROLOG_REASONER_LLM_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Prolog Reasoner to Results.

Frequently asked questions

It connects Prolog Reasoner to MCP-compatible AI assistants such as Claude and Cursor, exposing 1 tool (Results) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Prolog Reasoner directly.