sacp-proxy
Framework for building ACP proxy components that extend agent functionality.
What are proxies?
Proxies are modular components that sit between an editor and an agent, intercepting and transforming messages. They enable composable agent architectures where functionality can be added without modifying the base agent.
Editor → Proxy 1 → Proxy 2 → Agent
Use cases:
- Add MCP tools/resources/prompts to any agent
- Inject context or modify prompts before they reach the agent
- Filter or transform agent responses
- Add logging, metrics, or policy enforcement
Quick Start
The simplest proxy just forwards messages unchanged:
use JrConnection;
use ;
new
.name
.provide_mcp // Provide MCP services
.proxy // Enable proxy mode
.serve
.await?;
To intercept messages, add handlers before calling .proxy():
new
.name
.on_receive_request_from_successor
.provide_mcp
.proxy
.serve
.await?;
Key Concepts
Predecessor vs Successor:
- Predecessor - The component closer to the editor (could be editor or another proxy)
- Successor - The component farther from the editor (could be agent or another proxy)
Messages flow: Predecessor → This Proxy → Successor
Extension Traits:
AcpProxyExt- Adds proxy-specific methods toJrConnectionJrCxExt- Adds forwarding methods (send_to_predecessor,send_to_successor)
Examples
See the examples/ directory:
minimal.rs- Simplest possible proxywith_mcp_server.rs- Proxy that adds MCP tools
How Proxies Work
When you call .proxy(), the framework:
- Handles capability negotiation with predecessor and successor
- Sets up message routing between components
- Wraps your handlers to intercept specific message types
- Forwards everything else automatically
You only need to handle the messages you want to intercept or transform.
Related Crates
- sacp - Core ACP SDK
- sacp-conductor - Binary for orchestrating proxy chains
- sacp-tokio - Tokio utilities for spawning agents
License
MIT OR Apache-2.0