I Built an MCP Server in 200 Lines of Go (and Claude Became 10x More Useful) | by Cheikh seck | Jun, 2026 | Dev GeniusSitemapOpen in appSign up<br>Sign in
Medium Logo
Get app<br>Write
Search
Sign up<br>Sign in
Dev Genius
Coding, Tutorials, News, UX, UI and much more related to development
I Built an MCP Server in 200 Lines of Go (and Claude Became 10x More Useful)
Model Context Protocol is the API contract for the AI era. Go is the only language that lets you build one in an afternoon.
Cheikh seck
12 min read·<br>3 hours ago
Listen
Share
I spent two months building Godex , an AI coding agent that lives in your terminal. It works. It ships. People are using it. And in the process, I built something quietly powerful that I didn’t realize I’d built: an MCP server.<br>I’ll admit — I was wrong about MCP. When Anthropic first shipped the spec, I read the docs, nodded, and went back to building Godex the way I was building Godex: a CLI that acted as a tool dispatcher I’d written by hand. I thought MCP was “the standard for connecting Claude to your tools.” That’s true, but it’s the boring reading of it.<br>The interesting reading is this: MCP is the API contract for the AI era, and Go is the language the rest of the world is going to need to learn to write it in. Let me show you what I mean by building one from scratch in 200 lines.<br>By the end of this article, you’ll have a working MCP server with two tools (read_file and run_go), wired into Claude Desktop, ready to extend. The whole thing fits in one file.<br>Press enter or click to view image in full size
Image courtesy of unsplash.comThe mental model: MCP is a lunch menu for your LLM<br>Here’s how I explain MCP to people who haven’t built one yet.<br>Imagine Claude is a friend visiting a new city. You hand them a single laminated card with three things on it: the restaurant name , the menu items , and the rules for ordering . The friend can now order food, but only what’s on the menu, and only by following the rules.<br>MCP is that card. It’s a standardized JSON-RPC contract that says:<br>“Here are my tools” (the menu items)<br>“Here is what each tool expects as input” (the order form)<br>“Here is what each tool returns” (the dish)<br>“If you want to use a tool, send a tools/call message with this schema”<br>That’s it. The LLM agent is the customer. Your server is the kitchen. The protocol is the waiter’s notepad.<br>This is why the spec is so small (about 30 pages) and why implementing it takes a weekend, not a quarter. The hard part was never the protocol — it was deciding what tools to expose and how to describe them well enough that the model picks the right one .<br>The lunch menu metaphor also explains why MCP is winning. Before MCP, every AI tool integration was bespoke: a LangChain agent here, a Vercel function there, a custom OpenAI function schema over there. Every tool was a snowflake. MCP says: pick from the menu. The model does the rest.
Why Go, specifically, for MCP servers<br>There are four reasons I think Go is going to win the MCP server niche. I’ll defend each in one sentence, then we’ll move on to the code.<br>1. Standard library JSON-RPC is one import. MCP speaks JSON-RPC 2.0 over stdio or HTTP. Go’s encoding/json plus a 30-line request dispatcher gives you the whole transport. In Python, you’re pulling in three libraries and praying they don’t drift. In TypeScript, you’re configuring a bundler. In Go, you ship a binary.<br>2. Goroutines make tool calls concurrent for free. When Claude asks “read these 5 files,” you don’t want to do it sequentially. Go’s goroutines + a sync.WaitGroup (or a buffered channel) means you fan out, collect, and return — in maybe 8 lines.<br>3. Single-binary deployment to Claude Desktop is one file. Claude Desktop’s MCP config points at an executable. Go produces one binary. No venv, no node_modules, no version conflicts. Your user double-clicks the .exe, it works.<br>4. The Go dev community is shipping MCP servers faster than anyone else. GitHub’s official github-mcp-server is Go. mcp-grafana is Go. Most of the top-starred MCP servers I see on GitHub trending are Go. This is a place where we already have home-field advantage.<br>If you’re a Go developer reading this in 2026, you’re early. The bar to ship a useful MCP server is shockingly low, and the demand curve is vertical.
The interface first: the Tool contract<br>Here’s the entire shape of an MCP server, expressed as a Go interface. We’re going to teach this contract before we implement it, because once you see it, you can build any tool you can imagine.<br>type Tool interface {<br>Name() string<br>Description() string<br>Schema() map[string]any<br>Run(ctx context.Context, args map[string]any) (any, error)<br>}Four methods. That’s the whole abstraction. Let me explain what each is for, because the protocol literally just shuffles these.<br>Name() — the unique identifier Claude uses to call this tool (e.g., "read_file").<br>Description() — a natural-language sentence that goes into the system prompt. This is the most important line of code...