An MCP server is a small program that exposes tools, resources and prompts to an AI host, such as Claude for Desktop or an IDE agent, over the Model Context Protocol. The host lists what the server can do, the model proposes a tool call, and (in a well-built client) you approve it before anything runs.
This is a beginner's walkthrough of that server side, from the official MCP docs. You'll scaffold a Python server with the official SDK, add a tool and a resource, run it over stdio, and hook it up to a desktop host.
I have not published a new production server for this post. The APIs and the setup steps come from the official "Build an MCP server" tutorial and the SDK pages.
If the protocol itself is still fuzzy, start with my plain-English guide to what MCP is. This post is the "how do I build one" follow-up.
Some links are affiliate links; they don't change your price.

What does an MCP server actually do?
The official docs split a server's job into three capabilities:
- Tools: actions the model can invoke, usually with your approval, such as "look up a note" or "fetch a forecast".
- Resources: read-only data the client can list and attach as context, such as a file, a config, or a report.
- Prompts: pre-written templates the user can run, to start a task the same way each time.
Tools are model-controlled, and resources are application-controlled. That difference matters: a tool is a verb the model asks to run, and a resource is data the client decides to read.
A server talks to a host over a transport. The official beginner path uses stdio: the host starts your process and exchanges JSON-RPC on standard input and output.
HTTP transports exist too, and they're the right next step once you want a remote server. Start with stdio, which is the path the official tutorial uses with Claude for Desktop.
This is also why logging is a trap. The official docs are blunt: on a stdio server, never write to stdout. A print() call corrupts the JSON-RPC stream and the host will look like it "just doesn't see your tools". Log to stderr with the standard logging module instead.
Which official SDK should I use?
MCP publishes official SDKs in several languages. The SDK page current in late November 2026 lists TypeScript, Python, C# and Go as Tier 1, with Java and Rust as Tier 2, and others at Tier 3.
For a first server, pick the language you already write. The official getting-started tutorial is in Python, using the Python MCP SDK 2.0 or newer, Python 3.10+, and the uv package manager.
The TypeScript v2 package is @modelcontextprotocol/server. It implements the 2026-07-28 spec and uses McpServer, registerTool and registerResource.
I'll walk through Python here, because that's the official beginner tutorial's path. The same three ideas, tools, resources and a transport, show up in TypeScript.
You do not need to learn a new agent framework first. If you already use AI coding CLI tools, several of them can act as an MCP host and load a local server the same way a desktop app does.
How do I scaffold a Python MCP server?
The official tutorial starts by installing uv, creating a project, and adding the SDK.
On macOS or Linux, after uv is installed and your terminal has been restarted so the shell can see it:
The docs require Python 3.10 or higher, and Python MCP SDK 2.0.0 or higher. On Windows the flow is the same, with .venv\Scripts\activate and uv add mcp[cli].
Create a server file, for example notes.py. The official pattern is to construct an MCPServer, decorate tools, and run over stdio. Here's a small original server that follows that official API, a personal notes lookup, rather than a copy of the weather tutorial.
A few details from the official docs are doing the real work here:
- MCPServer uses the function's type hints and docstring to build the tool definition the model sees. The "Args" section is how the model learns what title means.
- get_note is async, which matches the official examples.
- logging goes to stderr, never print().
- mcp.run(transport="stdio") is how the host starts the process and talks to it.
The official weather tutorial then has you add real HTTP calls, in their case to the US National Weather Service, with tools named get_alerts and get_forecast. That's a good second exercise once this stub runs, because it forces you to handle network errors and to send a User-Agent. I used an in-memory dictionary so the first run has no API key and no external dependency.

How do I add a resource?
A resource is read-only. The TypeScript v2 docs describe it as data the client lists and reads, then attaches as context. The Python server can expose the same idea.
In the TypeScript SDK, you call registerResource with a name, a URI such as config://app, metadata, and a read callback that returns contents. The Python tutorial's first pass focuses on tools, which is enough to get a host to call you. Once tools work, add a resource for anything the user might attach on purpose, such as a README, a schema, or a static config.
A good rule: if the model should decide to act, make it a tool. (Which model sits on the other side matters too; see how to choose an LLM for an AI agent.) If the user or the host should decide to attach data, make it a resource. Don't hide a destructive action behind a resource read.
How do I test the server locally?
Run the file with uv:
On its own, that process will sit and wait for JSON-RPC on stdin. That's expected. A host has to start it.
The official tutorial's first host is Claude for Desktop. You install or update the app, then edit the config file, creating it if it doesn't exist:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Linux: ~/.config/Claude/claude_desktop_config.json
- Windows: %AppData%\Claude\claude_desktop_config.json
Add your server under the mcpServers key, with the absolute path to the project folder:
The docs warn you may need the full path to the uv executable (which uv on macOS or Linux, where uv on Windows). They also warn that closing the Claude window is not enough: quit the app fully, then reopen, or the new config won't load.
If the tools don't appear, the official checklist is: confirm the JSON is valid, confirm the path is absolute, confirm the process starts by hand, and look at the host's logs. The most common self-inflicted failure on stdio is still a print() statement breaking the stream.

You can also test from an MCP client in code, which is what the TypeScript SDK docs do with an in-memory Client. That's a better fit once you want automated checks. For a first server, a desktop host is the fastest way to see a tool call and an approval prompt.
When you write the tool descriptions, be as specific as you would be in an agent prompt. The docstring is the model's only manual for that argument.
How would this look in TypeScript?
If you'd rather stay in TypeScript, the official v2 server package is @modelcontextprotocol/server. You construct McpServer with a name and version, then registerTool with a Zod input schema and a handler that returns content items.
The SDK derives the JSON Schema the model sees from that one Zod schema, validates arguments before your handler runs, and types the handler from the same schema. registerResource does the equivalent for read-only data, including ResourceTemplate for URI patterns such as users://{userId}/profile.
Transports are documented separately: stdio for local hosts, HTTP with official adapters for Express, Fastify, Hono and Node. Start on stdio here too. Move to HTTP when you have a reason, such as a shared remote server, not because it feels more "production".
The Python and TypeScript paths implement the same protocol. A host that speaks MCP can call either server.
What should I build first, and what should I skip?
Build something you can verify without a paid API, then add a single external call.
Good first tools: look up a record in a local file, return today's date in a given timezone, or fetch a public, documented API that allows your User-Agent. The official weather tutorial is the third kind.
Skip, at least on day one:
- Unrestricted shell or SQL tools.
- Anything that writes to production data.
- Secrets baked into the source. Read them from the environment, and never return them in tool output.
- Logging to stdout on stdio.
- A public HTTP server on the open internet, until you have authentication and an allow-list of tools.

This is the same least-privilege idea I use when I build an AI agent in n8n: give the model a narrow tool, not the keys to the account.
Frequently asked questions
Get a stub server running, with one tool and logs on stderr, before you add a network call. The protocol is the easy part. The hard part is giving the model a narrow, boring tool it can't misuse.
Once that's working, the official weather tutorial is a solid second pass, and my MCP explainer is the concept map to keep next to it.


