Agent Context Protocol

MCP lets agents connect. ACP tells them how to enter a project safely.

Every AI coding agent loses context between sessions. ACP gives agents shared project context — what was decided, what must not change, and how to hand off work safely. Local-first, file-based, open source.

The three context losses every developer faces

🧠

Memory loss

Agent forgets what was decided. Every session starts from zero. You become a courier of information between your own tools.

🗺️

Environment blindness

Agent doesn't know where it is. It "discovers" your infrastructure from scratch and reaches wrong conclusions. Your agent tried to deploy on the wrong server because it didn't know the architecture.

🛡️

Rule violations

Agent breaks frozen decisions you set last week. Architectural constraints, security policies, team conventions — all forgotten. You repeat the same warnings every session.

No existing tool solves all three. MCP gives tools. CLAUDE.md is static. Cursor Rules don't carry memory. ACP fills the gap.

Four steps to persistent context

1

Initialize

npx acp init

Creates .acp/ directory with rules.yaml, environment.yaml, and config. Rules are committed to git. Journal stays local.

2

Start server

npx acp start

Local REST server on localhost:3075. No cloud, no signup, no config.

3

Agent connects

POST /session/start

Agent gets full context on entry: rules, recent discoveries, blockers, last session summary, environment snapshot.

4

Handoff

POST /session/end

Agent writes a summary. Next agent starts and sees everything. No manual copy-paste. Context lives in the project.

Three layers of context, one clear hierarchy

Rules
↑ Highest priority

Frozen decisions, boundaries, policies

Source: .acp/rules.yaml — committed to git. Agent must respect, cannot override.

frozen: - id: arch-001 text: "API gateway is the only entry point" source: ADR-003
Memory
Medium priority

Discoveries, decisions, blockers, session summaries

Source: .acp/journal.jsonl — local, in .gitignore. Agent reads previous work, publishes new findings.

{"type": "decision", "text": "Token expiry checked in middleware", "agent": "claude-code", "confidence": "high"}
Environment
↓ Lowest priority

Services, ports, databases, important files

Source: .acp/environment.yaml — committed to git. Agent knows where things are without guessing.

services: - name: api host: localhost port: 8080
Rules > Memory > Environment
A frozen rule overrides a discovery. A discovery overrides a guess.

Up and running in 3 minutes

bash
# 1. Initialize ACP in your project
cd your-project
npx acp init

# 2. Define your project rules
cat >> .acp/rules.yaml << 'EOF'
frozen:
  - id: arch-001
    text: "Never modify the database schema without review"
    source: team-policy
never:
  - id: sec-001
    text: "Never commit secrets or API keys"
always:
  - id: qa-001
    text: "Run tests before committing"
EOF

# 3. Start ACP server
npx acp start
# → ACP Server v0.1.0 on http://127.0.0.1:3075

# 4. Connect your agent
curl -X POST http://localhost:3075/session/start \
  -H "Content-Type: application/json" \
  -d '{
    "agent": {"id": "claude-code"},
    "scope": {"task": "fix-auth-bug"},
    "intent": {"summary": "Fix token expiry in auth middleware"}
  }'

# 5. Agent gets full context — rules, memory, environment

Works with Claude Code, Cursor, Copilot, or any agent with HTTP access.
Add .acp/journal.jsonl to your .gitignore.

How ACP compares

ACP MCP CLAUDE.md Cursor Rules Mem0
Project rules
Session memory
Environment snapshot
Cross-agent handoff
Tool execution
Local-first
Git-native

ACP is complementary to MCP, not competitive.
MCP is the execution plane — agents can do things.
ACP is the context plane — agents know things.
They work together.

Three endpoints, that's it

POST /session/start

Agent joins and receives full project context.

Request
{
  "agent": { "id": "claude-code", "kind": "coding-agent" },
  "scope": { "task": "fix-auth-bug" },
  "intent": { "summary": "Fix token expiry in auth middleware" }
}
Response
{
  "session": { "session_id": "sess_20260405_a1b2", "started_at": "..." },
  "rules": { "frozen": [...], "never": [...], "always": [...] },
  "memory": { "recent": [...], "blockers": [...], "last_session": {...} },
  "environment": { "services": [...], "important_files": [...] }
}
POST /publish

Agent publishes a finding during work.

Request
{
  "session_id": "sess_20260405_a1b2",
  "type": "discovery",
  "text": "Bug is in middleware auth.ts line 42 — missing token expiry check",
  "confidence": "high"
}
Types: discovery decision blocker warning result handoff
POST /session/end

Agent leaves and writes a summary for the next agent.

Request
{
  "session_id": "sess_20260405_a1b2",
  "summary": "Fixed token expiry. Tests pass. Blocked on Redis config.",
  "files_changed": ["src/middleware/auth.ts"],
  "result": "partial"
}
Result: complete partial blocked failed