# PKB — Personal Knowledge Base MCP Server (sample-server)

This directory hosts the **canonical sample server** built across the
*Creating MCP Servers* course. The Python tree (`python/`) is the primary
implementation, grown across lessons 04–10. The TypeScript tree
(`typescript/`) is built in lessons 11–15 and progressively hardened
for production.

## Lesson → expected state map

| Lesson | Tree | State at end of lesson |
|---|---|---|
| 03 | python | skeleton: empty pyproject + empty `pkb/server.py` (no tools). |
| 04 | python | hello-world: 1 `pkb.echo(message)` tool, runs over stdio. |
| 05 | python | `pkb.search(query)` tool with Pydantic schema + error handling. |
| 06 | python | + `pkb.fetch(id)` resource + welcome prompt template. |
| 07 | python | + `pkb.summarize(id)` using sampling. |
| 08 | python | + `pkb.write(title, body)` and composed flows. |
| 09 | python | + auth gate, `pkb.export()` requires OAuth. |
| 10 | python | + structured logging, traces, tests. |
| 12 | typescript | hello-world ported (single tool, stdio). |
| 13 | typescript | + Dockerfile + HTTP+SSE transport. |
| 14 | typescript | + per-user isolation, rate limiting, quotas. |
| 15 | typescript | + threat-model hardening, audit logs. |

## Layout

```
sample-server/
  python/        ← Python implementation (lessons 03-10)
    pyproject.toml
    pkb/
      __init__.py
      server.py
  typescript/    ← TypeScript implementation (lessons 11-15)
    package.json
    tsconfig.json
    src/
      server.ts
```

Plan A delivers only the *skeleton* (near-empty files in both trees).
Real code arrives in Plans B–E.
