README thoughts and reflections

Phillip Davis created

Change summary

README                | 4 ++++
src/mcp/tools/read.rs | 3 +--
2 files changed, 5 insertions(+), 2 deletions(-)

Detailed changes

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.

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 {