prolog-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@prolog-mcpLoad a family tree and find all ancestors of Alice"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Prolog-MCP Server
A neurosymbolic AI server combining Prolog’s symbolic reasoning with Model Context Protocol (MCP) for hybrid AI applications.
Features:
Persistent Prolog session: maintain state between tool calls
Session management: save/load knowledge bases to disk
Four core tools:
loadProgram: Load Prolog predicates/rulesrunPrologQuery: Execute complex logical queriessaveSession: Persist session stateloadSession: Restore previous sessions
Type safety via Zod schema validation for all I/O
WebAssembly runtime: Trealla Prolog in WASI environment
Integration with Cline/Roo/Copilot:
{
"mcpServers": {
"prolog-mcp": {
"command": "node",
"args": [
"prolog-mcp/dist/index.js"
],
"disabled": false,
"alwaysAllow": [
"loadProgram",
"runPrologQuery",
"saveSession",
"loadSession"
],
"timeout": 15
}
}
}Development:
git clone https://github.com/adamrybinski/prolog-mcp
cd prolog-mcp
npm install
npm run buildPerformance:
Operation | Avg. Latency | Memory Usage |
Query Execution | 12ms | 18MB |
Session Save | 45ms | 22MB |
Program Load | 8ms | 15MB |
Acknowledgements:
Built with Trealla Prolog and MCP Protocol
Available Tools
4 toolsloadProgramA
Loads Prolog program definitions that can be queried later
| Name | Required | Description | Default |
|---|---|---|---|
| program | Yes | The Prolog program definitions to load |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of disclosing behavior. It does not mention whether loading a new program replaces existing definitions, how it handles invalid Prolog, or how it interacts with session state (given the saveSession/loadSession siblings). This is a significant gap for a state-changing operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, front-loaded with the verb 'Loads', and contains no redundant or filler words. Every word contributes to the core meaning, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description adequately conveys the primary purpose. However, it omits critical behavioral context, such as the effect of repeated loads on existing program definitions and the relationship to session persistence, which an agent would need to use the tool reliably in a multi-step workflow.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description for the 'program' parameter is complete (100% coverage) and already states 'The Prolog program definitions to load'. The tool description merely echoes this without adding syntax, format, or additional usage details, so it provides no extra semantic value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Loads' and identifies the resource as 'Prolog program definitions', clarifying that these definitions are intended for later queries. This clearly distinguishes the tool from siblings like runPrologQuery (which executes queries) and session management tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'can be queried later' implies that this tool should be used before running queries, and thus before runPrologQuery. However, it does not explicitly state when to use this tool versus alternatives or mention any exclusions, leaving the usage context only implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
loadSessionB
Loads a previously saved Prolog session
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The name of the session to load |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must carry the full burden of behavioral disclosure. It only states the core loading action, with no mention of side effects (e.g., overwriting the current session), required permissions, or failure behavior. This leaves significant ambiguity for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that immediately conveys the tool's purpose. No waste or extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter load tool with no annotations or output schema, the description covers the core action but omits behavioral details like return values or whether loading replaces the current session. It is minimally adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema fully documents the single 'filename' parameter with a description, so schema coverage is 100%. The tool description adds no extra meaning beyond what the schema already provides; baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'loads' and resource 'previously saved Prolog session', clearly distinguishing from sibling tools like loadProgram (program code) and saveSession (saving). It states exactly what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like loadProgram or saveSession. It only states the action, with no context for selection or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
runPrologQueryA
Executes a Trealla Prolog query against loaded definitions
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The Prolog query to execute |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states the core action and prerequisite (loaded definitions) but does not disclose whether the query can have side effects, what the return format is, or how errors are handled. For a query execution tool, this is a significant transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no filler words. It immediately states the action and prerequisite, earning a top score for conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and no annotations, the description should explain what the tool returns or behaves. It only says 'executes a query' without specifying results, side effects, or error conditions. For a simple tool this might seem adequate, but the lack of any behavioral or return information makes it incomplete for an agent trying to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the single 'query' parameter, which already explains it as 'The Prolog query to execute.' The tool description adds no additional parameter meaning beyond the schema, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: 'Executes a Trealla Prolog query against loaded definitions.' It uses a specific verb ('executes') and resource ('Prolog query against loaded definitions'), which distinguishes it from sibling tools like loadProgram, saveSession, and loadSession, which deal with loading/saving rather than executing queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool: after definitions have been loaded. 'Against loaded definitions' gives clear context that the query depends on a prior loadProgram call. However, it does not explicitly mention when not to use it or discuss alternatives, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
saveSessionA
Saves the current Prolog session to a file for later loading
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The name to save the session under |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for behavioral disclosure. It only states the basic save action without mentioning potential side effects such as overwriting existing files, required permissions, or the file format used. This is a notable gap for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no redundant wording. Every word contributes directly to understanding the tool's function, making it concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple functionality and single parameter, the description is minimally adequate. However, the absence of annotations and output schema means the description should have provided more behavioral context, such as return behavior or file-handling details, to be fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides a clear description for the only parameter (filename: 'The name to save the session under'), giving 100% schema coverage. The tool description itself adds no further semantic detail beyond what the schema already conveys, matching the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Saves' and clearly states the resource ('current Prolog session') and the outcome ('to a file for later loading'). It distinguishes from the sibling loadSession by its save semantics, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for persisting a session for later loading, but it does not explicitly state when to prefer this tool over alternatives or list any exclusions. The phrase 'for later loading' hints at pairing with loadSession but provides no explicit comparison.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
loadProgram - First observed
loadSession - First observed
runPrologQuery - First observed
saveSession
TDQS
Scored across 4 tools
The tools are mostly distinct: loadProgram and loadSession both involve loading, but the former loads program definitions while the latter restores a full session. runPrologQuery and saveSession are clearly separate, and descriptions help disambiguate the two load operations.
All tool names follow a consistent camelCase verb_noun pattern: loadProgram, runPrologQuery, saveSession, loadSession. The repeated 'load' verb is coherent for different loading operations.
Four tools is a well-scoped, compact set for a Prolog server, covering the essential actions without redundancy or bloat.
The core workflow is fully supported: load programs, run queries, and persist/restore sessions. Minor gaps like session reset or program listing are absent, but they are not critical for the primary use case.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for building and testing AI agents with multi-model experimentation and insights.
Hybrid human + AI expertise for faster, trusted answers and decisions via MCP Server.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables Large Language Models to interactively create, edit, and solve constraint models using backends like MiniZinc, Z3, PySAT, and Clingo. It bridges natural language with symbolic reasoning for solving complex logical, SAT, SMT, and optimization problems.MIT
- AlicenseAqualityDmaintenanceMCP server that gives small LLMs verified symbolic-math & logic tools.61Apache 2.0
- AlicenseNot gradedqualityAmaintenanceMCP server that gives LLMs access to formal verification via Z3 and SWI-Prolog, plus tree-sitter-based source code analysis. Translates natural language problems into formal logic using a template-based pipeline, verifies results with mathematical certainty, and analyzes call graphs for reachability, dead code, and impact analysis.100 npm212Apache 2.0
- AlicenseBqualityAmaintenanceMCP server for logical reasoning that turns facts into formal proofs using a deterministic inference engine with Prolog.86Apache 2.0