Catalog PyPI
PACKAGE EXPLORERView in registry

acp-agent-framework

PyPI

Build custom ACP-compatible agents using your existing AI subscriptions

acpagentframeworkllmmcp
Versions collected1
Direct dependencies11From release 0.2.0
Last observed20 Oct, 18:22 UTC

README

Version 0.2.0 documentation

ACP Agent Framework

Build custom AI agents using your existing subscriptions. No API keys. No vendor lock-in.

Python 3.10+ License: MIT CI PyPI ACP Protocol

The first open-source Python framework for building agents that speak the Agent Client Protocol (ACP).


How It Works

Architecture diagram

Why ACP?

Traditional Agent FrameworksACP Agent Framework
AuthManage API keys per providerUse your existing AI subscriptions
ProtocolProprietary APIs, custom integrationsOpen standard (ACP) — works with any ACP client
Lock-inTied to one LLM providerSwap backends with one line: backend="gemini"

Features

FeatureDescription
Multi-BackendClaude, Gemini, Codex — swap with a single parameter
Agent OrchestrationSequential pipelines, keyword routing, agent-to-agent delegation
Tool CallingWrap any Python function as an MCP tool the LLM can invoke
StreamingReal-time token-by-token output via async generators
Multi-TurnConversation history maintained across prompts
GuardrailsInput/output validation hooks — redact PII, block injections
SkillsLoad reusable agent capabilities per agentskills.io spec
ServingACP stdio (editors), HTTP/SSE (web apps), CLI
State PersistenceJsonSessionStore utility to save/restore session state as JSON
Session-Scoped BackendsBackend processes spawn once per session and stay warm across turns

Install

pip install acp-agent-framework

For development:

git clone https://github.com/sanjay3290/agentic-framework-acp.git
cd agentic-framework-acp
pip install -e ".[dev]"

Quick Start

Simple Agent

from acp_agent_framework import Agent, serve

agent = Agent(
    name="assistant",
    backend="claude",  # or "gemini" or "codex"
    instruction="You are a helpful coding assistant.",
)

serve(agent)  # Serves over ACP stdio

Sequential Pipeline

Chain agents — each one's output feeds into the next:

Sequential pipeline

from acp_agent_framework import Agent, SequentialAgent, serve

researcher = Agent(
    name="researcher",
    backend="claude",
    instruction="Research the given topic thoroughly.",
    output_key="research",
)

summarizer = Agent(
    name="summarizer",
    backend="claude",
    instruction=lambda ctx: f"Summarize:\n\n{ctx.state.get('research', '')}",
)

pipeline = SequentialAgent(name="research-pipeline", agents=[researcher, summarizer])
serve(pipeline)

Router Agent

Route requests to specialists based on keywords:

Router agent pattern

from acp_agent_framework import Agent, Route, RouterAgent, serve

code_agent = Agent(name="coder", backend="claude", instruction="Help with code.")
writing_agent = Agent(name="writer", backend="gemini", instruction="Help with writing.")

router = RouterAgent(
    name="smart-router",
    routes=[
        Route(keywords=["code", "python", "bug"], agent=code_agent),
        Route(keywords=["write", "essay", "email"], agent=writing_agent),
    ],
    default_agent=code_agent,
)

serve(router)

Custom Tools

Wrap Python functions as tools the LLM can invoke via MCP:

from acp_agent_framework import Agent, FunctionTool, serve

def search_docs(query: str) -> str:
    """Search documentation for a query."""
    return f"Results for: {query}"

agent = Agent(
    name="tool-agent",
    backend="claude",
    instruction="Use tools to help the user.",
    tools=[FunctionTool(search_docs)],
)

serve(agent)

Tools are bridged to the backend via MCP — each FunctionTool is exposed as an MCP tool that the LLM can call during inference.

ToolAgent (No LLM Needed)

For deterministic workflows and data pipelines:

from acp_agent_framework import ToolAgent, FunctionTool, Context

async def build_report(ctx, tools):
    data = tools["fetch_data"].run({"source": "api"})
    return tools["format_report"].run({"data": data})

agent = ToolAgent(
    name="reporter",
    tools=[FunctionTool(fetch_data), FunctionTool(format_report)],
    execute=build_report,
    output_key="report",
)

Guardrails

Validate and transform inputs/outputs:

from acp_agent_framework import Agent, Guardrail, serve

agent = Agent(
    name="safe-agent",
    backend="claude",
    instruction="Be helpful.",
    input_guardrails=[
        Guardrail("pii-redact", lambda t: t.replace("SSN: 123-45-6789", "SSN: [REDACTED]")),
    ],
    output_guardrails=[
        Guardrail("length-limit", lambda t: t[:500] + "..." if len(t) > 500 else t),
    ],
)

Agent Skills

Load reusable capabilities per the agentskills.io spec:

agent = Agent(
    name="chat-agent",
    backend="claude",
    instruction="You are a helpful assistant.",
    skills=["google-chat"],  # loads from .agents/skills/google-chat/SKILL.md
)

Streaming

Real-time token-by-token output:

agent = Agent(name="storyteller", backend="gemini", instruction="Write stories.", stream=True)

async for event in agent.run(ctx):
    if event.type == "stream_chunk":
        print(event.content, end="", flush=True)

Agent-to-Agent Delegation

Wrap any agent as a tool for another agent:

Agent-to-agent delegation

from acp_agent_framework import Agent, AgentTool, serve

translator = Agent(name="translator", backend="gemini", instruction="Translate text.")
summarizer = Agent(name="summarizer", backend="claude", instruction="Summarize text.")

manager = Agent(
    name="content-manager",
    backend="claude",
    instruction="Use translator and summarizer tools to help the user.",
    tools=[AgentTool(translator, cwd="."), AgentTool(summarizer, cwd=".")],
)

serve(manager)

Serving Agents

TransportUse CaseCommand
ACP stdioACP-compatible clientsserve(agent)
HTTP/SSEWeb apps, APIsserve(agent, transport="http", port=8000)
CLITerminalacp-agent run module:agent

HTTP Endpoints

MethodEndpointDescription
POST/api/sessionsCreate session
GET/api/sessions/{id}Get session info
DELETE/api/sessions/{id}Delete session
POST/api/sessions/{id}/promptPrompt with SSE streaming

CLI

acp-agent init my-agent                            # Scaffold a new project
acp-agent run my_agent.agent:agent                 # Run over ACP stdio
acp-agent run my_agent.agent:agent -t http -p 8000 # Run as HTTP server

Supported Backends

BackendCommandInstall
Claudeclaude-agent-acpnpm i -g @agentclientprotocol/claude-agent-acp
Geminigemini --acpnpm i -g @google/gemini-cli
Codexcodex-acpnpm i -g @agentclientprotocol/codex-acp
GitHub Copilotcopilot --acpnpm i -g @github/copilot
OpenCodeopencode acpnpm i -g opencode-ai
Goosegoose acpblock.github.io/goose
Qwen Codeqwen --acpnpm i -g @qwen-code/qwen-code
Cursorcursor-agent acpcursor.com/cli
Grok Buildgrok agent stdionpm i -g @xai-official/grok
Clinecline --acpnpm i -g cline
Auggieauggie --acpnpm i -g @augmentcode/auggie
Kilokilo acpnpm i -g @kilocode/cli
Devindevin acpdevin.ai
Kimi CLIkimi acpkimi.com

Any other agent from the ACP Registry can be used by registering its launch command.

Register custom backends:

from acp_agent_framework import BackendConfig, BackendRegistry

registry = BackendRegistry()
registry.register("my-backend", BackendConfig(
    command="my-agent-binary",
    args=["--acp"],
))

Architecture

Framework internals

Testing

# Unit tests (174 tests)
pytest tests/ -v

# Integration tests (requires backends installed)
pytest tests/ -v -m integration

# Lint
ruff check src/ tests/

Examples

Check the examples/ directory for complete working agents:

ExampleDescription
simple_agentMinimal agent with a single backend
function_toolsWeather, calculator, and unit converter tools
tool_agentHacker News digest without an LLM
guardrailsPII redaction and injection blocking
streamingReal-time token streaming
multi_turnConversational agent with history
router_agentKeyword-based routing
sequential_pipelineMulti-step agent chain
agent_to_agentManager delegating to specialists

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.014 Jul 202611

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
sanjay3290/agentic-framework-acp

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:22 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:b5765d39d401245b8b9ebbb6e2e6b3f6032ffcda7a571d52c3a1f7d29734dc03