pet-tools-mcp

pet-tools-mcp

Enables AI agents to code and debug Commodore PET software using the VICE emulator, with CLI and MCP tools for session control, screen reading, memory manipulation, and testing.

Category
访问服务器

README

<p align="center"> <img src="img/logo.png" alt="PET Project logo" width="360"> </p>

PET Project

License: MIT Python 3.11+ Built with AI

PET Project is a set of tools, skills, and an MCP to enable agentic Commodore PET coding and debugging using the VICE emulator.

The Python package is imported as petlib, installed as pet-tools, and driven by the pet command-line tool.

Install

Requires Python 3.11+, VICE 3.5+ (provides xpet and petcat), and the cc65 suite (ca65/ld65, for assembling 6502 programs). Then install this package.

macOS (Homebrew):

brew install vice cc65
pip install -e .

Debian / Ubuntu:

sudo apt install vice cc65
pip install -e .

Quickstart

pip install -e .
pet session start --model pet4032      # boot an emulated PET 4032
pet run tests/programs/hello-basic/program.bas   # tokenize + load + RUN
pet run tests/programs/hello-asm/program.s       # assemble + load + RUN (needs cc65)
pet screen                             # read the screen as text
pet basic type prog.bas --run          # type a program via the keyboard
pet mem read '$8000' 64                # hex dump of screen RAM
pet break add start                    # symbolic breakpoint (uses .lbl symbols)
pet wait --break                       # block until it fires
pet step 5 && pet reg                  # single-step, inspect (PC annotated)
pet continue                           # resume
pet disk create work.d64 && pet disk put work.d64 game.prg game
pet session start --disk work.d64      # boot with the disk attached
pet disk boot work.d64                 # or attach+run mid-session
pet rom info                           # identify the loaded ROM set
pet rom disasm CHROUT 16               # annotated live disassembly
pet session stop

pet test run mytest.yaml               # declarative YAML test (format in docs/cli.md)
pet test programs                      # run every example program as a test

Every command takes --json for machine-readable output — the intended interface for AI agents.

Using with AI coding agents

This toolset is built to be driven by an AI agent. There are two ways an agent can use it — pick either or both:

  • The CLI — every pet command takes --json. Works with any agent that can run shell commands; nothing to configure.
  • The MCP serverpet-tools-mcp exposes the same operations as MCP tools over stdio. CLI and MCP share the same sessions, so they are interchangeable.

Either way, the agent should read skills/pet-development/SKILL.md (the PET workflows and pitfalls) before starting — the per-agent steps below make that happen automatically.

The MCP config used by several agents below is this one block:

{
  "mcpServers": {
    "pet-tools": { "command": "pet-tools-mcp" }
  }
}

Setup was verified against each agent's docs in July 2026; if something has moved, check the agent's current MCP documentation.

Any agent with a shell (simplest — works everywhere)

  1. Install (see above) — that's the whole setup.
  2. Start your task prompt with: "Read docs/cli.md and skills/pet-development/SKILL.md, then …"

Claude Code

  1. From the repo root, install the skills so Claude discovers them automatically:

    mkdir -p .claude/skills && cp -R skills/* .claude/skills/
    
  2. (Optional) Add the MCP server: claude mcp add pet-tools -- pet-tools-mcp

  3. Ask for what you want — e.g. paste a prompt from demos/.

No CLAUDE.md edits are needed: installed skills load on demand, and the MCP tools describe themselves.

OpenAI Codex

  1. Add the MCP server: codex mcp add pet-tools -- pet-tools-mcp (or add [mcp_servers.pet_tools] with command = "pet-tools-mcp" to ~/.codex/config.toml).
  2. Codex has no skills mechanism, so tell it where the docs are: add one line to the repo's AGENTS.md"For Commodore PET work, first read skills/pet-development/SKILL.md and docs/cli.md."
  3. Paste a prompt from demos/.

Cursor

  1. Create .cursor/mcp.json in the repo (or ~/.cursor/mcp.json globally) containing the JSON block above.
  2. Create a rule (.cursor/rules/pet.mdc) — or a plain AGENTS.md — with the same one-liner: "For Commodore PET work, first read skills/pet-development/SKILL.md and docs/cli.md."
  3. Paste a prompt from demos/.

Gemini CLI

  1. Add the JSON block above to .gemini/settings.json in the repo (or ~/.gemini/settings.json globally).
  2. Add the same read-the-skill one-liner to GEMINI.md.
  3. Paste a prompt from demos/.

Google Antigravity

  1. Open the MCP store → Manage MCP ServersView raw config and add the JSON block above (the file is ~/.gemini/config/mcp_config.json).
  2. Add the read-the-skill one-liner to AGENTS.md.
  3. Paste a prompt from demos/.

Demos — try it with your AI agent

demos/ is a set of ready-to-paste prompts, graded from a first BASIC program up to writing Snake in 6502 assembly. To use one:

  1. Set up your agent (one section up — or use any shell agent with no setup).
  2. Open a demo file and copy its prompt.
  3. Paste it into your agent and watch it write, run, and debug real PET software on the emulated machine.

The reference example programs (with expected screen output, runnable as regression tests via pet test programs) live in tests/programs/.

Status

v1 complete — all planned phases shipped: sessions, screen, memory, registers, pet build (ca65/ld65), pet basic (petcat), pet load/pet run, symbolic breakpoints and watchpoints with conditions, pet step/finish/ continue/until, the pet wait synchronization primitive, pet disk (create/ls/put/get/boot via c1541), pet rom info/disasm, pet test (declarative YAML tests + example programs), the pet-tools-mcp MCP server, and the AI enablement docs (the pet-development and 6502-assembly skills, the machine references, and the docs/cli.md man pages).

ROM tooling reads ROM bytes from your running emulator and ships only original label annotations — no Commodore-copyrighted code lives in this repo.

AI Disclosure

PET Project is developed primarily by AI — Anthropic's Claude, working through Claude Code — under human direction: a human sets the goals, reviews the designs and plans, and approves the work; the AI writes the specs, plans, code, tests, and documentation. Every change is verified by the automated test suite, including integration tests that run against a real VICE emulator, before it lands. The project also exists for AI use — these tools are built so AI agents can write and debug Commodore PET software — making it a working example of AI-built developer tooling.

License

MIT. VICE is a separate GPLv2+ program invoked as a subprocess; it is not bundled and must be installed separately.

推荐服务器

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

官方
精选