Labsco
MCP SERVER

Prolog Reasoner

by rikarazome

Run real SWI-Prolog queries — CLP(FD) constraints, negation-as-failure, optional trace — and keep the rule bases around for the next question.

Physical Sciences & Scientific ComputingVerified
Summary
Constraint and rule questions get an answer that was derived, not generated.

The model writes the facts and rules; the solver decides what follows from them, which is the part language models are worst at and Prolog is built for. The rule-base store is what makes it more than a scratchpad — encode a domain once, then ask questions against it for as long as it holds. trace is there when the answer is surprising and you need to see the derivation rather than take it.

What it is

A Prolog execution server with a named, reusable rule-base store behind it

What you get
  • Execution of Prolog facts and rules against a query, with max_results capping the answers and trace exposing how they were derived (execute_prolog).
  • CLP(FD) constraints, negation-as-failure and standard SWI-Prolog features, rather than a reduced subset.
  • Named rule bases saved once and reused across execute_prolog calls, so stable knowledge such as chess piece_moves rules does not travel in every prompt (save_rule_base, get_rule_base).
  • A listing of saved rule bases with the description and tags read from each file's leading comments, sorted by name (list_rule_bases), and removal by name (delete_rule_base).
Requirements

No account and no key. You supply the Prolog code and the query; saved rule bases live with the server and are addressed by name.

Setup effort

One command — pip install prolog-reasoner