Expand description
ACP (Agent Client Protocol) server for IDE embedding.
zeph-acp exposes the Zeph agent over the Agent Client Protocol so that
IDEs such as Zed can connect to it as a first-class AI assistant.
§Architecture
IDE / client
│ JSON-RPC over stdio / HTTP-SSE / WebSocket
▼
transport ──► ZephAcpAgent (ACP SDK Agent impl)
│
├─ AgentSpawner ──► agent loop (LoopbackChannel)
├─ AcpPermissionGate ──► IDE tool-call approval
├─ AcpFileExecutor ──► IDE fs/* proxying
├─ AcpShellExecutor ──► IDE terminal/* proxying
└─ AcpLspProvider ──► IDE LSP ext_method proxying§Transports
| Transport | Entry point | Feature flag |
|---|---|---|
| stdio (default) | serve_stdio | always |
| HTTP + SSE | [acp_router] | acp-http |
| WebSocket | [acp_router] | acp-http |
§Feature flags
| Flag | Description |
|---|---|
acp-http | HTTP/SSE and WebSocket transports via axum |
unstable-session-close | ACP session close extension |
unstable-session-fork | ACP session fork extension |
unstable-session-resume | ACP session resume extension |
unstable-session-usage | ACP session token-usage extension |
unstable-session-model | ACP session model-switching extension |
unstable-elicitation | ACP elicitation schema types |
unstable-logout | ACP logout extension |
§Quick start (stdio)
use std::sync::Arc;
use parking_lot::RwLock;
use zeph_acp::{AgentSpawner, AcpServerConfig, serve_stdio};
let spawner: AgentSpawner = Arc::new(|channel, ctx, session| {
Box::pin(async move {
// run your agent loop here
drop((channel, ctx, session));
})
});
let config = AcpServerConfig {
agent_name: "my-agent".to_owned(),
agent_version: "0.1.0".to_owned(),
..AcpServerConfig::default()
};
serve_stdio(spawner, config).await?;Re-exports§
pub use agent::AcpContext;pub use agent::AgentSpawner;pub use agent::ProviderFactory;pub use agent::SessionContext;pub use agent::run_agent;pub use client::AcpClientError;pub use client::RunOutcome;pub use client::SubagentConfig;pub use client::SubagentHandle;pub use client::run_session;pub use client::spawn_subagent;pub use error::AcpError;pub use fs::AcpFileExecutor;pub use lsp::AcpLspProvider;pub use lsp::DiagnosticsCache;pub use lsp::LspProvider;pub use mcp_bridge::acp_mcp_servers_to_entries;pub use permission::AcpPermissionGate;pub use terminal::AcpShellExecutor;pub use transport::AcpServerConfig;pub use transport::serve_connection;pub use transport::serve_stdio;
Modules§
- agent
- ACP agent implementation — session management and IDE capability proxying.
- client
- ACP sub-agent client.
- error
- fs
- IDE-proxied filesystem executor via ACP
fs/*methods. - lsp
- LSP extension for ACP — IDE code intelligence via
ext_method. - mcp_
bridge - Conversion between ACP
McpServerdescriptors andzeph-mcpServerEntryconfigs. - permission
- Tool-call permission gate backed by IDE approval and a TOML persistence file.
- terminal
- IDE-proxied shell executor via ACP
terminal/*methods. - transport
- ACP transport layer — stdio, HTTP+SSE, and WebSocket.