Skip to content
Back to full roadmap
topiccore

MCP Server Development (Python/TS)

MCP server from scratch: expose tools + resources + prompts. 100 lines with the SDK.

5 hours2 resources1 prereqs

An MCP server exposes 3 primitives:

  1. Tools — functions the agent can call (like function calling)
  2. Resources — file/URL-like readable resources (e.g. postgres://db/table)
  3. Prompts — recommended prompt templates for the user

Python SDK example:

from mcp.server.fastmcp import FastMCP
mcp = FastMCP("weather-server")

@mcp.tool()
def get_weather(city: str) -> str:
    """Get current weather for a city."""
    return f"Sunny, 22°C in {city}"

if __name__ == "__main__":
    mcp.run()

Add to Claude Desktop config: {"weather": {"command": "python", "args": ["server.py"]}} and start using.

What you'll gain

You can write an MCP server for your own use case and use it with Claude Desktop/Cursor.

Prerequisites

Resources(2)