MCP server examples and build guides
A minimal MCP server is about ten lines: define a function, decorate it as a tool, run it over stdio. Every guide in this section starts from working code rather than architecture diagrams, because the protocol is not the hard part.
What is hard: writing tool descriptions the model actually understands, keeping the tool count low enough that the client can reason about them, and handling failure in a way that tells the agent what to do next instead of dumping a stack trace into the context window.
The build guides below go from a first server to a tested, deployed one — and are honest about when you should not build at all, because a server for your use case already exists.
The quality of your tool descriptions determines whether the model calls your tools correctly. Spend more time there than on the transport.
17 articles
Xcode MCP Setup: Connect Apple's Built-In Bridge Before Adding 82 Tools
Start with Xcode’s built-in MCP bridge: enable external-agent access in Xcode, run xcrun mcpbridge, keep the intended project open, and verify project context plus a build. Add XcodeBuildMCP only when you need broader simulator, test, preview, or UI-automation workflows. This establishes a known Xcode baseline before expanding the tool surface.
MCP Error -32603: How to Find the Real Internal Error
Error -32603 is a wrapper, not a diagnosis; the useful evidence is in the server stderr, transport response, or exception that the client hid.
MCP Error -32602: Fix Invalid Params Without Guessing
Error -32602 means a known method rejected the request shape; inspect the exact schema and error data instead of randomly renaming fields.
MCP Error -32001: Fix Request Timed Out at the Right Layer
A request timeout says the client stopped waiting; prove whether the server was slow, silent, blocked, or already dead before extending the deadline.
MCP spawn npx ENOENT: Fix PATH on macOS, Windows, and Linux
spawn npx ENOENT means the MCP client cannot locate the executable it was told to launch; the server package has not started yet.
MCP initialize EOF: Find Why the Server Exits Before Handshake
initialize EOF means the client reached the server process or stream, but it closed before returning a valid initialize response.
Unknown MCP Tool: Refresh Discovery Before You Change Code
Unknown MCP tool means tools/call reached a server that does not currently advertise the exact requested tool name.
MCP Error POSTing to Endpoint: Diagnose 401, 404, 400, and 500
Error POSTing to endpoint is a transport wrapper; the HTTP status and response body decide whether to fix auth, URL paths, protocol headers, or the server.
Create an MCP Server: The 20-Minute Path
Build one useful local tool first, verify the protocol boundary, and delay remote complexity until the server earns it.
How to Build an MCP Server in Python
A working Python MCP server is about fifteen lines — here's the whole path from empty file to a tool your agent calls.
How to Build an MCP Server in TypeScript
Roughly 60 lines gets you a working stdio server. Here's the exact SDK, the tool shape that matters, and the parts most tutorials get wrong.
How to Test an MCP Server Before You Ship
The Inspector, real tool calls, and a CI smoke test — the three checks that catch what a demo won't.
How to Deploy an MCP Server (Remote, Step by Step)
Taking a local server remote is three decisions — transport, auth, host — and most people over-think all three.
How to Build an MCP Server in Java
Two real paths to a Java MCP server — the raw official SDK and Spring AI — plus the transport and tool-count decisions that actually bite.
Running an MCP Server in Docker: Config & Gotchas
Most MCP servers don't need Docker — here's when a container actually earns its keep, and the config that works the first time.
What is an MCP server? A practical guide
The plain-English version: what an MCP server is, why it exists, and how to go from 'never used one' to a working setup — with the trade-offs nobody mentions.
How to add an MCP server to Claude, Cursor & Windsurf
Three moves in every client: get the config, paste it in the right file, restart. Here are the exact paths — and why 'it's not working' is almost always one of four things.
FAQ
How long does it take to build a basic MCP server?
Roughly twenty minutes for a working one. Install the Python or TypeScript SDK, write a function, decorate it as a tool, run it over stdio, and add it to your client's config. The protocol plumbing is generated for you — the SDK handles JSON-RPC framing and schema generation.
Python or TypeScript for an MCP server?
Either — both SDKs are official and feature-complete. Choose Python if your logic already lives in Python libraries, TypeScript if you plan to ship over npx so users can run it with no install step. The npx distribution path is the main practical difference.
Should I build a server or use an existing one?
Check the directory first. If a maintained server already wraps the API you need, using it beats building one — you inherit its bug fixes and API-change handling. Build when your use case is internal, your data is proprietary, or the existing option is abandoned.
Other topics
Looking for a server rather than an article? Best MCP servers by task