prolog-mcp
[](https://mseep.ai/app/adamrybinski-prolog-mcp)
# 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/rules
- `runPrologQuery`: Execute complex logical queries
- `saveSession`: Persist session state
- `loadSession`: 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 build
```
**Performance:**
| Operation | Avg. Latency | Memory Usage |
|------------------|--------------|-------------|
| Query Execution | 12ms | 18MB |
| Session Save | 45ms | 22MB |
| Program Load | 8ms | 15MB |
---
**Acknowledgements:**
Built with [Trealla Prolog](https://github.com/trealla-prolog/trealla) and [MCP Protocol](https://mcp.dev)
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.