Typed from handler to wire
Register protocol features with their Rust types. lspf derives advertised capabilities from those same registrations, keeping behavior and metadata aligned.
English
RUST / LSP / IDE → AGENT
Build the language features your editor depends on. Use typed Rust servers for IDE integration, then connect agent tools through the same Language Server Protocol.
Typed clients & servers · Native & WASM
textDocument/hoverTyped request → language server → typed result
Start with the editor’s language experience. Extend to agent tools.
Register protocol features with their Rust types. lspf derives advertised capabilities from those same registrations, keeping behavior and metadata aligned.
Read synchronized documents, notebooks, workspace roots, configuration, and the client connection through the context supplied to each handler.
Serve concurrent requests with finite resource policies and cancellation tokens, using an async-first API designed for production ownership.
Start with stdio, TCP, WebSocket, or browser and Node workers. Implement the public message-framed transport traits when your host needs something else.
Start with the IDE: implement hover, completion, diagnostics, and other language features in a lspf server. The framework manages the LSP lifecycle, synchronized documents, capability advertisement, and cancellation while your handlers supply language analysis.
Extend that foundation with lspf's typed Client: an agent host can connect to a language server and reuse its LSP features. Tool selection, model calls, and decisions about applying edits remain in the host application.
Initialized connection · a hover handler and a user Layer are registered.
{ "jsonrpc": "2.0", "id": 41, "method": "textDocument/hover", "params": { "textDocument": { "uri": "file:///workspace/main.rs" }, "position": { "line": 0, "character": 3 } } }request #41: admitted params: decoded stack: panic isolation → tracing → concurrency limitmethod: textDocument/hover action: forward the decoded callroute: textDocument/hover input: Arc<State> + ServerContext + HoverParams + CancellationToken{ "contents": { "kind": "plaintext", "value": "fn main()" } }response #41: encoded budgets: message count + encoded bytes writer: Transport{ "jsonrpc": "2.0", "id": 41, "result": { "contents": { "kind": "plaintext", "value": "fn main()" } } }↓ Sequence only, not elapsed time or a live capture. Blue ↔ rows are wire JSON-RPC messages; green ◇ rows are framework internals; purple { } rows are application extensions. Transport framing and error branches are omitted.
Explore the server architecture · Build a client connection
let server = Server::builder(State)
.feature(lspf::features::hover(), hover)
.feature(lspf::features::completion(options), complete)
.command("acme.organize", organize)
.build()?;
let outcome = lspf::stdio(server).serve().await?;The framework handles JSON-RPC, initialization, document synchronization, capability advertisement, cancellation, and shutdown. Your handlers receive typed parameters and return typed results.
Install lspf and build your first server →
The stable feature catalog covers LSP 3.18 requests and notifications. Native servers can use stdio, TCP, or WebSocket. Browser and Node workers use the worker-channel adapter, and embedded hosts can implement the public transport traits. The framework also includes a typed outbound client endpoint, document and notebook synchronization, workspace state, bounded concurrency, cancellation, progress, and protocol test tools.