Notes MCP server (Python template)
A minimal, complete MCP server built with the official Python SDK v2 (mcp>=2.3,<3, class MCPServer).
- Tools:
add_note,search_notes,delete_note(typed outputs, annotations,ToolErrorfor expected failures) - Resources:
notes://indexand the templatenotes://{note_id} - Prompt:
summarize_notes - Transports: stdio (default) and Streamable HTTP (
--http)
Run
uv sync --extra dev # or: python -m venv .venv && .venv/bin/pip install -e ".[dev]"
uv run notes-mcp-server # stdio
uv run notes-mcp-server --http --port 8000 # Streamable HTTP at http://127.0.0.1:8000/mcp
uv run pytest # 8 tests, including a real stdio subprocess
Set NOTES_FILE=/path/notes.json to persist notes between runs.
Connect
claude mcp add notes -- uv run --directory /absolute/path/to/this/folder notes-mcp-server
Make it yours
- Rename the package (
src/notes_server), the project name inpyproject.toml, and the server name inMCPServer("notes"). - Replace
store.pywith your real logic. Keep it free of MCP imports so it stays easy to test. - Replace the tools in
server.py. Keep docstrings precise: they become the tool descriptions the model reads.