cortex-mcp
Skill15 starsChanged 5 months agoApache-2.0View on GitHub
Cortex MCP server — vault_read, vault_write, vault_search, vault_feedback, and other tools. Use for MCP clients, Claude Desktop, Cursor MCP, streamable HTTP.
- Reads credentials
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cortex-apiSkill
- cortex-authSkill
- cortex-compilerSkill
- cortex-contributingSkill
- cortex-deploySkill
- cortex-feedbackSkill
- cortex-graph-searchSkill
- cortexSkill
- cortex-vaultSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
Use MCP tools for agent workflows.
- Very specific: line 71
Follow checklist in cortex-contributing: handler → http_server.py + server.py → tests → update reference + README.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cortex MCP
Transports
| Mode | How | Config |
| HTTP | http://localhost:8420/mcp/ | CORTEX_MCP_TRANSPORT=http, Docker or scripts/serve.py |
| stdio | Claude Desktop subprocess | CORTEX_MCP_TRANSPORT=stdio |
HTTP uses FastMCP streamable HTTP (stateless_http=True, JSON responses).
Authentication
AUTH_METHOD | MCP behavior |
none | Open |
apikey | x-api-key header must match API_KEY / CORTEX_API_KEY |
oidc | FastMCP OIDCProxy (browser login); API key fallback if configured |
REST uses AuthMiddleware; MCP uses ApiKeyGuardMiddleware when apikey. See cortex-auth.
HTTP session flow
POST /mcp/—initialize(JSON-RPC 2.0)- Save
mcp-session-idresponse header if present notifications/initializedtools/callwithnameandarguments
Header: Accept: application/json, text/event-stream
Implementation map
| Layer | File |
| Tool handlers (shared with REST logic) | cortex/mcp/tools.py |
| HTTP tool registration | cortex/mcp/http_server.py |
| stdio server | cortex/mcp/server.py |
| Mount on FastAPI app | mount_mcp_on_app() in http_server.py |
Handlers receive injected services: vault_path, graph, qmd, qmd_debounce, compiler.
Cursor integration
This project may register a local MCP server (e.g. user-cortex_local) pointing at http://localhost:8420/mcp/ with x-api-key when auth is enabled.
Use MCP tools for agent workflows; prefer vault_context for RAG-style retrieval.
Tool list
See reference.md for all 10 tools (including
vault_resource_read), parameters, and return shapes.
MCP resources (cortex://resource/{id})
Token-heavy tool outputs can be opted into the server-side resource
store via as_resource: true on vault_search / vault_context
(and GET /api/v1/search?as_resource=true on REST). The store is
in-memory, TTL-bounded, and LRU-capped; tune with
CORTEX_RESOURCE_TTL_SECONDS and CORTEX_RESOURCE_MAX_ITEMS. See
reference.md for details.
Adding a tool
Follow checklist in cortex-contributing: handler → http_server.py + server.py → tests → update reference + README.
Related skills
- REST mirror:
cortex-api - Deploy/local URL:
cortex-deploy
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

