ptolemy-mcp

ptolemy-mcp

Enables AI agents to construct and simulate Ptolemy II models over MCP, including SDF model builds and signal property verification.

Category
访问服务器

README

Co-Designing the Tool Surface with the Agent Loop: Efficiency and Feasibility in Agentic Design Automation

IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD)

Tongyang Dai, Dimitrios Stamoulis, Hongyu Yuan, Jing Jin, and Jie Liu


This repository contains the artifact for the above paper. It includes the Ptolemy MCP server, the full evaluation harness, pre-collected per-run trace files for all four evaluation environments, and a script that reproduces every paper table from those traces without requiring an LLM API key.

Reproducing the paper tables (no API key required)

The pre-collected traces under eval/results/per_run/ (and the corresponding directories for Verilog/RTL, SystemC, and Simulink) are all that is needed to regenerate the LaTeX tables. No Ptolemy II installation and no Java are needed.

pip install -e .
python reproduce_tables.py

Output .tex and .json files are written to reproduced_tables/. The numbers should match the published paper exactly. An alternative output directory can be specified with --out-dir.

Which runs each table uses

reproduce_tables.py regenerates Tables V–IX plus the extended analyses and supplementary tables. Every cell is computed from the per-run traces, with one exception noted at the end of this section.

The per_run/ directories hold more than the main experiments: ablation sweeps, exploratory re-runs, and extra replicates share the same directory and are separated by run_ix block. Each generator therefore filters, and the blocks it keeps are part of the published result definition:

Table Runs used
V (Benchmark A) run_ix 0–4, the 10 canonical TASKS; novel tasks use 5000–5002
VI (closed-loop) run_ix 1000–1002 (N=3); config OPT uses 7000
VII (ablation) 78 single-factor runs; see stress_heldout_status.tex
VIII (modal + controls) per-arm blocks, listed in aggregate_modal_controls.py
IX (cross-environment) all runs in eval_{eda,systemc,simulink}/results/per_run/

Filtering on run_ix alone is not sufficient for Table V: blocks 0–2 of C1 and C4 also carry closed-loop and novel-task rows, so the generators additionally restrict to the canonical task list in eval/aggregate_results.py.

Table VIII pins a block per arm rather than one block for the whole table, and the module docstring in eval/aggregate_modal_controls.py records why for each: Tool-Naive's modal runs use 7000–7004 because the earlier 6000–6004 batch predates a harness fix and is quarantined under eval/results/invalid_lsbug/; cl_two_tank_modal uses 8300–8304 for all three arms; and the +Docs control uses 9000–9009 because rows 6000–6002 for that config are early trial runs, not the reported N=10 batch.

Two pass metrics, and which one each table reports. A trace records both grade.feasible (all behavioural properties pass) and grade.structural_pass (an additional structural check). The top-level passed field equals grade.overall_pass, i.e. feasible && structural_pass — the paper's Strict metric. Table VIII reports feasibility, so its generator reads grade.feasible; reading passed instead yields the Strict totals (1/20, 2/20, 12/20) rather than the published feasibility totals (1/20, 9/20, 18/20). aggregate_modal_controls.py prints both side by side so the distinction stays visible.

The one column not derived from traces: Table IX's Tokens/run. Token counts come from per-run LLM transcripts, which are not redistributed (they contain full prompt text), so aggregate_crossenv.py emits the published constants for that column and computes everything else. eval_systemc/extract_token_usage.py recomputes it if you have the transcripts.

aggregate_stress_heldout.py reports Claude matrix complete: False by design — the single-factor ablation covers 78 of a possible 150 runs, and stress_heldout_status.tex discloses which cells are incomplete.

Installation

Python 3.10 or later is required.

pip install -e .

For Ptolemy II integration (needed to run new evaluations, not for table reproduction), set two environment variables before starting the server:

export PTII=/path/to/ptII          # Ptolemy II installation root
export JAVA_HOME=/path/to/java     # JRE 11+

On Windows use set or PowerShell $env: equivalents.

Running the smoke demo

The smoke demo starts the MCP server over stdio, builds a small SDF model, and verifies a signal property end-to-end. It requires PTII and JAVA_HOME to be set.

python demos/mcp_stdio_smoke.py

Re-running the full evaluation

Re-running requires a live LLM API key and a working Ptolemy II installation. See eval/README.md for sweep scripts and configuration details.

The Claude-based agent is configured through eval/ptolemy_mcp_config.json. The GPT-5 cross-model probe reads the endpoint from the PTOLEMY_GPT5_BASE environment variable (defaults to the standard OpenAI-compatible endpoint).

Repository layout

ptolemy_mcp/          MCP server and Ptolemy II bridge (Python package)
eval/
  benchmarks/         Task specifications for Benchmark A and C
  results/per_run/    Pre-collected per-run trace JSON files (1 260 runs)
  aggregate_*.py      Aggregation scripts that produce the paper's tables
  runner.py           Evaluation harness entry point
eval_eda/             Verilog/RTL cross-environment evaluation (54 runs)
eval_systemc/         SystemC cross-environment evaluation (27 runs)
eval_simulink/        Simulink cross-environment evaluation (18 runs)
agent/                System prompt and case-study notes used during evaluation
demos/                End-to-end smoke demo and reference MoML models
examples/             Example MCP client configuration
scripts/              Helper scripts for running sweeps
reproduce_tables.py   Code Ocean entry point — regenerates all tables

Trace file format

Each file in eval/results/per_run/ is a JSON object with the following top-level fields:

Field Description
task_id Benchmark task identifier
config Agent configuration name (C1–C7, OPT, …)
agent Model used (claude, oracle, …)
run_ix Replicate index
passed Whether all properties were satisfied
wall_seconds Wall-clock time for the run
grade Numeric score (violation magnitude or 0 on pass)
tool_calls_total Total MCP tool calls made
tool_calls_by_fn Per-function tool call counts

License

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

官方
精选