pypddlengine

pypddlengine

Enables AI agents to interactively explore PDDL planning problems by exposing a PDDL engine as MCP tools for initialization, action execution, state inspection, and goal checking.

Category
访问服务器

README

pypddlengine

A Python PDDL engine and MCP (Model Context Protocol) server that enables AI agents to interactively explore PDDL planning problems.

Features

  • Standalone PDDL engine — parse, validate, and execute PDDL domains and problems
  • Interactive plan exploration — step through plans, query reachable actions, inspect world state
  • MCP server — expose the engine as tools to any MCP-compatible AI agent (Claude Desktop, VS Code, etc.)
  • Python API — direct programmatic access with structured JSON responses
  • Session logging — record agent interactions to CSV/JSON for analysis

Supported PDDL Features

Feature Requirement Notes
STRIPS :strips Basic actions, positive/negative preconditions & effects
Typing :typing Typed objects/parameters, type hierarchies
Equality :equality (= ?x ?y) in preconditions
Negative preconditions :negative-preconditions (not ...) in preconditions and goals
Disjunctive preconditions :disjunctive-preconditions (or ...) in preconditions
Existential preconditions :existential-preconditions (exists (?x - type) ...)
Universal preconditions :universal-preconditions (forall (?x - type) ...) in preconditions
Conditional effects :conditional-effects (when ...) and (forall ... effect)
Implication :adl (imply ...) in preconditions
Numeric fluents :numeric-fluents increase, decrease, assign, scale-up, scale-down
Action costs / metric :action-costs (total-cost) with (:metric minimize ...)
Constants :constants in domain

Unsupported PDDL Features

Feature Notes
Durative actions (:durative-actions) Raises an explicit error with a descriptive message
Derived predicates (:derived) Not parsed; will fail on load
Maximize metric Only minimize is supported
Arithmetic in conditions Numeric expressions like (+ ?x ?y) in preconditions are not supported

Installation

git clone https://github.com/kgoe-ait/pypddlengine
cd pypddlengine
uv sync

Or install from PyPI (once published):

pip install pypddlengine

Usage

Python API — Simulator

from pypddlengine.engine import Simulator

sim = Simulator(domain_str, problem_str, plan_str)
sim.step_all()
print(sim.is_goal_reached())

Step through manually:

sim = Simulator(domain_str, problem_str)
sim.step(("move", ("loc1", "loc2")))
print(sim.get_executable_actions())
print(sim.is_goal_reached())

Python API — Exploration API

Higher-level API with structured JSON responses, designed for AI agent tool use:

from pypddlengine.api import PDDLExplorationAPI

api = PDDLExplorationAPI(domain_str, problem_str)
actions = api.get_available_actions()        # {"count": 4, "actions": [...]}
result  = api.execute_action("move", ("a", "b"))  # {"success": true, ...}
api.is_goal_reached()                        # {"goal_reached": false, ...}
api.reset()

Session Logger

Wraps the exploration API and logs every interaction to CSV/JSON:

from pypddlengine.session_logger import PDDLSessionLogger

session = PDDLSessionLogger(domain_str, problem_str, session_id="experiment_1")
session.execute_action("move", ["loc1", "loc2"])
session.export_to_csv("session.csv")
session.export_to_json("session.json")
session.print_summary()

MCP Server (Claude Desktop)

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "pddl-engine": {
      "command": "uv",
      "args": ["run", "python", "-m", "pypddlengine.server"],
      "cwd": "/path/to/pypddlengine"
    }
  }
}

MCP Server (VS Code)

Already configured in .vscode/mcp.json — works out of the box when opening this project.

MCP Tools

Once connected, the AI agent can use these tools:

Tool Description
pddl_init Initialize session with domain and problem PDDL strings
pddl_init_from_files Initialize session from domain and problem file paths
pddl_get_available_actions Get all executable actions in current state
pddl_execute_action Execute an action by name and arguments
pddl_get_current_state View all true predicates and fluents
pddl_is_goal_reached Check if goal conditions are met
pddl_reset Reset to initial state
pddl_get_action_history Review actions taken so far
pddl_get_domain Re-read the PDDL domain definition
pddl_get_problem Re-read the PDDL problem definition

Running Tests

uv run pytest

Project Structure

pypddlengine/
├── server.py            # MCP server
├── api.py               # Exploration API (structured JSON responses)
├── session_logger.py    # Session logging wrapper
└── engine/              # Core PDDL engine
    ├── simulator.py     # Plan simulation
    ├── parser/          # PDDL lexer & parser
    ├── interpreter/     # Domain/problem interpretation
    └── execution/       # State management & action execution

License

Apache 2.0 — see 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 模型以安全和受控的方式获取实时的网络信息。

官方
精选