Logo vun SWI-Prolog

SWI-Prolog

Communautéit
vpursuit

SWI-Prolog MCP Server: A Model Context Protocol server providing secure Prolog query execution with hybrid sandbox security model.

Editeurvpursuit
Repositorymodel-context-lab
SproochTypeScript
Forks
4
Stären
9
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzBSD-3-Clause
Linken
  • Tools mat KI-Workflows verbannen

    SWI-Prolog stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    9 Stären an 4 Forks aus dem verlinkte Repository.

MCP Ecosystem by vpursuit

Build Status

This monorepo contains Model Context Protocol (MCP) packages and products that enable AI assistants to work with SWI-Prolog, filesystems, and extensible plugin systems.

Products

SWI-Prolog MCP Server

Full-featured MCP server with Prolog knowledge base integration

A MCP server that lets tools-enabled LLMs work directly with SWI‑Prolog. It supports loading Prolog files, adding/removing facts and rules, listing symbols, and running queries with two modes: deterministic pagination and true engine backtracking.

Features:

  • Knowledge base management (load, assert, retract, dump)
  • Two query modes: standard (call_nth/2) and engine (true backtracking)
  • Expert Prolog assistance prompts (e.g. solving logic puzzles)
  • Comprehensive security sandboxing
  • Dynamic filesystem roots
  • Plugin-based architecture

Architecture

This repository follows a products/plugins architecture:

  • Products (products/): Published packages that end-users install (e.g., @vpursuit/swipl-mcp-server)
  • Plugins (plugins/): Internal, reusable components bundled within products (not published separately)

Internal Plugin System

The MCP server is built with a modular plugin architecture. These plugins are internal dependencies bundled into the main product:

PluginDescriptionLocation
@vpursuit/mcp-server-corePlugin system foundationplugins/server/core
@vpursuit/mcp-server-prologSWI-Prolog integrationplugins/server/prolog
@vpursuit/mcp-server-rootsFilesystem roots discoveryplugins/server/roots

Note: These plugins are marked as private in their package.json and are bundled into @vpursuit/swipl-mcp-server. They are not published separately to npm.

Plugin System for Developers

If you're developing within this monorepo, you can use the plugin system directly:

typescript
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { loadPlugins } from '@vpursuit/mcp-server-core';
import { plugin as prologPlugin } from '@vpursuit/mcp-server-prolog';
import { plugin as rootsPlugin } from '@vpursuit/mcp-server-roots';

const server = new McpServer({
  name: 'my-mcp-server',
  version: '1.0.0',
});

// Load plugins
await loadPlugins(server, [prologPlugin, rootsPlugin]);

📂 Repository Structure

This is a monorepo managed with npm workspaces. Each package can be developed, tested, and published independently.

model-context-lab/
├── products/
│   └── swipl-mcp-server/    # Main MCP server (published to npm)
├── plugins/
│   └── server/
│       ├── core/            # Plugin system foundation (internal)
│       ├── prolog/          # SWI-Prolog integration (internal)
│       └── roots/           # Filesystem roots discovery (internal)
├── docs/                    # Monorepo-level documentation
├── .archive/                # Historical strategy documents
└── package.json             # Workspace configuration

Each package has:

  • Own package.json with independent versioning
  • Own README.md with complete documentation
  • Own LICENSE (BSD-3-Clause)
  • Own test suite

🔧 Development

Prerequisites

  • Node.js ≥ 20.0.0
  • SWI-Prolog (for testing Prolog integration)
  • npm ≥ 9.0.0

Setup

bash
# Clone repository
git clone https://github.com/vpursuit/model-context-lab.git
cd model-context-lab

# Install all dependencies
npm install

# Build all packages
npm run build

# Run all tests
npm test

Working with Packages

bash
# Build specific package
npm run build -w plugins/server/core

# Test specific package
npm test -w plugins/server/prolog

# Clean all build artifacts
npm run clean

Package Development

Each package supports:

  • npm run build - TypeScript compilation
  • npm run clean - Remove build artifacts
  • npm test - Run Vitest tests
  • npm run test:watch - Watch mode for tests

Documentation

Product Documentation (swipl-mcp-server)

Monorepo Documentation

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Code of conduct
  • Development workflow
  • Testing requirements
  • Pull request process
  • Coding standards

For security issues, see SECURITY.md.

Publishing

Only products are published to npm under the @vpursuit scope:

  • Products (e.g., @vpursuit/swipl-mcp-server) are published to npm for end users
  • Plugins are internal dependencies bundled within products (not published separately)
  • Releases use semantic versioning: v<version> (e.g., v3.0.0)
  • Automated publishing via GitHub Actions
  • Supply chain security: All packages published with npm provenance attestation
  • See PUBLISHING.md for complete details

Security

All packages implement security best practices:

  • File path restrictions
  • Dangerous predicate blocking
  • Pre-execution validation
  • Timeout protection
  • Module isolation

Supply Chain Security:

  • Published with npm provenance attestation for build transparency
  • OIDC-based publishing (no long-lived tokens)
  • Cryptographically signed packages via Sigstore

See SECURITY.md for complete security documentation and reporting.

📄 License

All packages in this monorepo are licensed under BSD-3-Clause.

See LICENSE file for details.

🔗 Links

Getting Started

For end users: Install the complete MCP server

bash
npx @vpursuit/swipl-mcp-server

For monorepo developers: Work with the plugin system

bash
git clone https://github.com/vpursuit/model-context-lab.git
cd model-context-lab
npm install
npm run build

For contributors: Set up the development environment

bash
git clone https://github.com/vpursuit/model-context-lab.git
cd model-context-lab
npm install
npm run build
npm test

Questions? Open an issue or see our documentation.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "swipl": {
      "command": "npx",
      "args": [
        "@vpursuit/swipl-mcp-server"
      ]
    }
  }
}

SWI-Prolog MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal SWI-Prolog verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

SWI-Prolog als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu SWI-Prolog an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "swi-prolog": {
      "command": "npx",
      "args": [
        "-y",
        "@vpursuit/swipl-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu SWI-Prolog. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu SWI-Prolog.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat SWI-Prolog?
SWI-Prolog
Jo. Ech hunn et gelies.
Dat hunn ech mat SWI-Prolog fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server SWI-Prolog benotzt?

SWI-Prolog ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech SWI-Prolog MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir SWI-Prolog mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat SWI-Prolog MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann SWI-Prolog verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech SWI-Prolog MCP mat TypingMind?

SWI-Prolog leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt SWI-Prolog MCP an TypingMind zur Verfügung?

SWI-Prolog stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir SWI-Prolog MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann SWI-Prolog eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇