cortex
Provides persistent memory storage and rate limiting using Redis, enabling agents to remember information across sessions and enforce cost budgets.
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., "@cortexSummarize the key points from the ingested documents"
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
Cortex is a reference implementation of an MCP-enabled agent service. It combines a planner/executor/critic graph, hybrid retrieval, scoped memory, multi-provider LLM routing, safety checks, and operational instrumentation behind a FastAPI service.
The repository is tested and has CI quality gates, but it has not served production traffic. The Kubernetes manifests, load profile, evaluation thresholds, and alert thresholds are starting points rather than evidence of production readiness. See Limitations and roadmap.
What is implemented
Authenticated HTTP APIs for asynchronous runs, polling, SSE status updates, document ingestion, and allowlisted MCP tool calls.
A LangGraph flow:
load_memory -> planner -> executor -> critic -> save_memory, including replanning, per-run cost limits, and optional suspension before critique.Five MCP tools:
search_knowledge,query_memory,query_data,synthesise, and disabled-by-defaultexecute_code.Dense Qdrant retrieval plus an in-process BM25 index, reciprocal-rank fusion, and optional Cohere reranking.
Episodic (Redis) and semantic (Qdrant) memory scoped by tenant and user.
LiteLLM routing with retry, fallback, Redis cost accounting, and a tenant-scoped Qdrant semantic cache.
HTTP-run input/output safety checks, Prometheus metrics, OpenTelemetry tracing, structured logs, and Celery tasks.
The authoritative component and flow description is Architecture.
Related MCP server: Agentic Control Framework (ACF)
Local quickstart
Run the hermetic test suite
Python 3.10 or newer is required.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytestThe default suite uses fakes and mocks; it does not require Redis, Qdrant, an LLM key, or network access. See Contributing for every development gate.
Run the local service stack
Docker Compose requires at least one configured LLM provider for real agent runs.
cp .env.example .env
# Set SECRET_KEY and at least one provider key in .env.
docker compose up -d
docker compose ps
curl http://localhost:8000/healthThe local stack exposes the API documentation at http://localhost:8000/docs, MCP over HTTP at http://localhost:8001/mcp, Phoenix at http://localhost:6006, Grafana at http://localhost:3000, Prometheus at http://localhost:9090, and Qdrant at http://localhost:6333/dashboard. These ports are development defaults, not a hardened deployment.
Create a local token and submit a document and run:
export TOKEN="$(python3 scripts/gen_token.py --user-id dev-user --tenant default)"
curl -X POST http://localhost:8000/api/v1/ingest \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{"text":"Cortex uses a planner, executor, and critic.","metadata":{"source":"quickstart"}}'
curl -X POST http://localhost:8000/api/v1/runs \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{"goal":"Summarise the quickstart document"}'The run response contains a run_id; poll
GET /api/v1/runs/<run_id> with the same bearer token. Complete deployment,
configuration, metrics, and incident procedures are in
Operations.
Documentation map and ownership
README.md is the entry point. Each concern below has one canonical document;
other documents link to it rather than restating it. Repository ownership is
defined by CODEOWNERS; the current owner for every entry
is @mrinmoyece. Changes to behavior must update the corresponding canonical
document in the same pull request.
Concern | Canonical document | Primary implementation evidence |
Product scope and quickstart | This README | |
System and AI architecture, flows, state, memory, RAG, tools, safety, cost | ||
Deployment, configuration, SLI/SLO status, observability, and runbooks | ||
Threats, trust boundaries, and security controls | ||
Vulnerability reporting | ||
Evaluation methodology and evidence | ||
Performance methodology and latest local report | ||
Known gaps and planned work | Source and test links within that document | |
Development, testing, and contribution | ||
Major design decisions | The four accepted records in that directory |
Supported entry points
Entry point | Authentication and identity |
FastAPI on port 8000 | JWT bearer token for protected APIs; tenant and user come from token claims |
| JWT-authenticated and restricted by |
Standalone MCP over stdio | Process-local identity may be declared with |
Standalone MCP over HTTP/SSE | No authentication or per-caller identity; do not expose publicly |
Direct Python calls to | Library caller is responsible for safety checks and identity correctness |
Important boundaries
Run state, rate-limit buckets, graph checkpoints, and BM25 state are process-local.
Human review can suspend a run, but this repository has no approval/resume endpoint.
execute_codeis not a sandbox and is disabled by default.Memory and cache isolation rely on application-level payload filters, not separate infrastructure; the RAG knowledge corpus is shared across tenants.
The
WorkingMemorytoken-budget helper exists but is not wired into graph prompt construction.A graph-level budget/iteration guard can end execution without setting a terminal failed status; the LLM router's pre-call budget error is the dependable spend control.
Evaluation contains harnesses and target thresholds, not a validated model quality baseline.
Edge latency is measured in CI; end-to-end load testing has not been run against a production deployment.
Read Limitations and roadmap before using Cortex outside local evaluation.
License and security
Cortex is licensed under the MIT License. Report vulnerabilities privately according to the Security policy.
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.
Related MCP Connectors
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Work management where AI agents are first-class members: tasks, projects, memory over hosted MCP
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn advanced MCP-based AI agent system with intelligent tool orchestration, multi-LLM support, and enterprise-grade reliability features like semantic routing and circuit breakers.MIT
- AlicenseDqualityDmaintenanceAI-native orchestration layer with 80+ tools for task management, code editing, browser automation, terminal control, and persistent memory across CLI, local MCP, and cloud deployments.691531ISC
- AlicenseNot gradedqualityDmaintenanceEnables autonomous orchestration of vector search, knowledge graph queries, and web crawling through a single MCP interface, providing agentic RAG capabilities for AI assistants.7MIT
- AlicenseNot gradedqualityBmaintenanceEnables running durable, traceable AI agents via LangGraph through a universal MCP interface, integrating with Hatchet for orchestration, logging, and retries. Provides tools for knowledge management (ingestion, RAG) and Kubernetes operations (diagnosis, auto-fix).MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/mrinmoyece/cortex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server