From b98c8a4605297ca0e4de1e757f2b8997ade08d84 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Sun, 5 Oct 2025 16:54:49 -0400 Subject: [PATCH] README thoughts and reflections --- README | 4 ++++ src/mcp/tools/read.rs | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README b/README index 6d051a712604ed1699ada7c0e09e4fe7117ce726..f3d0adf7f2518b359338526e7d9ce0b8ce8f5d1f 100644 --- a/README +++ b/README @@ -1,3 +1,7 @@ A bridge to translate arbitary LSPs into MCP so that agents can get ground truth about the code they write on the fly. +Design goals: +- Inspired by Crush, which treats LSP diagnostics as special and injects them deterministically. I.e., we don't have to rely on the model to be attentive to diagnostics on its own. They will get injected whether the model likes it or not. +- The simplest solution would obviously be to just create some tools that allow the model to call out to the LSP. But I don't think that would work, because LSP is stateful. In particular, the LSP spec has a lot to say about document synchronization. To be spec-compliant, a client must alert the server when it has opened, closed, or edited a document. Otherwise, the server might report inaccurate diagnostics. Therefore, the agent's basic operations, like "view," "edit," and "grep," must be LSP-aware. +- By re-implementing core tools like these in an MCP, we also solve the first problem, since we know that agents will reliably call tools like this. diff --git a/src/mcp/tools/read.rs b/src/mcp/tools/read.rs index 381bd152787d7ebb2602e7158af55b88589ecacf..b8d8761a728549e3aa32edea0fb1cd6a70ec972d 100644 --- a/src/mcp/tools/read.rs +++ b/src/mcp/tools/read.rs @@ -7,11 +7,10 @@ use async_lsp::lsp_types::{ }; use rmcp::ErrorData as MCPError; use rmcp::{ - handler::server::wrapper::Parameters, model::CallToolResult, schemars, serde_json, tool_router, + handler::server::wrapper::Parameters, model::CallToolResult, schemars, serde_json, }; use crate::mcp::*; -use rmcp::ServerHandler as MCPServerHandler; #[derive(Debug, serde::Deserialize, schemars::JsonSchema)] pub struct ReadToolArgs {