Blocksworld Simulation MCP Server
Enables LLMs to interact with the Blocksworld Simulation to perform block manipulation actions, query real-time state, and verify multi-step plans. It bridges the Model Context Protocol with the simulation's REST API for AI planning research and agent development.
README
๐ค Blocksworld Simulation MCP Server
A Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to interact with the Blocksworld Simulation through tool calls. This allows AI agents or LLMs in general like Claude, ChatGPT, and other MCP-compatible systems to solve planning problems by directly controlling the simulation.
๐ฏ What is This?
This MCP server exposes the Blocksworld Simulation's REST API as a set of tools that LLMs can use. Instead of just talking about block manipulation, LLMs can actually:
- Execute actions: Pick up, put down, stack, and unstack blocks
- Query state: Get real-time information about block positions and robot status
- Verify plans: Test multi-step plans before execution
- Learn rules: Retrieve the complete set of constraints and preconditions
Perfect for:
- ๐ฌ AI Planning Research: Test LLM reasoning and planning capabilities
- ๐ Educational Projects: Demonstrate AI problem-solving in action
- ๐งช Agent Development: Build and test autonomous AI agents
- ๐ Benchmarking: Evaluate LLM performance on classic planning problems
โจ Features
- 7 MCP Tools: Complete set of blocksworld operations exposed as LLM tools
- Rich Descriptions: Each tool includes detailed preconditions and effects
- Plan Verifciation: LLMs can verify plans without executing them
- State Inspection: Query current simulation state at any time
- Rule Discovery: LLMs can learn the rules dynamically
- Type Safety: Pydantic models ensure correct tool usage
๐ Quick Start
Prerequisites
- Python 3.10+ installed
- Blocksworld Simulation running on
localhost:5001- Follow the simulation setup guide
- Make sure the simulation is started before using the MCP server
Installation
# Clone the repository
git clone https://github.com/hsu-aut/llmstudy_mcp-server.git
cd llmstudy_mcp-server
# Install dependencies
poetry install
# Run the MCP server
poetry run blocksworld-mcp-server
Using with Claude Desktop
Add this to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"blocksworld": {
"command": "poetry",
"args": [
"--directory",
"/path/to/llmstudy_mcp-server",
"run",
"blocksworld-mcp-server"
]
}
}
}
Restart Claude Desktop, and the blocksworld tools will be available!
๐ ๏ธ Available Tools
The MCP server provides the following tools to LLMs:
1. pick_up
Pick up a block from the ground.
Parameters:
block(str): The name of the block to pick up
Preconditions:
- Block must be on the ground (not stacked)
- Block must be clear (nothing on top)
- Robot must be idle (not holding anything)
2. unstack
Remove a block from the top of another block.
Parameters:
block_x(str): The block to removeblock_y(str): The block underneath
Preconditions:
- Block x must be directly on top of block y
- Block x must be clear
- Robot must be idle
3. put_down
Place the held block on the ground.
Parameters:
block(str): The name of the block to put down
Preconditions:
- Robot must be holding the specified block
- A free ground position must be available
4. stack
Place the held block on top of another block.
Parameters:
block_x(str): The block to place (currently held)block_y(str): The block to stack on
Preconditions:
- Robot must be holding block x
- Block y must be clear
5. status
Get the current state of the simulation.
Returns:
- Complete JSON object with all block positions, stack configurations, and robot state
6. rules
Get the complete description of blocksworld rules and constraints.
Returns:
- Markdown-formatted text describing the environment, rules, and available actions
7. verify_plan
Verify a multi-step plan without executing it.
Parameters:
plan(PlanRequest): A sequence of actions to verify
Returns:
- Success message if the plan is verified, or detailed error message indicating which step fails
Note: execute_plan is disabled by default to encourage LLMs to execute actions step-by-step for better reasoning.
๐ Example Usage
Here's how an LLM might use these tools to solve a simple problem:
User: "Stack block A on top of block B"
LLM thought process:
1. Call status() to see current state
2. Call rules() to understand constraints
3. Determine plan: pick_up(A) โ stack(A, B)
4. Call verify_plan([pick_up(A), stack(A, B)]) to verify
5. Execute: pick_up(A)
6. Execute: stack(A, B)
7. Confirm success
๐ง Configuration
Changing the Simulation API URL
By default, the MCP server connects to http://localhost:5001. To change this, edit src/blocksworld_simulation_mcp_server/mcp_server.py:
SIM_API = "http://localhost:5001" # Change this line
๐ Architecture
โโโโโโโโโโโโโโโโโโโโโโโ MCP Protocol โโโโโโโโโโโโโโโโโโโโ
โ LLM (Claude) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโบโ MCP Server โ
โ โ Tool Calls & Responses โ (This Repo) โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
HTTP REST API
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Blocksworld โ
โ Simulation โ
โ (localhost:5001)โ
โโโโโโโโโโโโโโโโโโโโ
The MCP server acts as a bridge between:
- LLMs that speak the Model Context Protocol
- Blocksworld Simulation that exposes a REST API
๐ Related Projects
- Blocksworld Simulation - The visual simulation environment this server connects to
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.