Skip to main content
Glama
pipinho13

MCP Notes Server

by pipinho13
README.md
# MCP Notes Server โ€” Your First MCP Server with Claude (Python)

A beginner-friendly, **fully reproducible** tutorial for building a
**Model Context Protocol (MCP)** server in Python and connecting it to Claude.

The example server is a **personal notes manager**: Claude can create, list,
read, search, update, and delete notes that are saved as Markdown files on your
own computer.

> ๐Ÿ“– **New to this? Follow the complete step-by-step guide in
> [`TUTORIAL.md`](./TUTORIAL.md).** It explains every single command and shows
> the exact output you should see.

---

## What is MCP?

**MCP (Model Context Protocol)** is an open standard that lets AI apps like
Claude talk to external programs. You write a small **server** exposing:

- **Tools** โ€” actions Claude can take (e.g. "save a note")
- **Resources** โ€” read-only data Claude can pull in (e.g. "all my notes")

Claude is the **client**: when you ask it something, it can decide to call your
tools. Build the server once, and any MCP-aware app can use it.

> **Do I need to write a client too?** Usually no โ€” the client is an existing
> app like **Claude Desktop** or **Claude Code**. You only write a server. This
> repo includes an optional `client.py` purely to *show* what a client does
> under the hood; see [`TUTORIAL.md` ยง9](./TUTORIAL.md#9-bonus-write-your-own-client-clientpy).

---

## Quickstart

Requires [**uv**](https://docs.astral.sh/uv/) (the tutorial shows how to install
it). Then, from this folder:

```bash
# 1. Set up the environment (installs Python 3.12 + the MCP SDK, pinned)
uv sync

# 2. Test the server in the visual MCP Inspector
uv run mcp dev notes_server.py
```

To connect it to **Claude Desktop**, add this to your
`claude_desktop_config.json` (use the absolute path from `pwd`):

```json
{
  "mcpServers": {
    "notes": {
      "command": "uv",
      "args": ["--directory", "/ABSOLUTE/PATH/TO/mcp_tutorial", "run", "notes_server.py"]
    }
  }
}
```

To connect it to **Claude Code**:

```bash
claude mcp add notes -- uv --directory "$(pwd)" run notes_server.py
```

Full details, expected output, and troubleshooting are in
[`TUTORIAL.md`](./TUTORIAL.md).

---

## Project structure

| File                 | Purpose                                                        |
| -------------------- | -------------------------------------------------------------- |
| `notes_server.py`    | The MCP **server**: 6 tools + 1 resource                       |
| `client.py`          | Optional standalone MCP **client** โ€” chat with the server from your terminal (no Claude Desktop needed) |
| `pyproject.toml`     | Project metadata, requires Python โ‰ฅ 3.10, depends on `mcp[cli]` and `anthropic` |
| `uv.lock`            | Exact pinned versions of every dependency (commit this!)       |
| `.python-version`    | Pins the Python interpreter to 3.12 for reproducibility        |
| `.env.example`       | Template for your API key โ€” copy to `.env` (git-ignored) and fill in |
| `TUTORIAL.md`        | The complete step-by-step walkthrough                          |
| `.gitignore`         | Excludes the virtual env and your personal notes from git      |

---

## The tools

| Tool                    | What it does                                |
| ----------------------- | ------------------------------------------- |
| `add_note(title, body)` | Create a new note                           |
| `update_note(title, body)` | Replace an existing note's content       |
| `list_notes()`          | List all note titles                        |
| `read_note(title)`      | Read one note                               |
| `search_notes(query)`   | Find notes by title or content              |
| `delete_note(title)`    | Delete a note permanently                   |

Plus a resource, `notes://all`, that returns every note concatenated.

---

## Tested with

- **uv** 0.11.19
- **Python** 3.12.13 (pinned via `.python-version`)
- **mcp** 1.27.2

Because `uv.lock` and `.python-version` are committed, anyone who runs
`uv sync` gets the exact same environment.

---

## License

MIT โ€” see [`LICENSE`](./LICENSE). Use it, fork it, teach with it.

TDQS

A4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool maps to a distinct operation: create, update, list, read, search, and delete. There is no overlap or ambiguity in their purposes.

Naming Consistency5/5

All tools follow a clear verb_noun pattern with the note resource. The only minor variation is pluralization for list_notes and search_notes, but this is consistent with typical collection-returning conventions.

Tool Count5/5

Six tools cover the full lifecycle of a notes domain without redundancy. The count is well-scoped and each tool earns its place.

Completeness5/5

The server provides complete CRUD coverage plus search, with no obvious gaps. Users can create, read, list, update, delete, and find notes effectively.

Maintenance

ActivityInactive
ResponsivenessNo issues