Docker SWISH MCP Server
Manages a Docker SWISH container for Prolog integration, providing automatic start/stop and lifecycle management for the container.
Click on "Install 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., "@Docker SWISH MCP Servercreate a persistent notebook to solve a logic puzzle"
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.
Docker SWISH MCP Server š§ š³
šØ NEW: Enhanced Tools - Solving UX Issues šØ
If you thought the tools were broken - they're not! They just work differently than web SWISH.
šÆ The Problem You Experienced
# This seemed broken but wasn't:
?- process(photosynthesis).
# ERROR: Unknown procedure
# You expected web-SWISH behavior, but got Docker-SWISH architectureā The Solution: Enhanced Notebook Tools
# This actually works (and persists!):
create_notebook_with_background_cells()
# Result: Knowledge that persists across all queries! šQuick Demo:
cd /home/ty/Repositories/ai_workspace/docker-swish-mcp
python enhanced_tools/demo.pyRelated MCP server: Baby-SkyNet
š Essential Reading (Start Here!)
š QUICK_START_DEMO.md - See working examples immediately
š ENHANCED_USAGE_GUIDE.md - Complete guide to persistent notebooks
š ļø enhanced_tools/ - Enhanced MCP tools with notebook support
A Model Context Protocol (MCP) server that provides seamless Prolog integration for Claude. The server automatically manages a Docker SWISH container and focuses on enabling logic programming, reasoning, and knowledge base interaction.
š Key Features
š Enhanced Notebook System (NEW!)
Persistent State: Background cells maintain knowledge across queries (solves the "vanishing knowledge" problem)
Rich Interface: Markdown, HTML, Program, and Query cells for complete interactive experience
ASEKE Integration: Pre-built cognitive architecture notebooks with emotional states and knowledge gaps
Web Interface: Full SWISH web interface at
http://localhost:3050with enhanced notebooks
Automatic Container Management
Auto-Start: SWISH container starts automatically when MCP server initializes
Auto-Stop: Container stops gracefully when MCP server shuts down
Zero Configuration: No manual container management needed
Transparent Operation: Container lifecycle is completely handled behind the scenes
Prolog Integration
Enhanced Query Execution: Execute Prolog queries with persistent state via notebooks
Knowledge Base Management: Create persistent
.swinbnotebooks (not just.plfiles)Logic Programming: Full SWI-Prolog capabilities via SWISH interface with enhanced UX
Educational Support: Built-in tutorials and examples for learning Prolog
š Quick Start
Prerequisites
Docker installed and running
Python 3.10+
uvpackage manager
Installation
Navigate to the project:
cd /home/ty/Repositories/ai_workspace/docker-swish-mcpSet up Python environment:
uv venv --python 3.12 --seed source .venv/bin/activateInstall dependencies:
uv add -e .Add to Claude Desktop Configuration: Copy the contents of
example_mcp_config.jsonto your Claude Desktop config:# Linux/Mac nano ~/.config/claude-desktop/claude_desktop_config.jsonRestart Claude Desktop - The SWISH container will start automatically!
š Try Enhanced Tools (Recommended!):
python enhanced_tools/demo.py
š Enhanced Usage (Solves UX Issues!)
Problem: "Knowledge Keeps Vanishing!"
ā Old Way (Seemed Broken):
# This doesn't work in Docker-SWISH:
docker-swish:execute_prolog_query("assertz(fact(a)).") # ā
Success
docker-swish:execute_prolog_query("fact(X).") # ā Unknown procedure!?ā New Way (Actually Works):
from enhanced_tools.enhanced_swish_tools import EnhancedSWISHTools
tools = EnhancedSWISHTools()
# Create notebook with persistent background knowledge
result = tools.create_notebook(
name="my_lab",
background_knowledge=["fact(a).", "rule(X) :- fact(X)."],
initial_query="fact(X)."
)
# Access via web interface: http://localhost:3050/?code=/data/notebooks/my_lab.swinb
# Knowledge persists forever! šASEKE Cognitive Architecture Made Easy
# One command creates full cognitive architecture lab
tools.create_aseke_cognitive_notebook()
# Includes persistent:
# - Emotional states (Plutchik's emotions)
# - Knowledge gaps and curiosity loops
# - Meta-cognitive monitoring
# - Interactive exploration capabilitiesš Why the Original Tools Seemed "Broken"
Docker-SWISH vs Web-SWISH Architecture
Feature | Docker-SWISH (This System) | Web-SWISH (swish.swi-prolog.org) |
Execution Model | Pengine isolation per query | Session-based persistence |
State Management | Background cells for persistence | Direct session state |
File System | Container | Browser-based |
MCP Integration | ā Full integration | ā Not available |
Persistence | Notebook background cells | Session cookies |
The Architecture Difference
Docker-SWISH (this system):
Each MCP query creates isolated pengine
Knowledge doesn't persist between separate queries
Solution: Use notebook background cells for persistence
Web-SWISH (public server):
Browser session maintains state
Knowledge persists within browser session
Limited by public server constraints
š” Enhanced Tools Features
1. Persistent Notebooks (.swinb files)
Background Cells: Knowledge persists across all queries
Query Cells: Interactive exploration with persistent state
Markdown Cells: Rich documentation and tutorials
HTML Cells: Custom interactive interfaces with JavaScript
2. ASEKE Cognitive Architecture Support
Pre-built emotional state algorithms (Plutchik's emotions)
Knowledge gap detection and curiosity loops
Meta-cognitive monitoring capabilities
Interactive exploration of cognitive processes
3. Enhanced MCP Tools
# Create persistent knowledge laboratory
create_notebook(name, background_knowledge, initial_query)
# Add knowledge that persists
add_background_cell(notebook_name, knowledge)
# List all notebooks
list_notebooks()
# Create specialized ASEKE lab
create_aseke_cognitive_notebook()4. Web Interface Integration
Rich syntax highlighting and auto-completion
Interactive query execution with persistent results
Export capabilities (CSV, JSON, notebooks)
Collaborative sharing and version control
š§ Usage Workflows
Traditional Prolog Programming
# 1. Create program notebook
tools.create_notebook("family_tree",
background_knowledge=["parent(tom, bob).", "parent(bob, ann)."])
# 2. Access web interface for interactive development
# 3. Add rules incrementally to background cells
# 4. Test with query cells that have persistent access to all knowledgeASEKE Cognitive Architecture Research
# 1. Create ASEKE lab
tools.create_aseke_cognitive_notebook()
# 2. Explore emotional states and knowledge gaps interactively
# 3. Add domain-specific knowledge to background cells
# 4. Test curiosity loops and meta-cognitive processes
# 5. Export insights and discoveriesEducational Tutorials
# 1. Create tutorial notebook with progressive examples
# 2. Students interact with query cells
# 3. Background cells provide consistent knowledge base
# 4. Rich markdown documentation guides learningš§ Available Tools
Enhanced MCP Tools (NEW!)
create_notebook(name, title, background_knowledge, initial_query)- Create persistent notebookadd_background_cell(notebook_name, knowledge)- Add persistent knowledgelist_notebooks()- Browse available notebookscreate_aseke_cognitive_notebook()- Specialized cognitive architecture lab
Original MCP Tools
execute_prolog_query(query)- Execute single Prolog queries (limited persistence)create_prolog_file(filename, content)- Create.plfiles (for basic scripts)list_prolog_files()- Browse.plfilesload_knowledge_base(filename)- Load.plfiles (session-limited)get_swish_status()- Check system status
Information Resources
swish://container/info- Container status informationswish://files/list- Available files listing
šÆ Solving Your Original Issues
ā "Notepad that doesn't vanish"
Solution: Notebook background cells provide persistent knowledge across all sessions
ā "Not awkward to use"
Solution: Rich web interface with familiar notebook paradigm (like Jupyter)
ā "Better instructions"
Solution: Enhanced documentation with clear Docker-SWISH vs Web-SWISH explanations
ā "Access and modify, run and re-run"
Solution: Full web interface with persistent editing and interactive execution
š Success Metrics
After using enhanced tools, you should experience:
ā Knowledge persists across query sessions
ā Intuitive notebook-based interface
ā Clear understanding of system behavior
ā Rich interactive development environment
ā Seamless integration with cognitive architectures
š ļø Development and Extension
File Structure
docker-swish-mcp/
āāā src/docker_swish_mcp/ # Original MCP server
āāā enhanced_tools/ # NEW: Enhanced tools
ā āāā enhanced_swish_tools.py # Core enhanced functionality
ā āāā demo.py # Working demonstration
āāā ENHANCED_USAGE_GUIDE.md # NEW: Complete usage guide
āāā QUICK_START_DEMO.md # NEW: Quick start examples
āāā README.md # This file (updated)Contributing
Enhanced tools use standard Python patterns
SWISH notebooks follow
.swinbJSON formatBackground cells use
"background": truepropertyWeb interface accessible at
http://localhost:3050
š License
MIT License - see LICENSE file for details.
š Troubleshooting
"Enhanced tools not working"
# Check container status
docker ps | grep swish
# Restart if needed
docker restart swish-mcp-auto
# Run demo
python enhanced_tools/demo.py"Can't access web interface"
Ensure port 3050 is available:
lsof -i :3050Check container logs:
docker logs swish-mcp-autoVerify container is running:
docker ps
"Notebooks not persisting"
Check
/data/notebooks/directory existsEnsure proper file permissions
Verify notebook file format (
.swinbJSON)
š Success Stories
Before Enhanced Tools:
"Tools seemed broken" ā
"Knowledge keeps vanishing" ā
"Awkward to use" ā
"No persistence" ā
After Enhanced Tools:
"Everything works intuitively!" ā
"Knowledge persists perfectly" ā
"Rich notebook interface" ā
"Great for cognitive architecture research" ā
Ready to start? Run the demo and see the enhanced tools in action! š
python enhanced_tools/demo.pyThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA Model Context Protocol server that enables Claude to manage software development projects with complete context awareness and code execution through Docker environments.Last updated184
- Flicense-qualityDmaintenanceProvides Claude AI with persistent, searchable memory management across sessions using SQL database, semantic analysis with multi-provider LLM support (Anthropic/Ollama), vector search via ChromaDB, and graph-based knowledge relationships through Neo4j integration.Last updated1
- AlicenseBqualityAmaintenanceProvides a persistent "second brain" for Claude featuring zero-latency hot caching, semantic cold storage, and automatic pattern mining from activity logs. It enables users to store, search, and automatically extract project facts and code patterns for enhanced contextual recall.Last updated567MIT
- Alicense-qualityCmaintenanceEnables LLMs to define Prolog facts and rules and execute queries via SWI-Prolog for logical reasoning.Last updated4MIT
Related MCP Connectors
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/angrysky56/docker-swish-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server