Build MCP servers
How to write an MCP server yourself, one language at a time, and how to generate one from an OpenAPI spec when the API already exists. Each guide ends with a working server that a real client can call. Pick a language below.
Build MCP servers
- How to build an MCP server in PythonBuild a small MCP server in Python with the official SDK: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in TypeScriptBuild an MCP server in TypeScript with version 2 of the official SDK and Bun: three tools with zod schemas, stdio and Streamable HTTP, a test client, Claude Code setup, and the Node.js commands for the same code.
- How to build an MCP server in GoBuild a small MCP server in Go with the official SDK: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in RustBuild a small MCP server in Rust with the official SDK: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in C#Build a small MCP server in C# with the official SDK: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in JavaBuild a small MCP server in Java with the official SDK: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in KotlinBuild an MCP server in Kotlin with the official SDK and Ktor: three tools, stdio and Streamable HTTP, a test client, and the setup to use it from Claude Code.
- How to build an MCP server in SwiftBuild a notes MCP server in Swift with the official SDK: three tools, stdio and Streamable HTTP over swift-nio, a test client, and the setup for Claude Code.
- How to turn an OpenAPI spec into an MCP serverGenerate a hosted MCP server from an OpenAPI 3 spec with Statio's mcp-gen: prepare the spec, pick a generation mode, deploy it privately and grant its tools one at a time.
- How to test an MCP server with the MCP InspectorInstall the official MCP Inspector, point it at a Python server over stdio and Streamable HTTP, list its tools, call one, and read a real tool error.
- How to debug an MCP server that won't connectIsolate a failing MCP server with MCP Inspector, then fix the usual causes: stdout output, a missing runtime, dropped env vars, bad URLs, Host checks and 401s.
- What happens when an AI agent has too many toolsDozens of connected MCP servers mean dozens of tool lists. The real costs: context spent on definitions, worse tool selection, and name collisions.