LSP and the X-Protocol Family
LSP and the X-Protocol Family
A lineage of stable wire protocols that decouple editors/IDEs from language-specific or domain-specific backends. LSP (Language Server Protocol) is the canonical example, the one that proved the pattern. Since LSP shipped (2016), the same shape has been replicated for debuggers (DAP), build tools (BSP), AI agents (MCP, ACP), and others.
The collective term isn't formally established; "X-Protocol family" or "LSP-style protocols" works. Whatever the name, the pattern is one of the most successful architectural ideas in dev tooling history.
The M × N → M + N collapse
Pre-LSP: every editor needs custom integration with every language's compiler/analyser. M editors × N languages = M·N integrations. Adding a new editor means re-implementing N language integrations. Adding a new language means N editor integrations.
Post-LSP: every editor speaks LSP; every language ships an LSP server. M + N. New editor needs only an LSP client; new language needs only one LSP server. The combinatoric explosion collapses.
This is the killer insight. Once one party in the equation gets standardised, the other can scale linearly.
LSP — Language Server Protocol
Microsoft, announced June 27 2016. From the LSP Protocol History: VS Code had absorbed two language servers and the team wanted one common protocol. They started from the TypeScript server protocol, generalised, switched wire format to JSON-RPC, and standardised in collaboration with Red Hat and Codenvy.
What LSP provides:
- Code completion
- Go-to-definition, find references
- Hover information
- Diagnostics (errors, warnings)
- Code actions (refactorings, quick fixes)
- Formatting
- Symbol search
The transport: JSON-RPC, framed by Content-Length: N\r\n\r\n headers, over stdio (or TCP, for remote scenarios).
Adoption was rapid. Within five years, every major editor (VS Code, Vim/Neovim, Emacs, Sublime, Helix, JetBrains' IDEs partially) had LSP clients. Every language with serious tooling shipped an LSP server (rust-analyzer, pyright, gopls, typescript-language-server, ...).
LSP is one of the rare standards that succeeded across editor wars. Microsoft built the protocol AND the canonical client (VS Code) AND multiple language servers — controlling all three sides made adoption easy. After ecosystem buy-in, Microsoft's control matters less; the protocol is now community-stewarded enough that VS Code being the dominant editor doesn't lock the protocol.
DAP — Debug Adapter Protocol
Same Microsoft lineage, slightly later (the DAP website spun out in 2018). Same shape applied to debuggers:
- Breakpoints
- Stepping (continue, step over, step in, step out)
- Stack inspection
- Variable evaluation
- REPL
DAP-the-protocol is JSON-shaped, slightly different from strict JSON-RPC (uses seq + request_seq for correlation, has explicit event type). For most purposes treat it as JSON-RPC family.
Adoption: VS Code, nvim-dap, JetBrains (partially), Helix. Server side: codelldb, debugpy, dlv-dap, js-debug, lldb-dap, netcoredbg.
Lazydap is built on top of DAP. See Debug Adapter Protocol (DAP) for depth.
BSP — Build Server Protocol
Scala Center + JetBrains, v1.0.0 June 2018. From the announcement: "BSP is inspired by LSP… LSP abstracts over the language whereas BSP abstracts over the build tool."
Authored by Jorge Vicente Cantero, Ólafur Páll Geirsson (Scala Center) and Justin Kaeser (JetBrains). The pattern: editors talk to build tools (sbt, Bazel, Mill) via a common BSP protocol; the editor doesn't need to know the build tool's specifics.
Adoption: real but narrower than LSP. JetBrains and Metals (Scala) on the client side; Bazel, sbt, Mill on the server side. Hasn't crossed into broad-language adoption the way LSP has.
MCP — Model Context Protocol
Anthropic, November 2024. Created by David Soria Parra and Justin Spahr-Summers. The agent-era restatement of the X-Protocol pattern:
- M LLM hosts (Claude Code, Cursor, Continue, Cline, ...) × N tools/data sources (filesystem, databases, APIs, custom scripts) — the M × N problem again.
- MCP solves it by standardising the wire: tools expose a standard protocol; LLM hosts speak that protocol; you can plug any tool into any host.
Wire: JSON-RPC over stdio (or HTTP+SSE). Capability negotiation. Tools describe themselves with names + descriptions + input schemas; LLM hosts list them and choose what to call.
Adoption was unusually fast. Within a year of launch: Microsoft, Google, OpenAI all officially adopted MCP. C# SDK partnered with Microsoft. Hundreds of MCP servers in the wild for popular APIs (GitHub, Slack, Postgres, ...).
MCP is now the de facto integration layer for AI agents. Whatever Anthropic's commercial fate, the protocol seems durable.
ACP — Agent Client Protocol
Zed, 2025. Open-source (Apache) at zed-industries/agent-client-protocol. Standardises editor ↔ coding agent the way LSP standardised editor ↔ language server.
The use case: you have a coding agent (Claude Code, Gemini CLI, Goose, OpenCode) running in your editor. The editor needs to display the agent's reasoning, accept its file edits, prompt for confirmations, etc. ACP defines that interface.
Adoption: Reference impl is Gemini CLI; supported by Claude Code (via SDK adapter), Goose, OpenCode, Kiro on the agent side; Zed, JetBrains, Neovim on the editor side. ACP Registry launched 2025. One of the few real LSP-shaped successes outside Microsoft's orbit.
This is "LSP for AI coding agents" — same idea, latest application.
Common shape across the family
Every member of the family shares:
- JSON-RPC over stdio (or socket). Wire format is text-based, debuggable, language-portable.
- Bidirectional. Server pushes notifications/events; client sends requests.
- Capability negotiation up front.
initializeexchanges capabilities so both sides know what's supported. - Lifecycle messages.
initialize→initialized→ work →shutdown→ exit. - Domain-specific request/notification types layered on JSON-RPC's request/response/notification primitives.
If you're designing a new protocol of this shape, start by reading the LSP and MCP specs side by side. The common structural decisions are nearly identical; the domain-specific bits are what matter.
Why this pattern keeps replicating
Because the M × N problem keeps appearing in new contexts:
- 2016: M editors × N languages → LSP
- 2018: M editors × N debuggers → DAP
- 2018: M editors × N build tools → BSP
- 2024: M LLM hosts × N tools → MCP
- 2025: M editors × N coding agents → ACP
Whenever you see two ecosystems each with multiple members that need to integrate with each other, the X-Protocol pattern is the obvious solution. Anyone building in such a space should default to "design the standard protocol" before "build the integration."
Why mxr and lazydap matter to this pattern
Mxr is "LSP-style architecture for email clients." Lazydap is "DAP-style architecture for debugger CLIs." Neither IS one of these protocols, but both adopt the structural discipline:
- Stable JSON-shaped IPC
- Headless core with multiple clients
- Capability/version negotiation
- Bidirectional events + requests
When designing your own headless tool, the LSP / DAP / MCP / ACP specs are the canonical references for "how to do this well." The mistakes are documented in their issue trackers; the lessons are in their evolution.
Common pitfalls
- Designing without a second client in sight. If you're sure you'll only ever have one consumer, you don't need a wire protocol — internal Rust types or class methods suffice. The pattern shines when the ecosystem is plural.
- Versioning paralysis. All these protocols version aggressively. LSP is on 3.17+; MCP is on multiple revisions. Plan for version negotiation from day 1.
- Capability sprawl. Each new feature adds capabilities; capability lists balloon. Periodic deprecation is healthy.
- Bad debugging tools. A protocol you can't easily inspect over the wire is a protocol that's hard to extend. JSON wins for inspectability.
See also
- Client-Agnostic Cores — the synthesis
- Headless Architecture — the broader pattern
- Debug Adapter Protocol (DAP) — the one Lazydap sits below
- JSON-RPC — the wire format underneath
- Agent-Native Interfaces — why MCP matters for the 2026+ era
- LSP spec: https://microsoft.github.io/language-server-protocol/specification
- DAP spec: https://microsoft.github.io/debug-adapter-protocol/specification
- MCP spec: https://spec.modelcontextprotocol.io/
- BSP spec: https://build-server-protocol.github.io/
- ACP overview: https://zed.dev/acp