ACP Kit provides a common adapter for Agent Frameworks.
Project description
ACP Kit
ACP Kit is the adapter toolkit and monorepo for turning an existing agent surface into a truthful ACP server boundary.
Today the production focus is pydantic-acp: exposing an existing pydantic_ai.Agent through ACP without rewriting the agent or inventing ACP state the runtime cannot really honor.
The repo currently ships three main Python packages:
acpkitRoot CLI, target resolver, and launch helpers.pydantic-acpProduction-grade ACP adapter forpydantic_ai.Agent.codex-auth-helperHelper package for building Codex-backed Pydantic AI Responses models from a local Codex login.
ACP Kit is not a new agent framework. The intended workflow is:
- Keep your existing agent surface.
- Expose it through ACP with
run_acp(...)orcreate_acp_agent(...). - Add only the ACP-visible state your runtime can actually honor: models, modes, plans, approvals, projection maps, MCP metadata, and host-backed tools.
Installation
Production:
uv add "acpkit[pydantic]"
pip install "acpkit[pydantic]"
With acpkit launch support:
uv add "acpkit[pydantic,launch]"
pip install "acpkit[pydantic,launch]"
Contributor setup:
uv sync --extra dev --extra docs --extra pydantic
pip install -e ".[dev,docs,pydantic]"
Contributor setup and validation commands are documented in CONTRIBUTING.md.
Quickstart
from pydantic_ai import Agent
from pydantic_acp import run_acp
agent = Agent("openai:gpt-5", name="weather-agent")
@agent.tool_plain
def get_weather(city: str) -> str:
return f"Weather in {city}: sunny"
run_acp(agent=agent)
If you want the ACP agent object without starting the server immediately:
from acp import run_agent
from pydantic_ai import Agent
from pydantic_acp import AdapterConfig, MemorySessionStore, create_acp_agent
agent = Agent("openai:gpt-5", name="composable-agent")
acp_agent = create_acp_agent(
agent=agent,
config=AdapterConfig(session_store=MemorySessionStore()),
)
run_agent(acp_agent)
CLI
Expose a supported target through ACP:
acpkit run my_agent
acpkit run my_agent:agent
acpkit run app.agents.demo:agent -p ./examples
acpkit resolves module or module:attribute targets, auto-detects supported agent instances, and dispatches them to the installed adapter package. If only the module is given, it selects the last defined supported agent instance in that module.
Launch a target through Toad ACP:
acpkit launch my_agent
acpkit launch my_agent:agent -p ./examples
If the script already starts its own ACP server and should be launched directly:
acpkit launch -c "python3.11 finance_agent.py"
launch TARGET and launch --command ... are mutually exclusive. -p/--path only applies to TARGET mode.
What pydantic-acp Supports
AdapterConfig is the main runtime surface. Common ownership seams include:
- session stores and lifecycle
- model selection
- mode and config state
- approval bridges
- native plan state or host-owned plan providers
- capability bridges
- projection maps and tool classification
- prompt-model override providers
Prompt resource support includes:
- ACP text blocks
- resource links
- embedded text resources
- image blocks
- audio blocks
- embedded binary resources
Host-facing utilities include:
HostAccessPolicyfor typed filesystem and terminal guardrailsClientHostContextfor ACP client-backed host accessBlackBoxHarnessfor ACP boundary integration testsCompatibilityManifestfor documenting the ACP surface an integration truly supports
Native Plan Mode And TaskPlan
pydantic-acp now uses TaskPlan as the structured native plan output surface.
Native plan mode is typically enabled through PrepareToolsBridge:
from pydantic_ai import Agent
from pydantic_ai.tools import RunContext, ToolDefinition
from pydantic_acp import (
AdapterConfig,
PrepareToolsBridge,
PrepareToolsMode,
run_acp,
)
def read_only_tools(
ctx: RunContext[None],
tool_defs: list[ToolDefinition],
) -> list[ToolDefinition]:
del ctx
return list(tool_defs)
agent = Agent("openai:gpt-5", name="plan-agent")
run_acp(
agent=agent,
config=AdapterConfig(
capability_bridges=[
PrepareToolsBridge(
default_mode_id="plan",
default_plan_generation_type="structured",
modes=[
PrepareToolsMode(
id="plan",
name="Plan",
description="Return a structured ACP task plan.",
prepare_func=read_only_tools,
plan_mode=True,
),
],
),
],
),
)
Key rules:
plan_generation_type="structured"is the default native plan-mode behavior.- In
structuredmode, the adapter expects structuredTaskPlanoutput instead of exposingacp_set_plan. - Switch to
plan_generation_type="tools"when you explicitly want tool-based native plan recording. - Keep
plan_tools=Truefor progress tools such asacp_update_plan_entryandacp_mark_plan_done. - Native plan state and a host-owned
plan_providerare separate seams. Use one truth source per workflow.
Projection Maps
Projection maps decide how known tool families render into ACP-visible updates instead of raw text blobs.
Built-in projection helpers:
FileSystemProjectionMapFilesystem reads, writes, and command previews into ACP diffs and rich status cards.HookProjectionMapRe-label or hide selectedHooks(...)lifecycle events.WebToolProjectionMapRich rendering for web-search and web-fetch style tool families.BuiltinToolProjectionMapRich rendering for built-in upstream capability tools such as web search, web fetch, image generation, and upstream MCP capability calls.
Example:
from pydantic_acp import (
AdapterConfig,
BuiltinToolProjectionMap,
FileSystemProjectionMap,
HookProjectionMap,
run_acp,
)
run_acp(
agent=agent,
config=AdapterConfig(
projection_maps=[
FileSystemProjectionMap(
default_read_tool="read_file",
default_write_tool="write_file",
),
HookProjectionMap(
hidden_event_ids=frozenset({"after_model_request"}),
event_labels={"before_model_request": "Preparing Request"},
),
BuiltinToolProjectionMap(),
],
),
)
Capability Bridges
Capability bridges extend runtime behavior without hard-coding one product shape into the adapter core.
Current built-in bridges include:
ThinkingBridgePrepareToolsBridgeThreadExecutorBridgeSetToolMetadataBridgeIncludeToolReturnSchemasBridgeWebSearchBridgeWebFetchBridgeImageGenerationBridgeMcpCapabilityBridgeToolsetBridgePrefixToolsBridgeOpenAICompactionBridgeAnthropicCompactionBridge
Use bridges when the runtime should gain upstream Pydantic AI capabilities and ACP-visible metadata without rewriting the adapter core.
Maintained Examples
The maintained example set is intentionally small. Each example is broad enough to be useful on its own instead of only demonstrating one narrow helper.
- Finance Agent Session-aware finance workspace with ACP plans, approvals, mode-aware tool shaping, and projected note diffs.
- Travel Agent Travel planning runtime with hook projection, approval-gated trip files, and prompt-model override behavior for media prompts.
Run them with:
uv run python -m examples.pydantic.finance_agent
uv run python -m examples.pydantic.travel_agent
Documentation Map
Top-level docs:
- Getting Started
- CLI
- Pydantic ACP Overview
- AdapterConfig
- Plans, Thinking, and Approvals
- Prompt Resources and Context
- Session State and Lifecycle
- Models, Modes, and Slash Commands
- Bridges
- Providers
- Host Backends and Projections
- Projection Cookbook
- Examples
- Testing
Reference docs:
ACP Kit Skill
This repo also ships an acpkit-sdk skill package for Codex.
Use it when you want Codex to help integrate ACP into an existing agent surface, especially for:
- exposing an existing
pydantic_ai.Agentthrough ACP - choosing between
run_acp(...),create_acp_agent(...), providers, bridges, andAgentSource - wiring plans, approvals, session stores, thinking, MCP metadata, and host-backed tools
- keeping docs and examples aligned with the real SDK surface
Install with just one command:
npx ctx7 skills install /vcoderun/acpkit acpkit-sdk
Canonical skill package:
Example prompts:
Use $acpkit-sdk to expose my existing pydantic_ai.Agent through ACP.Use $acpkit-sdk to add ACP plans, approvals, slash-command mode switching, and projection maps to this agent.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acpkit-0.8.2.tar.gz.
File metadata
- Download URL: acpkit-0.8.2.tar.gz
- Upload date:
- Size: 267.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e59526a59a25ae89d2bfc29a506d6439c444d50bf1edc4d392bb9811911fa0
|
|
| MD5 |
7843f0e4ede3fda57452154162d8575c
|
|
| BLAKE2b-256 |
673ec613310e992d15ba3a095eff64e5e66013a1ec9e171eacc79ff80451c4dc
|
File details
Details for the file acpkit-0.8.2-py3-none-any.whl.
File metadata
- Download URL: acpkit-0.8.2-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6afe7129c6aa3ad8be94cec0331a6d17cad9c5c65f1256d3e007c5a3a5a0fc11
|
|
| MD5 |
cfa4538bba6c74f978af419a86447000
|
|
| BLAKE2b-256 |
4935ad199432b2e48a9ff306802100a61a10910d872824bd662266dd5d2aa5eb
|