AAnvio
Reference ArchiveSource Docs

Editor Integration (ACP)

Agent Client Protocol (ACP) integration for editors — VS Code, Cursor, Windsurf, Zed, JetBrains — without editor-specific logic in core runtime.

3 min read

This is a migrated reference document from the original Anvio source repo. Content is preserved as-is; canonical documentation lives in the sections above in the sidebar.

Original path: docs/39-editor-integration.md

Agent Client Protocol (ACP) integration for editors — VS Code, Cursor, Windsurf, Zed, JetBrains — without editor-specific logic in core runtime.

Principles

  • Editors interact via ACP APIs or MCP
  • Core runtime remains editor-agnostic
  • Editor adapters live in packages/acp and packages/runtimes
  • Progressive enhancement: local runtime works without any editor

Supported Editors (Target)

Status (2026-10-25): packages/acp contains only src/acp-server.ts and src/protocol/. The per-editor packages listed below (packages/acp/vscode, windsurf, zed, jetbrains) do not exist. Cursor integration goes through the cursor runtime. Audit finding G-07 / T-015 records that this server is a proprietary prompt/response bridge and is not compatible with the standard Agent Client Protocol.

EditorProtocolPackage
CursorACP + MCPpackages/runtimes/cursor
VS CodeACP extensionpackages/acp/vscode
WindsurfACPpackages/acp/windsurf
ZedACPpackages/acp/zed
JetBrainsACP pluginpackages/acp/jetbrains

Architecture

Rendering diagram…

ACP Server

# workspace/anvio.yaml
spec:
  acp:
    enabled: true
    port: 8765
    host: 127.0.0.1
    editors:
      cursor:
        enabled: true
      vscode:
        enabled: false

Sequence: Editor Request via ACP

Rendering diagram…

MCP as Alternative Path

Editors with native MCP support can connect directly:

# Editor MCP config points to Anvio MCP server
{
  "mcpServers": {
    "anvio": {
      "command": "anvio",
      "args": ["mcp", "serve"]
    }
  }
}

Anvio exposes workspace tools, agents, and goals via MCP — editor uses Anvio as MCP server.

Bidirectional Modes

ModeDirectionUse Case
Anvio → EditorAnvio uses editor as runtimeruntime.provider: cursor
Editor → AnvioEditor uses Anvio as backendanvio mcp serve

Configuration per Agent

# workspace/agents/software-engineer.yaml
spec:
  runtime:
    provider: cursor
    acp:
      workspaceFolder: ${EDITOR_WORKSPACE}
      permissions:
        - filesystem
        - terminal

Extension Guide

  1. Implement ACP handler for new editor in packages/acp/\{editor\}/
  2. No changes to packages/core or packages/agents
  3. Register in packages/runtimes factory

CLI

anvio acp serve                    # Start ACP server (POST /prompt, POST /prompt/stream)
anvio acp status                   # Server status
anvio runtime test cursor          # Test Cursor runtime connection (requires ANVIO_ACP_ENDPOINT)

Endpoints

MethodPathDescription
GET/healthHealth check
POST/promptRun agent, return full response JSON
POST/prompt/streamSSE stream of \{ type: 'chunk', delta \} events

Set ANVIO_ACP_ENDPOINT=http://127.0.0.1:8765 for agents with runtime.provider: cursor.

Operational Runbook

ScenarioAction
Editor not connectingCheck anvio acp status, firewall on port 8765
Wrong workspaceSet EDITOR_WORKSPACE env var
Fallback to localAgent spec.runtime.fallback: local

Design Constraint

Zero editor imports in packages/core, packages/agents, packages/platform.

All editor-specific code isolated to packages/acp and packages/runtimes.

Package Boundaries

  • ACP Server: packages/acp/src/acp-server.ts
  • Protocol: packages/acp/src/protocol/
  • Editor adapters: packages/acp/src/editors/\{cursor,vscode,zed\}/
  • Runtime bridge: packages/runtimes/src/cursor/cursor-runtime.ts
Edit on GitHub

Last updated on

On this page