karpathy-mcp
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., "@karpathy-mcpsearch my notes for scaling laws and read the top section"
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.
karpathy-mcp
An MCP server that gives an AI agent fast, read-only access to a local knowledge base of notes: a Karpathy-style Markdown wiki, a mirror of a wiki, or any folder of text documents. Notes are indexed into a single SQLite FTS5 file, so search and reading do not have to walk and open files on every call, which matters on machines with slow file access (antivirus scanning, network drives).
Features
Ranked full-text search (SQLite FTS5, BM25, diacritic-insensitive) with snippets, at section level.
Navigation tools: heading outlines with sizes, reading a single section, listing notes, links and backlinks (
[[wikilinks]]and relative links).Never blocks on the disk: queries are answered from the index; a background rescan keeps it fresh (about a minute behind at most by default). Startup is instant.
Many formats: Markdown, plain text, reStructuredText, Org, AsciiDoc and Word (
.docx) with no extra dependencies.Light and safe: standard library plus the
mcpSDK, one cache file per instance, read-only, path traversal protection.One instance per notes directory: run as many as you need, each with its own name and description.
Related MCP server: repository-runtime
Installation
Requires Python 3.10 or newer (Linux, macOS, Windows). The package is not published on PyPI; install it from a
clone of this repository. The distribution is called karpathy-mcp, the command it installs mcp-markdown.
The recommended way is an isolated tool install, which puts mcp-markdown on your PATH without touching other
Python environments:
git clone https://github.com/simon123h/karpathy-mcp.git karpathy-mcp && cd karpathy-mcp
uv tool install . # or: pipx install .
mcp-markdown --help # check that it worksOther ways to install or run it:
Goal | Command |
Install straight from GitHub (no clone) |
|
Run without installing (needs uv) |
|
Install into the current virtualenv |
|
Develop on the code |
|
Upgrade after |
|
Uninstall |
|
The index is a cache and lives in ~/.cache/mcp-markdown/ (on Windows C:\Users\<you>\.cache\mcp-markdown\).
Use --cache-dir to put it elsewhere. It is created on first start, in the background, and can be deleted at any time.
Connect to a client
Run one instance per notes directory; --name and --description tell the agent what each one contains.
Claude Code:
claude mcp add my-notes -- mcp-markdown --notes-dir /home/me/notes --name my-notesClaude Desktop and other clients use a JSON configuration (Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json
on Windows):
{
"mcpServers": {
"my-notes": {
"command": "mcp-markdown",
"args": [
"--notes-dir",
"/home/me/notes",
"--name",
"my-notes",
"--description",
"Personal engineering notes"
]
}
}
}Use absolute paths for --notes-dir. On Windows write them with forward slashes (C:/Users/me/notes) or escape
backslashes in JSON (C:\\Users\\me\\notes).
If the client cannot start the server, it probably does not see your shell's PATH (desktop apps often start with
a minimal one). Give the absolute path of the executable as command: find it with which mcp-markdown (macOS,
Linux) or where mcp-markdown (Windows). Alternatively let uv launch it, which needs no install step (the first launch is slower while uv builds the
package):
{
"mcpServers": {
"my-notes": {
"command": "uvx",
"args": [
"--from",
"/path/to/karpathy-mcp",
"mcp-markdown",
"--notes-dir",
"/home/me/notes"
]
}
}
}Server logs go to stderr, which most clients write to their MCP log files. Options and details are in the usage guide.
Tools
Tool | What it does |
| Ranked search over note sections; returns |
| Reads a whole note or just one heading section. |
| Heading structure with section sizes. |
| Lists indexed notes, optionally by path prefix. |
| Outgoing links and backlinks of a note. |
| Rescans the notes directory immediately. |
The server also sends the agent short usage instructions, and --description lets you say what a given wiki
contains.
Main options
Option | Default | |
| required | Root directory of the notes |
|
| Server name; also part of the cache file name |
| Tells the agent what the notes are about | |
|
| Where the SQLite index lives |
|
| Maximum age of the index before a background rescan |
| all supported | e.g. |
|
| Skip larger files ( |
Full reference: docs/usage.md.
Documentation
Document | Contents |
Installation, options, client configuration, formats, tool reference, behaviour notes | |
Vision, goals, functional and quality requirements, constraints (req42) | |
Building blocks, runtime view, decisions, risks (arc42) | |
Setup, tests, conventions, recipes for new formats, tools and schema changes | |
How to contribute | |
The original task specification this project started from | |
Apache License 2.0 |
Project layout
src/mcp_markdown/ server.py (CLI + tools), index.py (SQLite index), parsing.py (formats), extract.py (.docx)
tests/ pytest suites
docs/ documentationStatus
Early (version 0.1.0). Covered by unit tests and end-to-end stdio tests (the real server driven by an MCP client over stdio). CI runs them on Linux, Windows and macOS with Python 3.10-3.13 (see the badge above). The server has not yet been used in daily work with a real client or on the Windows machine it was designed for. Known risks and open decisions are listed in architecture.md, section 11 and requirements.md, section 9.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Personal context for every AI: search, read, and write back to your private Markdown library.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Markdown notes and whiteboards your AI agent can read and write.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Claude and Codex to read, write, search, and traverse Markdown notes stored in a self-hosted knowledge base.7 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search, read, and traverse a local knowledge base of Markdown files using full-text search and relationship graph, reducing token usage.MIT
- FlicenseAqualityAmaintenanceEnables agents to run hybrid dense and BM25 search over a local folder of Markdown files, read and write notes, and trigger reindexing as the folder changes. It also injects the most relevant sections into each prompt automatically and runs entirely locally with a bundled embedding model.12-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to semantically search and retrieve content from a local Markdown vault. Provides tools for fetching specific notes and finding related ones via embeddings and wikilinks.MIT