How to Build an MCP Server: Step-by-Step Tutorial (2026)
Build your first MCP server in TypeScript in under 30 minutes. Covers tools, resources, prompts & connecting to Claude and Cursor.
Frequently Asked Questions
What is an MCP server?
An MCP server is a small program that exposes tools, resources, and prompts to AI agents using the Model Context Protocol — an open standard created by Anthropic in November 2024. When connected to an MCP-compatible client like Claude or Cursor, the server's tools become callable functions the AI can invoke during a conversation or agentic task.
What languages can I use to build an MCP server?
Anthropic provides official SDKs for TypeScript and Python. The TypeScript SDK is the most widely used (6.9 million npm downloads/week as of 2026). Community SDKs also exist for Go, Rust, C#, Java, and Kotlin.
How long does it take to build a basic MCP server?
Under 30 minutes for a working server with one or two tools. The official quickstart builds a weather server in about 15 minutes. More complex servers with database access, authentication, and error handling take a few hours.
What is the difference between MCP Tools, Resources, and Prompts?
Tools are callable functions that take action or return computed data (like an API call). Resources are read-only data the agent can pull in for context (like a file or database record). Prompts are reusable templates that teach the agent how to use your server effectively.
Can I use an MCP server with any AI agent, or just Claude?
MCP is an open standard and is supported by Claude, Cursor, GitHub Copilot, Windsurf, Zed, Continue, and dozens of other clients. Any MCP-compatible host can connect to your server once it's running.