Runs SWI-Prolog queries over MCP with constraints, recursion, negation, and reusable rule bases.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
This server is confirmed live โ we successfully called its tools/list endpoint directly (see the verified badge above). We haven't yet sandbox-tested the stdio install command below specifically, which is a separate, ongoing check.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Prolog Reasoner.
execute_prologExecute Prolog code and return reasoning results. Write Prolog facts and rules, then run a query against them. Supports CLP(FD) constraints, negation-as-failure, and all standard SWI-Prolog features.
list_rule_basesList all saved rule bases with description and tags. Returns ``{"rule_bases": [{"name": str, "description": str, "tags": list[str]}, ...]}`` sorted by name. Metadata is extracted from the leading ``% description:`` / ``% tags:`` comments of each rule base file (see ยง4.10).
get_rule_baseRetrieve the Prolog source of a saved rule base.
save_rule_baseSave a named rule base containing Prolog rules that can be reused across ``execute_prolog`` calls. Use this for stable, reusable knowledge (e.g. ``piece_moves`` for chess piece movement rules). For one-time facts, include them directly in ``prolog_code`` instead.
delete_rule_baseDelete a saved rule base by name.
The rikarazome/prolog-reasoner MCP server lets an MCP client submit SWI-Prolog facts and rules together with a query. The main execution tool returns the resulting solutions, whether execution succeeded, and metadata such as elapsed time, result count, truncation status, and the rule bases used. Prolog source remains visible as the intermediate representation, so an agent or developer can inspect and revise the logic before running it again.
The server also provides named rule bases for reusable knowledge. A rule base can hold stable domain rules, while each execution call supplies only the situation-specific facts. Rule bases can be listed, read, saved, overwritten, or deleted. Leading comments containing description and tag metadata are used when listing them.
An execute_prolog call accepts prolog_code and query, with optional rule-base names, a maximum result count, and proof tracing. Selected rule bases are loaded before the supplied code. The query runs through SWI-Prolog, including support for constraint logic programming over finite domains, negation-as-failure, recursion, and other standard SWI-Prolog behavior.
Results are returned as JSON-like data with output and query fields. Successful calls include execution metadata. Failed calls include an error category and a natural-language explanation; documented categories include syntax, undefined predicate, unbound variable, type, domain, evaluation, permission, timeout, and trace-related errors. Proof tracing is optional and adds a structured proof tree, but it does not support CLP(FD), higher-order predicates, or assert/retract.
Install the Python package with pip install prolog-reasoner, and make sure SWI-Prolog 9.0 or newer is installed and available on the system PATH. The MCP server itself does not require an OpenAI or Anthropic API key. Those providers apply to the separate library-mode natural-language-to-Prolog pipeline.
Claude Desktop can launch the server through uvx with the prolog-reasoner package, or through the installed prolog-reasoner executable. Docker is also documented as an option that bundles SWI-Prolog. The server requires Python 3.10 or newer when installed as the Python package.
Rule files are stored under ~/.prolog-reasoner/rules/ by default. The directory can be changed with PROLOG_REASONER_RULES_DIR; bundled rule content can be supplied through BUNDLED_RULES_DIR. Rule-base names may contain lowercase letters, numbers, underscores, and hyphens, and must be between one and 64 characters.
The rikarazome/prolog-reasoner MCP server exposes these tools:
execute_prolog: Run supplied Prolog code and a query, optionally loading named rule bases and limiting returned solutions.list_rule_bases: List saved rule bases alphabetically with descriptions and tags.get_rule_base: Retrieve the raw source for a named rule base.save_rule_base: Validate and store a named rule base for later calls.delete_rule_base: Remove a saved rule base.Saved content is parse-validated before writing, and oversized rule bases are rejected. The separate Python library also includes direct Prolog execution and an LLM-dependent translation pipeline, but those library features are not required for MCP use.
The rikarazome/prolog-reasoner MCP server executes Prolog supplied by the connected client; it does not translate natural language or call an external LLM as part of the MCP server. The client must formulate the facts, rules, and query. Returned solutions are capped at 100 by default and may be truncated when more results exist. Proof tracing has feature restrictions and performance overhead. The server also depends on a local SWI-Prolog installation unless run through the documented Docker setup.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/rikarazome-prolog-reasoner)<a href="https://allmcps.com/mcp/rikarazome-prolog-reasoner"><img src="https://allmcps.com/api/badge/rikarazome-prolog-reasoner?style=directory" alt="Prolog Reasoner on AllMCPs" /></a>