Logic-LM

Logic-LM MCP Server: Symbolic reasoning for Claude Code using Answer Set Programming and the Clingo solver.
  • python

2

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "shipitsteven-logic-lm-mcp": {
      "command": "logic-lm-mcp",
      "args": []
    }
  }
}

You can run the Logic-LM MCP Server to perform symbolic reasoning on natural language inputs by converting them into Answer Set Programs and solving them with the Clingo solver. This enables a collaborative reasoning flow where an LLM guides ASP generation and interpretation, delivering human-readable results with robust logical inference.

How to use

You interact with the Logic-LM MCP Server through an MCP client. Start the server and connect your client to the MCP endpoint to translate natural language problems into ASP, solve them, and receive the results. Typical usage patterns include translating a logic problem into ASP, solving the ASP, and presenting the solution with reasoning trace when available. You can iterate on problems, refine the ASP formulation, and request guidance or templates to structure your queries.

How to install

Prerequisites: you need Python 3.8 or higher.

Option 1: Install the MCP server from PyPI (recommended)

pip install logic-lm-mcp-server

# Optional: install with a faster server runner
uv pip install logic-lm-mcp-server

Option 2: Install with Clingo support for full functionality

pip install logic-lm-mcp-server[solver]

# Optional: faster runner
uv pip install logic-lm-mcp-server[solver]

Option 3: Development installation

git clone https://github.com/stevenwangbe/logic-lm-mcp-server.git
cd logic-lm-mcp-server
pip install -e .

Test the installation by asking for help from the server CLI

logic-lm-mcp --help

Claude Code integration will let you register the MCP server so your editor can talk to it. Use one of the two methods below to add the server to Claude Code.

Method 1: Using the console command (after PyPI installation)

claude mcp add logic-lm-mcp logic-lm-mcp

Method 2: Manual configuration (edit your Claude Desktop config)

{
  "mcpServers": {
    "logic-lm": {
      "command": "logic-lm-mcp"
    }
  }
}

Restart Claude Code to load the new MCP server, then test the integration with sample prompts like health checks or ASP translation tasks.

Additional configuration and notes

Architecture-wise, the server uses a three-stage reasoning pipeline: translate the natural language input into an ASP program, perform symbolic reasoning using Clingo, and interpret the results into a readable answer for you.

Environment and dependencies are handled automatically where possible. The typical runtime relies on Python 3.8+, FastMCP, Pydantic, and Clingo. If Clingo is not available, the server will still operate with limited functionality but may not perform ASP solving.

You can use built-in templates to guide ASP translation and you have access to tools for translation guidelines, problem-specific ASP guidance, and verification of ASP programs.

Troubleshooting and tips

If you encounter issues, verify Python version, reinstall dependencies, and check that Clingo is installed if ASP solving is required. For MCP integration problems, confirm that the MCP configuration in your client matches the server’s command and that the server process is running.

If you need to reset the environment, recreate a clean virtual environment, reinstall dependencies, and restart the MCP server.

Examples of typical workflows

# Translate a natural language problem to ASP
# and then verify the ASP program using the built-in tools
# (exact commands depend on your client integration)

Available tools

get_asp_guidelines

Fetch comprehensive ASP translation guidelines for translating natural language problems into ASP format.

translate_to_asp_instructions

Provide lightweight, problem-specific guidance for translating a given natural language problem into ASP.

verify_asp_program

Execute and verify an ASP program using the Clingo solver to obtain models and results.

check_solver_health

Check the health and readiness of the MCP server and the Clingo solver.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational