New: Connect AI Assistants Directly to SWI-Prolog

Hi everyone!

I’ve built swipl-mcp-server- a bridge that lets AI assistants like Claude Desktop work directly with SWI-Prolog in a secure sandbox environment.

Cool Demo: Claude Solves 4-Queens Independently! Check this out - I gave Claude access to the server and it **independently** explored SWI-Prolog and solved the 4-queens problem without any help! The full session screenshots are in the README - it’s pretty amazing to watch AI reasoning through Prolog step by step.

This is perfect for AI-assisted Prolog learning, interactive theorem proving, and logic puzzle solving.

Links:

- [GitHub with demo screenshots]( GitHub - vpursuit/swipl-mcp-server: SWI-Prolog MCP Server: A Model Context Protocol server providing secure Prolog query execution with hybrid sandbox security model. )

- [npm package]( @vpursuit/swipl-mcp-server - npm )

Anyone else playing with AgenticAI + Prolog? Would love to hear what you’re building!

3 Likes

Interesting package! Would you say that this mcp server is mainly useful with Claude, or is it also useful for llms that I can self-host (Within 32Gb VRam)?
I’m not doing agenticAI and prolog together, but I was always curious how far could I go trying to get answers as clause-like representations and programs.

Thanks for your interest. That‘s a good question.

I‘m currently experimenting with OpenCode and the smaller gpt-oss provided locally by ollama.

With the right config (no npx, but installation at first) it was able to see the mcp server. Nevertheless it seemed to get into trouble after a while trying to solve the 4-queens problem. It ended up in a trial/error loop, partially hanging without doing something. This might be caused mostly by the OpenCode agent implementation (i guess). I run it on 64GB M3 Max.

But yes, it is not build for Claude. All MCP enabled agents should be capable of using it - depending on their training and tool calling capabilities.

Greetings

Hi,

this sounds (for me as a bloody newcomer in PROLOG) very interesting - but lot’s of the details are still greek for me. I just startet learning PROLOG with some books from Ivan Bratko, Büning Schmitgen and Wolfgang Ertel.

My idea is to assist a LLM by a PROLOG-Instance as a kind of stupid but reliable expert in terms of failure management. The expert should collect causes and effects, technical structures (trees), solutions and counter measures from lots of given failure analysis,
link everything together and give the craftsman and human experts hints to solve the issue when the next failure event appears. This is somehow ‘AgenticAI + Prolog’ right?

However, I am already having problems with the simple definition of a recursive rule. So I am still a long way from programming a PROLOG expert system - but I will have at least a prototyp running by mid of 2026.

Viele Grüße / Greetings