ZPM — Zig Prolog MCP Server

Expose a Prolog knowledge base to AI agents via the Model Context Protocol.

Get Started GitHub

What is ZPM?

ZPM is a Model Context Protocol server written in Zig that embeds a Trealla Prolog engine. It lets AI agents store facts, define rules, and run logical queries — bringing deterministic Prolog reasoning into MCP-compatible workflows.

Install

curl -fsSL https://raw.githubusercontent.com/awf-project/zpm/main/scripts/install.sh | sh

Or build from source:

git clone https://github.com/awf-project/zpm.git
cd zpm
make build

Quick Start

Add ZPM to your MCP client configuration:

{
  "mcpServers": {
    "zpm": {
      "command": "zpm",
      "args": ["serve"]
    }
  }
}

Then assert facts and run queries through your AI agent:

% Store a fact
depends_on(zpm, trealla_prolog).

% Query relationships
?- depends_on(zpm, X).

Prolog Reasoning Engine

Expose a full Scryer Prolog inference engine to AI agents via the Model Context Protocol, enabling deterministic logical reasoning.

MCP Tool Interface

Assert facts, define rules, and run queries through standard MCP tools — no Prolog client library required.

Knowledge Persistence

Save and restore knowledge base snapshots across sessions, with write-ahead logging for durability.

Built with Zig

Zero-dependency binary with minimal memory footprint, fast startup, and a clean C-ABI bridge to Scryer Prolog.