Build Your Own MCP Server · 30 min · Python · MCP Python SDK (FastMCP) · SQLite
Your First MCP Tool
A FastMCP tool is a Python function with a decorator — the protocol plumbing is the SDK's job, not yours.
Hiring signal: This is the exact pattern used to give Claude Code, Cursor, and any MCP-aware tool access to systems that don't have one — a database, an internal API, a proprietary format. It's the modern equivalent of 'I can write a REST endpoint.'
What you will learn
- Set up a FastMCP server project with uv
- Write a tool with a clear docstring/description and typed parameters
- Register the server with Claude Desktop and verify it end to end
Introduction
Last lesson you watched someone else's MCP server work. Today you write your own — one tool, a SQLite database query, registered with Claude Desktop and answering real questions in a real conversation by the end of this lesson.
Project setup
uv init mcp-toolkit && cd mcp-toolkit
uv add "mcp[cli]" httpx
mcp[cli] pulls in FastMCP, the high-level API this course uses throughout — it's part of the official SDK, not a separate project you have to evaluate and choose. The [cli] extra also gives you mcp dev, which runs your server against the MCP Inspector (a debugging UI you'll use properly in Lesson 6, but it's worth knowing it exists from day one).
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The anatomy of a FastMCP tool, Wire in the real SQLite tool, Register it and actually use it, What You're Building — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy