Euclid-MCP: A Model Context Protocol Server for Deterministic Logical Reasoning via Prolog
Abstract
Large Language Models (LLMs) excel at natural language understanding and generation but remain unreliable for multi-step logical reasoning, especially in safety-critical or compliance-sensitive domains. Recent neuro-symbolic approaches address this gap by coupling neural models with external symbolic engines, yet most integrations are bespoke and lack a standardized interface for tool-augmented agents. This paper presents Euclid-MCP, an open-source MCP server that provides deterministic logical reasoning via SWI-Prolog. Euclid-MCP introduces Euclid-IR, an engine-agnostic intermediate representation for Horn-clause logic that is human-readable, easy for LLMs to generate, and straightforward to compile into Prolog or alternative backends. The server exposes a compact tool interface that supports a translate-run-inspect-repair loop, enabling LLM clients to delegate inference while retaining full access to proof traces and derivation logs. We evaluate Euclid-MCP on a realistic IT security and compliance use case. Results show that while LLMs alone are sufficient on small knowledge bases, they hallucinate systematically on larger problems, whereas Euclid-MCP delivers exact answers with lower latency and more compact outputs. We argue that semantic RAG is fundamentally unsuited for rule enforcement, and that Euclid-MCP can serve as a stable, shared reasoning substrate for both RAG-based assistants and agentic systems.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL, cs.SE
Related papers
Reason Popper-ly: Patching In-Context Reasoning with Inductive Logic Programming
Shared title terminologycs.AIZirong Chen, Meiyi Ma
Certify What You Plant: Shortcut-Free Proof Depth in Logical Reasoning Data
Shared title terminologycs.AIBaptiste Juran, Dimitri Kachler, Damien Sileo
SymStep: Symbolic Step Verification for Logical Reasoning
Shared title terminologycs.AIAida Usmanova, Rui Gao, Dilshod Azizov et al.
Semiotic logical hexagon theory for LLM logical reasoning
Shared title terminologycs.AIYunyao Zhang, Xinglang Zhang, Zeliang Chen et al.
Integrating Reasoning Systems for Trustworthy AI, Proceedings of the 4th Workshop on Logic and Practice of Programming (LPOP)
Shared title terminologycs.AIAnil Nerode, Yanhong A. Liu
Differentiable Logic Programming to Mitigate Reasoning Shortcuts in Neurosymbolic Systems
Shared title terminologycs.AIAkihiro Takemura, Katsumi Inoue