cortex
Allows agents to write and manage markdown notes in a format compatible with Obsidian, enabling the same vault to be opened in Obsidian for visualization, editing, and graph exploration.
Click on "Install 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., "@cortexsearch for backpropagation"
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.
π§ cortex
A local, Obsidian-compatible second brain for agents.
An agent that re-derives the same facts every session is spending tokens to stay ignorant. cortex gives it a durable, wikilinked knowledge base on disk: it distils what it learns into small interconnected markdown notes, then recalls just enough of them later. Notes link to each other with [[wikilinks]], so the brain becomes a graph you can traverse β backlinks, related notes, hubs, orphans β not a flat pile of memories.
Every note is a plain markdown file in a folder, so you can open the exact same vault in Obsidian and watch the graph grow. Based on Andrej Karpathy's LLM Wiki pattern: compile knowledge once into an interconnected wiki instead of asking the model the same questions over and over.
Part of tools-for-agents. Zero dependencies β Node standard library + built-in node:sqlite with FTS5. The markdown files are the source of truth; the SQLite index is derived and rebuildable at any time.
Why
Without cortex | With cortex |
Re-explain the same architecture every session |
|
Memories are a flat list β no structure | Notes link with |
"What did I decide about X, and what's related?" |
|
Memory locked inside one tool | A folder of markdown you (and Obsidian) fully own and can edit |
Knowledge grows unmanaged |
|
Related MCP server: Obsidian MCP Server
The vault
cortex keeps notes in $CORTEX_VAULT (default ./vault), organised by type β the Karpathy LLM-Wiki layout:
vault/
βββ concepts/ # ideas, frameworks, theories
βββ entities/ # people, orgs, products, tools
βββ sources/ # captured raw material + summaries
βββ synthesis/ # comparisons, analyses, themes
βββ daily/ # timestamped journal, one file per day
βββ notes/ # anything else
βββ .cortex/ # the derived SQLite index (safe to delete & rebuild)A note is just markdown with YAML frontmatter:
---
title: Backpropagation
type: concept
tags: [deeplearning]
---
The algorithm that trains [[Neural Networks]] by propagating error via the
chain rule. Uses [[Gradient Descent]]. #optimizationWrite [[Other Note]] to link and #tags to categorise. Links to notes that don't exist yet are broken links β cortex tracks them as suggestions, and they heal automatically the moment you write that note.
CLI
cortex write "Neural Networks" --type concept --tags ml,ai \
--body "Function approximator. Trained by [[Backpropagation]]. #deeplearning"
cortex write "Neural Networks" --append --body "Modern variants: [[Transformers]]."
cortex capture "raw article textβ¦" --source https://example.com # inbox for later
cortex search "train network error" -k 6 --tag deeplearning # ranked snippets
cortex read "Neural Networks" # full note
cortex links "Neural Networks" --in # backlinks
cortex related "Backpropagation" # graph neighbourhood
cortex suggest "Backpropagation" # notes to link that aren't linked yet
cortex lint # health report: orphans/broken/untagged/stubs
cortex tags | cortex tags deeplearning # tags β notes
cortex graph # hubs, orphans, broken links
cortex daily "shipped the retriever" # journal
cortex sync # re-index after Obsidian edits
cortex serve --port 7800 # live graph web view
cortex statsVault location: $CORTEX_VAULT (default ./vault).
Web view
cortex serve starts a zero-dependency web app at http://localhost:7800 β an interactive, Obsidian-style knowledge graph of your vault: nodes are notes (sized by backlinks, coloured by type), edges are [[wikilinks]]. Hover to highlight a note's neighbourhood, drag to rearrange, scroll to zoom, click a node to read it (with clickable wikilinks), and search from the top bar. It's the same brain your agent writes to β watch it grow.
Want a graph to look at right away? Seed a starter vault (interlinked notes about the toolkit itself):
CORTEX_VAULT=./vault node scripts/seed.js # 12 connected notes, 0 orphans
node src/cli.js serveMCP server (for agents)
{
"mcpServers": {
"cortex": { "command": "node", "args": ["/abs/path/to/cortex/mcp/mcp-server.js"],
"env": { "CORTEX_VAULT": "/abs/path/to/your/vault" } }
}
}Tools
Tool | Use it to⦠|
| Create/update a note β link with |
| Stash raw material (article, transcript, finding) into the source inbox to distil later. |
| Recall what you already know as ranked, token-budgeted snippets β instead of re-deriving it. |
| Read a full note by title / slug / alias. |
| A note's backlinks (in), forward links (out, broken ones flagged), or both. |
| Notes related by direct links, co-citation and shared tags. |
| Notes this one should link to but doesn't yet β weave orphans into the graph. |
| Vault health: orphans, broken links (a to-do list of notes to write), untagged notes, stubs. |
| All tags with counts, or the notes for one tag. |
| Graph health: hub notes, orphans, and broken links worth writing. |
| Most recently updated notes. |
| Append a timestamped line to today's journal β a trail across sessions. |
| Re-index the vault after files change on disk (e.g. edited in Obsidian). |
| Note / link / tag counts, broken links, types. |
A good loop for an agent
Recall first β
cortex_searchbefore solving; you may have already worked this out.Capture raw findings with
cortex_captureas you go.Distil into small
cortex_writenotes, each linking to related concepts with[[β¦]].Connect β check
cortex_graphfor orphans and broken links, and write the missing notes.Journal the session with
cortex_dailyso the next run has a trail.
How it works
Files are truth. Each note is a markdown file with YAML frontmatter; the SQLite index is derived from them and rebuilt by
sync(incremental by mtime). Delete.cortex/any time β it regenerates.Search is FTS5 (
porter unicode61) ranked by bm25, filling snippets up to a token budget (β4 chars/token) β the same discipline aslens, pointed at your brain instead of a codebase.The graph is a link table. Every
[[target]]is resolved to a note by slug, title or alias; unresolved targets are kept as broken links and heal automatically when the target note appears.Slugs are unicode-aware (Turkish and accented titles transliterate to clean ascii filenames).
Obsidian-compatible end to end: open
$CORTEX_VAULTas a vault and the wikilinks, tags and graph view all just work.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tools-for-agents/cortex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server