PDDL MCP Server

PDDL MCP Server

A planning server that enables natural language to PDDL conversion, automatic problem generation, and batch task execution using the Fast Downward planner. It supports multi-robot coordination and provides detailed reporting and diagnostic capabilities for complex planning tasks.

Category
访问服务器

README

PDDL MCP Server

A PDDL planning server based on the FastMCP framework, providing natural language to PDDL planning conversion, execution, and batch processing capabilities.

✨ Features

  • 🗣️ Natural Language Processing: Generate PDDL planning tasks from natural language descriptions
  • 🤖 Automatic Problem Generation: Create PDDL problem files based on task parameters
  • 📦 Batch Task Processing: Run multiple tasks in batch and generate detailed execution reports
  • 🔒 Type Safety: Data validation and type checking with Pydantic
  • ⚙️ Configuration Validation: Built-in configuration and system info checking

📁 Project Structure

pddl-mcp/
├── core/                   # Core modules
├── templates/              # PDDL template files
├── tasks/                  # Task configuration files
├── output/                 # Output directory
├── config.py               # Configuration management
├── constants.py            # Constants
├── error_handler.py        # Error handling
├── server.py               # MCP server
├── test_server.py          # Test suite
├── .env                    # Environment variables
└── requirements.txt        # Dependencies

⚙️ Installation & Setup

1. Install Dependencies

pip install -r requirements.txt

2. Configure Fast Downward

git clone https://github.com/aibasel/downward.git
cd downward
./build.py

3. Environment Configuration

Copy .env.example to .env and set:

FAST_DOWNWARD_PATH=/path/to/fast-downward.py
PDDL_DOMAIN_PATH=./templates/domain.pddl

🔧 MCP Client Configuration

Claude Desktop

  1. Find the config file:
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add server config:
{
  "mcpServers": {
    "pddl-planner": {
      "command": "python",
      "args": ["d:/PDDL/pddl-mcp/server.py"],
      "cwd": "d:/PDDL/pddl-mcp",
      "env": {
        "FAST_DOWNWARD_PATH": "/path/to/fast-downward.py"
      }
    }
  }
}
  1. Restart Claude Desktop

Trae AI IDE

  1. Open MCP Settings:
    • Click settings → MCP Servers
    • Or use shortcut Ctrl+Shift+M
  2. Add new server:
{
  "name": "PDDL Planner",
  "command": "python",
  "args": ["d:/PDDL/pddl-mcp/server.py"],
  "cwd": "d:/PDDL/pddl-mcp",
  "description": "PDDL planning and NLP server"
}
  1. Test Connection

🚀 Running & Usage

Start the Server

python server.py

You should see:

✅ PDDL MCP Server initialized
🚀 Starting FastMCP server...

Run Tests

python test_server.py

Batch Task Processing

python core/batch_runner.py

💬 Prompt Examples

Basic Planning Task

Please plan a robot task:
- Robot: robot1
- Start: room1
- Goal: room3
- Task type: delivery

Generate a complete PDDL plan.

Natural Language Planning

Robot r2 needs to move from the warehouse to the office. Please generate a complete movement plan.

Multi-Robot Coordination

I have a multi-robot coordination task:
1. Robot r1 in room1, needs to go to room5
2. Robot r2 in room3, needs to go to room2
Please generate an individual plan for each robot and analyze possible path conflicts.

Batch Task Processing

Please batch process the following robot tasks:
1. r1: room1 → room3 (delivery)
2. r2: room2 → room4 (patrol)
3. r3: room5 → room1 (maintenance)

Generate a batch execution report including execution time and success rate for each task.

System Configuration & Diagnostics

Check the configuration status of the PDDL planning system, including:
- Fast Downward path
- Environment variables
- Dependency versions
- System performance
My PDDL planning task failed with error: [error message]
Please diagnose the problem and provide a solution.

🧪 Testing Guide

Prerequisites

  • Python 3.8+
  • Dependencies installed (pip install -r requirements.txt)
  • .env configured
  • Trae IDE imported project

Server Status

  • MCP server should show as connected in Trae IDE

Testing Methods

1. Trae IDE Direct Test

  • System config check
  • Simple planning task
  • Natural language planning
  • Multi-robot coordination
  • Batch task processing

2. Command Line

  • Start server: python server.py
  • Run test suite: python test_server.py
  • Batch tasks: python core/batch_runner.py

Expected Results

  • System config check returns JSON with config path, Fast Downward path, env status, output dir
  • Planning tasks generate:
    • PDDL problem files (output/pddl/)
    • Plan files (output/plan/)
    • Explanation files (output/explanation/)
  • Batch tasks generate:
    • Batch report (output/report.json)
    • Analysis (output/report.md)
    • Individual task files

Common Test Scenarios

  • Basic move task: single robot, simple path, expect 1-3 steps
  • Complex path: robot passes multiple rooms, expect optimal path
  • Multi-robot coordination: possible path conflicts, expect conflict analysis and solution
  • Error handling: invalid task params, expect clear error message

Troubleshooting

  • Server fails to start:
    1. Check dependencies: pip install -r requirements.txt
    2. Check Python version: python --version
    3. Check .env config
  • Planning fails:
    1. Validate Fast Downward path
    2. Check templates/domain.pddl
    3. Check output directory permissions
  • MCP connection fails:
    1. Restart Trae IDE
    2. Check .mcp.json config
    3. Ensure server port is free
  • Files not generated:
    1. Check output/ directory permissions
    2. Ensure enough disk space
    3. Validate file paths

Performance Testing

  • Response time: Simple task < 2s (run multiple times)
  • Concurrency: Multiple tasks at once, expect no conflict
  • Large-scale tasks: 10+ robots, expect successful coordination

Test Checklist

  • [ ] System config check
  • [ ] Simple planning task
  • [ ] Natural language processing
  • [ ] File generation
  • [ ] Multi-robot coordination
  • [ ] Batch task processing
  • [ ] Path conflict analysis
  • [ ] Error handling
  • [ ] Response time
  • [ ] Concurrency
  • [ ] Large-scale tasks
  • [ ] Memory usage
  • [ ] Trae IDE integration
  • [ ] MCP protocol compatibility
  • [ ] File system operations
  • [ ] Config management

Test Report Template

Test Date: [date]
Environment: [OS, Python version]
Scope: [modules tested]

Results:
✅ Passed
❌ Failed
⚠️  Issues

Performance:
- Avg response time: [time]
- Success rate: [percent]
- Resource usage: [memory, CPU]

Suggestions:
[improvements]

Next Steps

  • Expand test cases for more complex scenarios
  • Optimize performance based on results
  • Add new planning algorithms or features
  • Improve documentation and API reference

Note: For issues during testing, check logs in the output/ directory or run python test_server.py for diagnostics.

📄 License

MIT License

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选