cd /news/ai-agents/build-an-mcp-server-and-a-language-s… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-161428] src=lspkit.dev β†— pub= topic=ai-agents verified=true sentiment=↑ positive

Build an MCP server and a language server from one Rust engine.

The lspkit project released a Rust framework that serves one code-analysis engine over both the Language Server Protocol for editors like VS Code and the Model Context Protocol for AI coding agents including Claude Code, Cursor and Codex, installable via `cargo add lspkit lspkit-server --features lspkit-server/mcp`. The lspkit framework puts analysis behind a single Rust trait, `EngineApi`, and tags every report with a generation number so the editor and the agent can identify which workspace state produced an answer, avoiding the drift that occurs when two separate pipelines parse the same files. lspkit also ships `lsp-profiler`, a CPU and memory profiler that runs inside VS Code with hot-line highlighting, a flame graph and a live heap timeline that ranks memory leak suspects, already used by SharpLsp for C# and F# and by Osprey for a native functional language.

read2 min views2 publishedOct 31, 2026

Your VS Code extension talks to a language server over the Language Server Protocol (LSP). AI coding agents such as Claude Code, Cursor and Codex talk to tools over the Model Context Protocol (MCP). If you build developer tools, you now need both, and they should give the same answers.

What is an MCP server? #

An MCP server exposes tools and data to an AI agent over a small JSON-RPC protocol. Where a language server answers "what's the type at this cursor?" for an editor, an MCP server answers "find every caller of this function" for an agent. Both need the same thing underneath: a live, accurate model of the code.

The trap: two pipelines #

The obvious build is a language server with its own caches, then an MCP server bolted on with another set. Now two pipelines parse the same files, watch the same folders and drift apart. The agent sees stale results the editor has already fixed.

One engine, two surfaces #

lspkit puts analysis behind one Rust trait, EngineApi. The lspkit-server crate serves it over LSP to VS Code; its mcp feature serves the same engine over MCP to Claude Code, Cursor or Codex.

cargo add lspkit lspkit-server --features lspkit-server/mcp

Every report carries a generation number, so the editor and the agent can both tell which state of the workspace produced an answer. Cancellation and progress live at the same boundary, so a slow query from the agent never blocks the editor.

Find the memory leak before your users do #

Long-running language servers leak. lspkit ships lsp-profiler, a CPU and memory profiler that runs inside VS Code: hot lines painted in your source, a flame graph beside it, and a live heap timeline that ranks memory leak suspects. SharpLsp uses it for C# and F#; Osprey uses it for a native functional language. Watch both on the examples page.

Start building #

── more in #ai-agents 4 stories Β· sorted by recency
── more on @lspkit 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/build-an-mcp-server-…] indexed:0 read:2min 2026-10-31 Β· β€”