by shipitsteven
Logic-LM (Answer Set Programming) boosts language models with formal logical reasoning and multi-step deduction via Clin
Translates natural language problems into formal Answer Set Programming code and executes logical reasoning using the Clingo solver to solve constraint satisfaction and deduction problems.
Logic-LM (Answer Set Programming) is a community-built MCP server published by shipitsteven that provides AI assistants with tools and capabilities via the Model Context Protocol. Logic-LM (Answer Set Programming) boosts language models with formal logical reasoning and multi-step deduction via Clin It is categorized under ai ml.
You can install Logic-LM (Answer Set Programming) in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
Logic-LM (Answer Set Programming) is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Share your MCP server with the developer community
Useful MCP listing: Logic-LM (Answer Set Programming) is the kind of server we cite when onboarding engineers to host + tool permissions.
Logic-LM (Answer Set Programming) is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
Logic-LM (Answer Set Programming) reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Useful MCP listing: Logic-LM (Answer Set Programming) is the kind of server we cite when onboarding engineers to host + tool permissions.
Strong directory entry: Logic-LM (Answer Set Programming) surfaces stars and publisher context so we could sanity-check maintenance before adopting.
Logic-LM (Answer Set Programming) reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Logic-LM (Answer Set Programming) is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
Logic-LM (Answer Set Programming) is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
I recommend Logic-LM (Answer Set Programming) for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
According to our notes, Logic-LM (Answer Set Programming) benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
showing 1-10 of 44
A Model Context Protocol (MCP) server that provides symbolic reasoning capabilities using Logic-LM framework and Answer Set Programming (ASP).
This implementation is inspired by and builds upon the Logic-LLM framework:
Original Research:
This MCP server adapts the Logic-LLM approach for integration with Claude Code and other MCP clients, providing LLM-collaborative symbolic reasoning through Answer Set Programming.
Choose your preferred installation method:
# Install with pip
pip install logic-lm-mcp-server
# Or install with uv (10-100x faster)
uv pip install logic-lm-mcp-server
📦 Package URL: https://pypi.org/project/logic-lm-mcp-server/
# Install with optional solver
pip install logic-lm-mcp-server[solver]
# Or with uv
uv pip install logic-lm-mcp-server[solver]
git clone https://github.com/stevenwangbe/logic-lm-mcp-server.git
cd logic-lm-mcp-server
pip install -e .
logic-lm-mcp --help
After installing the package, add it to your Claude Code configuration:
Method 1: Using the console command (after PyPI installation)
claude mcp add logic-lm-mcp logic-lm-mcp
Method 2: Manual configuration
Edit ~/.config/claude/claude_desktop_config.json (create if it doesn't exist):
{
"mcpServers": {
"logic-lm": {
"command": "logic-lm-mcp"
}
}
}
Restart Claude Code to load the new MCP server.
Try these commands in Claude Code:
Check Logic-LM server health
Translate this logic problem to ASP: "All birds can fly. Penguins are birds. Can penguins fly?"
For other MCP-compatible tools, start the server manually:
python start_server.py
The server will run on stdio and provide these tools:
get_asp_guidelines - Get ASP translation guidelinestranslate_to_asp_instructions - Get problem-specific ASP guidanceverify_asp_program - Execute ASP programs with Clingocheck_solver_health - Verify system healthLogic-LM MCP Server converts natural language logical problems into Answer Set Programming (ASP) format, solves them using the Clingo solver, and returns human-readable results. It provides a three-stage reasoning pipeline: Problem Formulation → Symbolic Reasoning → Result Interpretation.
get_asp_guidelinesGet comprehensive ASP translation guidelines (cached for efficiency).
Parameters: None
Returns: Complete ASP Logic Translation Guidelines document with comprehensive instructions for translating natural language into Answer Set Programming format.
translate_to_asp_instructionsGet lightweight instructions for translating a specific natural language problem to ASP.
Parameters:
problem (string, required): Natural language logical problem to translateExample:
{
"problem": "All cats are mammals. Fluffy is a cat. Is Fluffy a mammal?"
}
Response:
{
"success": true,
"solution": "TRANSLATE TO ASP: All cats are mammals...
INSTRUCTIONS:
1. Call get_asp_guidelines() for complete patterns
2. Analyze logical structure...",
"confidence": 1.0,
"method": "lightweight_translation_instructions",
"metadata": {
"problem_length": 58,
"guidelines_cached": false,
"next_steps": ["Call get_asp_guidelines() if needed", "Generate ASP code", "Call verify_asp_program()"]
}
}
verify_asp_programDirectly verify and solve an ASP program using the Clingo solver.
Parameters:
program (string, required): ASP program code to verify and solvemax_models (integer, 1-100, default: 10): Maximum number of models to findExample:
{
"program": "% Facts
cat(fluffy).
% Rule: All cats are mammals
mammal(X) :- cat(X).
% Query
#show mammal/1.",
"max_models": 10
}
check_solver_healthCheck Logic-LM server and Clingo solver health status.
Returns:
Natural Language Input
↓
LLM Translation Instructions (Problem-specific guidance)
↓
ASP Program Generation (LLM-driven with guidelines)
↓
Clingo Solver Execution
↓
Model Interpretation (Symbolic results)
↓
Human-Readable Output
pip install -r requirements.txt
pip install fastmcp>=2.0.0 pydantic>=2.0.0 clingo>=5.8.0
git clone <repository-url>
cd logic-lm-mcp-server
pip install -e .
The server automatically handles:
Input: "If it's raining, then the ground is wet. It's raining. Is the ground wet?"
Output: "Yes, the ground is wet. This conclusion follows from modus ponens..."
Input: "All birds can fly. Penguins are birds. Can penguins fly?"
Output: "Based on the given premises, yes. However, this conflicts with real-world knowledge..."
Input: "All members of set A are in set B. X is in set A. Is X in set B?"
Output: "Yes, X is in set B. This follows from set inclusion transitivity..."
logic-lm-mcp --help
# Test with Claude Code
claude mcp get logic-lm
"No module named 'pydantic'" or similar
pip install -r requirements.txt"Clingo not available"
pip install clingoServer fails to start
python --version (requires 3.8+)logic-lm-mcp --helpMCP connection issues
claude mcp get logic-lmlogic-lm-mcp --helplogic-lm-mcp --helpcheck_solver_health toolinclude_trace=true in requestsError:
❌ Missing required dependencies:
- fastmcp>=2.0.0
- pydantic>=2.0.0
Cause: Dependencies not properly installed or virtual environment not activated.
Solution:
# Option 1: Use virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Option 2: Install globally
pip install -r requirements.txt
# Option 3: Use venv python directly
venv/bin/python start_server.py
Error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'fastmcp'
Cause: Virtual environment not properly activated or dependencies not installed.
Solution:
# Clean installation
rm -rf venv/
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Error:
ModuleNotFoundError: No module named 'pyda
---
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ Use when
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid when
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.