Prompt & Done · MCPMENU

Build the tiny MCP server from the reel and watch Claude use it

Claude can't open your apps by itself. An MCP server hands it a menu of tools (tools/list); Claude writes an order (tools/call with arguments); the server does the real work and sends the result back. This is the exact server we used, 19 lines of Python.

Tested 7 Nov 2026 on a Mac: Claude Code 2.1.319, Python mcp SDK 2.3.0. The "calendar" is a local JSON file standing in for a calendar app.

1 The server (calendar_server.py)

# A tiny MCP server: it offers Claude one tool that reads my calendar file.
import json
from pathlib import Path

from mcp.server.mcpserver import MCPServer

CALENDAR = Path(__file__).with_name("calendar.json")
server = MCPServer("my-calendar")


@server.tool()
def get_events(day: str) -> list[dict]:
    """List the events on my calendar for a weekday, e.g. 'monday'."""
    events = json.loads(CALENDAR.read_text())
    return events.get(day.strip().lower(), [])


if __name__ == "__main__":
    server.run()  # speaks MCP over stdin/stdout

Next to it, calendar.json:

{"monday": [{"time": "09:30", "title": "Dentist"},
            {"time": "13:00", "title": "Lunch with Sam"},
            {"time": "17:00", "title": "Gym"}]}

Uses mcp 2.x (pip install mcp). On the older 1.x SDK the import is from mcp.server.fastmcp import FastMCP and server = FastMCP("my-calendar"); the rest is the same.

2 Add it to Claude Code (this project only)

claude mcp add --scope project my-calendar -- python /full/path/calendar_server.py

Project scope writes a .mcp.json in the current folder; Claude Code asks you to approve it the first time. Then ask: "What's on my calendar Monday?" Claude reads the menu, calls get_events with {"day": "monday"} and answers with your three events.

Remove it again: claude mcp remove --scope project my-calendar.

code.claude.com/docs/en/mcp

3 See the real messages

The JSON on screen in the reel is our real log. To log your own, start the server through a tiny proxy that writes every JSON-RPC line to a file (logproxy.py: spawn the server, copy stdin/stdout line by line, append each line to mcp-log.jsonl). You'll see tools/list, then tools/call with "name": "get_events" and "arguments": {"day": "monday"}, then the result.

4 Why it's safe-ish (and when it isn't)

Claude can only call the tools a connected server offers, and you decide which servers to connect. The official docs call MCP "a USB-C port for AI applications". Anthropic's advice: verify you trust each server before connecting it; servers that fetch outside content can expose you to prompt injection.

modelcontextprotocol.io: What is MCP?