Fundamentals

Build Your First MCP Server (Official Quickstart Path)

How to build a first MCP server using official Model Context Protocol docs and SDKs — tools, stdio logging rules, Claude Desktop config, and links to complete weather-server tutorials.

10 min read Published July 14, 2026 Updated July 14, 2026

This page points you at official first-server guidance and summarizes the non-negotiables from those docs. For copy-paste full code, use the official tutorial and sample repos — they are maintained with the SDKs.

Start here (official)

  1. Build an MCP server — weather server (get_alerts, get_forecast) for Python, TypeScript, Java, Kotlin, C#, Ruby, and more
  2. SDKs — official language SDKs and tiering
  3. Understanding MCP servers — tools / resources / prompts
  4. MCP Inspector — test and debug servers

Complete sample code (linked from the official tutorial):

What you will build

Per the official quickstart narrative:

  • An MCP server that exposes tools
  • Connection from a host (Claude for Desktop in the tutorial)
  • Usually stdio transport for the first local run

Core capabilities servers can provide (official tutorial):

  1. Resources — file-like data clients can read
  2. Tools — functions the LLM can call (with user approval patterns in hosts)
  3. Prompts — pre-written templates

The weather tutorial focuses on tools.

Official SDKs (check live tiers)

From SDKs (verify on that page — tiers can change):

SDKTier (as documented on the SDKs page)
TypeScript, Python, C#, GoTier 1
Java, RustTier 2
Swift, Ruby, PHP, KotlinTier 3

Repos: SDK tiering.

Typical packages (from the official build guide)

  • Python: mcp[cli] via uv add "mcp[cli]" httpx — uses FastMCP in the weather example; Python 3.10+, MCP Python SDK 1.2.0+ per that page
  • TypeScript: @modelcontextprotocol/sdk + zodMcpServer + StdioServerTransport; Node 16+ per that page

Always follow the version pins in the current tutorial.

Critical stdio rule (official)

From Build an MCP server:

TransportLogging rule
STDIONever write application logs to stdout — it corrupts JSON-RPC
HTTP-basedStandard output logging is fine for HTTP responses

Examples from the docs:

  • TypeScript: use console.error, not console.log
  • Python: print(..., file=sys.stderr) or logging to stderr

This matches the stdio transport specification: only valid MCP messages on stdout.

Local host configuration (Claude for Desktop)

The official tutorial configures Claude for Desktop via mcpServers in:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Shape (stdio): command + args launching your server process (e.g. uv run weather.py or node …/build/index.js). Use absolute paths. Restart Claude for Desktop after edits.

Official client connection guides:

Verification checklist (protocol-level)

Before calling a server “done”:

  1. Lifecycle initialize succeeds (lifecycle)
  2. tools/list returns your tools (tools spec)
  3. tools/call succeeds for a happy path
  4. Prefer the MCP Inspector for structured debugging

From first server to production

Official local tutorials stop at desktop/stdio. For a shared remote URL:

  1. Prefer Streamable HTTP for new remote servers (transports 2025-11-25)
  2. Package as Git / image / package for your host
  3. On MCPLambda, add mcplambda.yaml for Git builds and deploy via Getting Started

See package for production and production-ready with mcplambda.yaml.

Worked scenario: First tool, then first remote

You follow the official weather-server tutorial with stdio and Claude Desktop. get_alerts works. Next you try to “share it with the team” by emailing your absolute path config—chaos.

You treat the tutorial as phase one. Phase two: env-based config, Streamable HTTP or a managed host, auth, and a real smoke test. You keep using official SDKs and never console.log on stdio.

The win is not a clever framework; it is a boring, tested tool that hosts can call.

Checklist for this topic

  • Complete official quickstart for your language
  • Verify tools/list and tools/call locally
  • Respect stdio logging rules
  • Use official SDKs from the SDKs page
  • Only then package for remote/shared use
  • Add auth before sharing a URL

Topic-specific failure modes

FailureLikely causeFix
Stdout breaks serverconsole.log/printstderr logging
Cannot share with teamstdio-onlyRemote transport or managed host
Wrong SDK versionCopy-paste from old blogsFollow current official tutorial
Tools not showingHost config path wrongAbsolute paths; restart host

Transports · Package for production · Official build guide

In practice: definition of “done” for v0

  • Official tutorial path works on your machine
  • tools/list shows your tool
  • One host can invoke it
  • README lists env vars
  • No secrets in repo
  • You know the next step to remote/share

v0 is learning. Production is a later checklist.

After the tutorial: three good next tools

  1. A pure function tool (calculator/time) — proves plumbing
  2. A read-only HTTP GET wrapper — proves secrets/env
  3. A write tool with confirmation — proves safety UX

Do not start with “automate the entire company.”

Takeaways

For Build Your First MCP Server (Official Quickstart Path), remember three things:

  1. Be specific to this problem — the worked scenario “First tool, then first remote” is the failure mode you should design against, not a generic outage narrative.
  2. Ship one boring tool first — prove tools/list and one tools/call before packaging or hosting.
  3. Follow the official SDK quickstart in your language, then package for remote with a pinned artifact.

If you only remember one habit: do not mark a hello-world server done until a host other than your terminal can list and call the tool.

Sources

Next steps

Complete the official weather tutorial in your language, then package and deploy when you need a remote endpoint.

FAQs

Frequently Asked Questions

  • Where is the official first-server tutorial?

    The official guide is Build an MCP server on modelcontextprotocol.io. It walks through a weather server with get_alerts and get_forecast tools in Python, TypeScript, and other languages, then connects Claude for Desktop via stdio.

  • Which SDKs are official?

    The official SDKs page lists language SDKs with a tier system. TypeScript, Python, C#, and Go are listed as Tier 1 as of the current docs page; Java and Rust Tier 2; others lower tiers. Always check modelcontextprotocol.io/docs/sdk for the live table.

  • Why can’t I use console.log in a stdio MCP server?

    The official build-server tutorial states that for STDIO-based servers, writing to stdout corrupts JSON-RPC messages. Use stderr (e.g. console.error in TypeScript, print(..., file=sys.stderr) or a logging library that targets stderr in Python).