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.

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

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
prolog_codeProlog facts and rules (string)
queryProlog query to run, e.g. "mortal(X)" (string)
rule_basesoptional 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_resultscap the number of solutions returned (default 100)
tracewhen 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), highe

How to install the Prolog Reasoner MCP Server

{
  "mcpServers": {
    "prolog-reasoner": {
      "command": "uvx",
      "args": [
        "prolog-reasoner"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

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

Example prompts to try

  • “Use Prolog Reasoner to Results.”

Frequently asked questions

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. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.