Scratch Notebook MCP keeps your AI assistant grounded. It offers named scratchpads, typed cells, validation, namespaces, and semantic search so ideas stay organised inside any MCP-enabled workspace.
- Context that sticks – Give each scratchpad a friendly title, description, and summary so future prompts surface the right work instantly.
- Reliable content – JSON, YAML, Markdown, and popular code snippets are checked automatically, helping your assistant hand back ready-to-use artefacts.
- Tag-aware organisation – Namespaces and tags keep related pads together, so your assistant can filter lists or reads to exactly what matters now.
- Semantic recall – Vector search highlights past notes that sound like today’s problem, giving your assistant instant inspiration.
-
Ensure
uvis available (Claude Desktop and most MCP runtimes ship with it). -
Add the server to your MCP client configuration. Here is the canonical Claude Code layout (adjust paths or flags for your setup):
{ "mcpServers": { "scratchpad": { "command": "uvx", "args": [ "--from=git+https://github.com/ehlowr0ld/scratch-notebook-mcp", "scratch-notebook", "--storage-dir", "${workspaceFolder}/.scratch-notebook/data" ], "env": { "SCRATCH_NOTEBOOK_ENABLE_STDIO": "true", "SCRATCH_NOTEBOOK_ENABLE_HTTP": "false", "SCRATCH_NOTEBOOK_ENABLE_SSE": "false" } } } } -
Reload your assistant and invite it to run tools like
scratch_create,scratch_read, orscratch_search.uvxinstalls the package automatically the first time it is needed.
The defaults favour a single assistant on your local machine over stdio. If you want to share the server with additional assistants or another host, enable HTTP/SSE and secure them with bearer tokens:
--enable-http true --enable-sse trueswitches on the network transports while stdio stays available.- Repeat
--auth-token principal:tokento register assistants; each request must send the matchingAuthorization: Bearer <token>header. --auth-token-file <path>and--config-file <path>capture the merged settings on disk so you can drop most CLI flags later.--enable-metrics trueexposes a Prometheus stream at/metrics(or--metrics-path) on the HTTP listener. Metrics require--enable-http true, though SSE can remain on or off.
Other handy switches:
--storage-dir <path>keeps all scratchpad data under a directory you control (defaults to./scratch-notebookrelative to where you start the server).--max-scratchpads,--max-cells-per-pad, and--max-cell-bytescurb runaway sessions.- Time-based knobs (
--preempt-age,--preempt-interval,--validation-request-timeout,--shutdown-timeout) accept15s/10m/24hstyle strings; omit the suffix to fall back to the documented default units. - Semantic search settings (for example embedder selection or prebuilt indexes) share the same configuration surface; your assistant will honour them automatically.
- Create and curate –
scratch_createopens a new pad (optionally seeding it with acellsarray that persists atomically),scratch_deleteremoves it, andscratch_listshows every pad with lean metadata so assistants can jump to the right one.scratch_list_cellspeeks at cell summaries without fetching full content, and write responses themselves already stick to structural data (ids/indices/metadata) so you can stay within token budgets—callscratch_readwhenever you need the full payload. - Edit with guardrails –
scratch_append_cellandscratch_replace_cellextend notebooks cell by cell. Set thevalidateflag when you want the server to run JSON/YAML/code/markdown checks before content is saved; validation is advisory only, your notes are never discarded because of diagnostics.scratch_replace_cellalso acceptsnew_indexso you can reorder a cell while updating it. Write responses mirrorscratch_createby omitting rawcontent; follow up withscratch_readif the assistant needs to re-display the entire cell. - Review and filter –
scratch_readreturns the full pad and lets agents filter bycell_ids, tags, or namespaces. Indices are still returned in responses so you can display ordering, but edits and validations always target cells bycell_id.scratch_list_tagssurfaces the tag vocabulary, andscratch_list_schemas+scratch_get_schemareveal shared schema helpers. - Validate on demand –
scratch_validatere-checks any subset of cells (supplycell_ids, or omit to validate all), returning structured results so assistants can highlight issues without changing stored content. Indices still appear in responses for reference, but selectors must always becell_ids. - Search and navigate –
scratch_searchuses semantic embeddings to find related notes. Namespace helpers (scratch_namespace_list/create/rename/delete) keep multi-project work segregated. - Schema registry –
scratch_upsert_schemalets assistants register JSON Schemas once and reference them from future cells viascratchpad://schemas/<name>; missing schemas simply produce validation warnings.
Contributor notes, architecture decisions, and testing instructions live in DEVELOPMENT.md. Agent-facing prompts and workflow guidance live in AGENTS.md.
Before tagging a build or publishing a new binary, run the coverage gate and record any lingering gaps:
python -m coverage run -m pytest
python -m coverage report -mTreat uncovered advisory-validation branches as action items—log them in specs/001-scratch-notebook-mcp/implementation.md and schedule new tasks in specs/001-scratch-notebook-mcp/tasks.md so future releases stay honest about validation guarantees.
Current release: v0.1.0 — see CHANGELOG.md for the detailed history. This repository remains unpublished; consult the owner before redistributing.