knowledge-library-mcp
An MCP server for browsing and searching a knowledge library, drafting notes/projects, and saving changes to Git only on explicit approval.
List the six canonical areas and active projects.
Full-text search notes, optionally scoped to permanent/guidance areas.
Read notes by path, list permanent notes per area, and fetch guidance by topic.
Create notes of kinds fleeting, literature, permanent, guidance, or project without overwriting; update existing notes.
Append timestamped entries to today's fleeting note.
Inspect uncommitted changes via parsed git status.
Save changes by staging, committing, rebasing onto origin/main, and pushing only when the user explicitly approves.
README also documents teaching and book-lesson-plan tools plus add_quote, though these are not in the provided schema.
Provides an explicit-save workflow that stages, commits, and pushes the knowledge library's changes to a Git repository.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@knowledge-library-mcp search my notes for MCP server setup guidance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
knowledge-library-mcp
MCP server exposing the knowledge-library (notes, guidance, projects, search, plus explicit-save write tools) to Claude clients.
Run locally
uv sync --extra dev
KNOWLEDGE_LIBRARY_ROOT=~/code/knowledge-library uv run python -m knowledge_library_mcp --selftestRelated MCP server: secondbrain-mcp
Run tests
uv run pytest
uv run ruff check src tests scriptsThe tests need ripgrep (rg) on PATH. They run against the fixture library in
tests/fixtures/library/, not against real notes.
Configuration
The server resolves the library root by:
KNOWLEDGE_LIBRARY_ROOTenvironment variable, if set.Otherwise, the directory three levels above
server.py. That default dates from when this code lived inknowledge-library/mcp-server/; outside that layout, set the variable. The ingress VM sets it to its clone,/opt/knowledge-library.
Tools exposed
See src/knowledge_library_mcp/server.py. Spec: kennyrnwilson/knowledge-library → docs/superpowers/specs/2026-05-08-mcp-knowledge-platform-design.md § 6.2.
Teaching tools
teach_start, list_lessons, get_lesson, write_teach_file and edit_teach_file
let a chat with no skills of its own (claude.ai, for example) run Matt Pocock's
teach skill. The workspace is 05-projects/<project>/teach/; the project must
already have a README.md. teach_start returns the skill's instructions, from
the vendored copy in src/knowledge_library_mcp/teach_skill/,
plus the workspace's state. The write tools accept .html, .css, .js, .svg
and .md files inside the workspace only, and like the other write tools they
never commit.
Book lesson plans
save_lesson_plan is how the
reading app turns a book into a
course. It writes one section of 05-projects/<book-slug>/teach/PLAN.md: a
## <chapter> section for a chapter, or ## Whole book. Saving the same
section again replaces it, and the other sections stay.
The first call for a book creates the course:
the project
README.md, linked to the book in book-library, and a row in05-projects/README.md;teach/MISSION.mdfrom the reader'swhy, which that first call requires;teach/RESOURCES.md, with the book and its reading-app link, andteach/NOTES.md;teach/assets/, copied from theuse-the-systemworkspace, so lessons get the course stylesheet, the quiz and the Recall marking.
A project of the same name that does not link to the book is refused. The tool
returns every path it wrote, which the caller passes to save_changes.
PLAN.md is a state file like MISSION.md: teach_start returns it, and the
chat preamble tells the teacher to write the first lesson in the plan that is
not yet a link, then link it. So "teach me the next lesson in the
<book-slug> project" works through a book from its plan.
Explicit-save model
Write tools (create_note, update_note, append_fleeting, add_quote, write_teach_file, edit_teach_file) only touch disk. They never commit. The save_changes tool stages, commits, and pushes. The LLM must only call save_changes when the user explicitly approves ("save it", "commit that", "looks good").
Staying in step with main
knowledge-library's sync-to-vm.yml fast-forwards the server's clone on every
push to main. That isn't enough on its own: it runs only on a push, and its
--ff-only pull stops working once the clone holds a commit that an earlier
save_changes failed to push. Two things here cover the gaps, and both act only
when main is checked out:
Before each tool call,
refreshrunsgit pull --ff-only origin main, at most once every 30 seconds, with a 15-second timeout. A failed pull is not an error: the call goes ahead on what is on disk.save_changescommits, fetches, rebases ontoorigin/main, then pushes. A conflict aborts the rebase and leaves the commit local, with an error that says so. A commit stranded by an earlier failed push goes out with the nextsave_changes, even when there is nothing new to commit.
Deployment
This repo is the source of truth for the server. (It used to be a mirror of
knowledge-library/mcp-server/; that subtree and its sync were removed on
2026-10-17.) The knowledge content stays in the private knowledge-library repo.
.github/workflows/deploy-vm.yml runs lint, the tests and the selftest on every
pull request and push. On a push to main, it then runs personal-portal's
deploy/ingress-vm/knowledge-library-mcp.sh install inside the ingress VM, on
the Mac Mini's self-hosted runner. That installs dependencies pinned by uv.lock
and restarts the knowledge-library-mcp systemd unit (port 5103, behind
gateway.kennyrnwilson.com/mcp/knowledge).
Available Tools
11 toolsappend_fleetingB
Append a timestamped block to today's 01-fleeting-notes/YYYY-MM-DD.md. Lowest-friction capture.
Inputs: content (required). Returns: result
create_noteA
Create a new note. Returns relative path. Refuses to overwrite.
kind: fleeting | literature | permanent | guidance | project area_or_path: required area name for permanent/guidance; optional sub-path for others.
Inputs: kind (required), title (required), content (required), area_or_path (required). Returns: result
get_guidanceA
Return the markdown of 04-guidance/<area>/<topic>.md for the first matching area.
Inputs: topic (required). Returns: result
get_noteA
Return the markdown content of a note by relative path.
Inputs: path (required). Returns: result
list_areasB
The six canonical areas of the knowledge library.
Inputs: no named parameters. Returns: result
list_pending_changesA
Return uncommitted changes in the knowledge-library (parsed git status).
Inputs: no named parameters. Returns: result
list_permanent_notesA
List all permanent notes within one area.
Inputs: area (required). Returns: result
list_projectsA
List active projects (directories under 05-projects/ containing a README.md).
Inputs: no named parameters. Returns: result
save_changesA
Stage all changes, commit, push origin main.
ONLY call this tool when the user has explicitly approved the change ("save it", "commit that", "looks good, push it"). Drafts iterated in chat without explicit approval should remain uncommitted on disk.
Inputs: message.
search_notesB
Full-text search across the library. Optional area scopes to permanent/guidance for that area.
Inputs: query (required), area. Returns: result
update_noteA
Overwrite an existing note. Refuses if path doesn't already exist.
Inputs: path (required), content (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool maps to a distinct resource and action: areas, note content, searches, projects, and git operations are cleanly separated. Even the retrieval tools differ clearly by path-based access, guidance-specific lookup, and area-scoped listing.
All tools follow a consistent snake_case verb_noun pattern: list_* for collections, get_* for single items, create/update/append for mutations, and save/list for git workflow. The naming makes the tool set predictable and easy to navigate.
11 tools is well-scoped for a knowledge library covering capture, search, retrieval, editing, project listing, and git persistence. Each tool serves a clear purpose without redundancy or bloat.
The surface covers create, read, update, search, capture, project listing, and git commit/push workflows. Missing delete/archive and a general list-all-notes operation are workable gaps, but they may be intentional for a permanent knowledge base.
Maintenance
Related MCP Connectors
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Notes, tasks, habits, journal and 6 more tools Claude can read and change, with undo. Free.
A second brain for Claude: remembers your work, plans your day, encrypted under a key only you hold.
Search, read, cite, create, and safely update a user's private KeepFlash knowledge library.
Related MCP Servers
- FlicenseAqualityDmaintenanceExposes a clinic's knowledge base and structured records to Claude Desktop as callable tools, with read tools grounded with citations and write tools gated behind approval.4-
- FlicenseNot gradedqualityDmaintenanceEnables Claude clients to search, read, and write to a Markdown second brain vault via GitHub, with tools for retrieval, capture, and knowledge graph consistency.-
- AlicenseAqualityCmaintenanceEnables a shared persistent knowledge vault for Claude Desktop, allowing notes to be saved, retrieved, searched, updated, and deleted across Chat and Code tabs.565 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to read and search a local Markdown knowledge base and past session transcripts, and write distilled notes back into it over MCP.1Functional Source , Version 1.1, MIT Future