cortrix-mcp
v1.0.0rc2Cortrix MCP Server — expose the Cortrix HTTP API as MCP tools for IDE agents (Claude Code / Cline / Cursor).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
cortrix_health
Check that the Cortrix backend is running and reachable (GET /system/health/live).
cortrix_query
Semantic search (vector + BM25) across one or more namespaces. Args: query: search query text. top_k: number of results to return (default 5). namespaces: target namespaces; single / multiple / ["*"] for all (hard cap 100). Defaults to the configured CORTRIX_NAMESPACE when omitted. rerank: enable reranking of fused results (default True). Partial failures return data + structured_data.namespaces_failed (degraded path).
| Parameter | Type | Description |
|---|---|---|
query * | string | |
namespaces | ||
rerank | boolean | |
top_k | integer |
cortrix_upload
Upload a document for indexing (async; POST /documents -> task_id). Args: content: document content (or base64; use async_upload for large files). namespace: target namespace (uses default if empty). filename: optional original filename. metadata: optional custom metadata. Returns a DocumentTask with task_id; poll cortrix_task_status for progress.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
filename | string | |
metadata | ||
namespace | string |
cortrix_list_documents
List indexed documents in a namespace (GET /documents).
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
namespace | string | |
offset | integer |
cortrix_list_namespaces
List authorized namespaces (GET /namespaces).
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
cortrix_create_namespace
Create a new namespace for data isolation (POST /namespaces).
| Parameter | Type | Description |
|---|---|---|
name * | string |
cortrix_memory_search
Semantic search over conversation memory (POST /memory/search). user_id ownership is enforced server-side (MEM05 isolation).
| Parameter | Type | Description |
|---|---|---|
query * | string | |
namespace | string | |
top_k | integer |
cortrix_log_interaction
Save a conversation turn (user query + assistant response) to memory. Backed by POST /memory/sessions/{session_id}/interactions (memory_routes.cpp): the session id is carried in the URL path; the body holds namespace + query_text + response_text (all required server-side). Append is gated by MEM05 session ownership.
| Parameter | Type | Description |
|---|---|---|
query_text * | string | |
response_text * | string | |
session_id * | string | |
namespace | string |
cortrix_list_interactions
List interactions for a user_id (GET /interactions). Backed by the live GET /interactions route (observability_routes.cpp); per-NS storage, so the namespace selects the store (sent as namespace_id). ``filter`` is a convenience sub-object whose whitelisted keys (session_id / namespace_id / from_ts / to_ts / sort_order) are flattened onto the HTTP query string, since the backend reads them as flat params (from_ts -> from_timestamp, to_ts -> to_timestamp). Out-of-whitelist keys are dropped here rather than sent.
| Parameter | Type | Description |
|---|---|---|
namespace * | string | |
user_id * | string | |
filter | ||
limit | integer | |
offset | integer |
cortrix_document_status
Get a document's processing status / details (GET /documents/{id}?namespace=...). Args: doc_id: document id returned from upload. namespace: target namespace (uses default if empty).
| Parameter | Type | Description |
|---|---|---|
doc_id * | string | |
namespace | string |
cortrix_add_watcher
Add a directory watcher to auto-index files (POST /watch). Args: data_dir: absolute path of the directory to watch. namespace: target namespace (uses default if empty). recursive: watch subdirectories (default True). New/modified files fan out to all namespaces subscribed to the directory.
| Parameter | Type | Description |
|---|---|---|
data_dir * | string | |
namespace | string | |
recursive | boolean |
cortrix_list_watchers
List all configured directory watchers (GET /watch).
cortrix_cross_ns_query
Query across multiple namespaces (F04; POST /query with a namespaces array). Args: query: search query text. namespaces: target namespaces; multiple names or ["*"] for all (hard cap 100). top_k: number of results (default 10). rerank: enable cross-namespace reranking (default True). Partial failures return 200 + structured_data.namespaces_failed (degraded path).
| Parameter | Type | Description |
|---|---|---|
namespaces * | array | |
query * | string | |
rerank | boolean | |
top_k | integer |
cortrix_async_upload
Asynchronously upload a large document (F42; POST /documents -> task_id). Always async: returns a DocumentTask with task_id; poll cortrix_task_status.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
filename | string | |
metadata | ||
namespace | string |
cortrix_memory_search_filter
Memory search filtered by memory type (MEM01/MEM05; POST /memory/search). Args: query: search query text. memory_type: one of fact / preference / event (P04 memory enum). namespace: target namespace (uses default if empty). top_k: number of results (default 5).
| Parameter | Type | Description |
|---|---|---|
memory_type * | string | |
query * | string | |
namespace | string | |
top_k | integer |
cortrix_memory_extract_trigger
Manually trigger MEM02 memory extraction for a session (POST /memory/extract). Args: namespace: target namespace (uses default if empty). session_id: session to extract memories from. When category=quota (LLM budget exceeded) the error is retryable=false.
| Parameter | Type | Description |
|---|---|---|
namespace | string | |
session_id | string |
cortrix_memory_extract
Extract memories from a conversation in one shot (MEM02; POST /memory/extract). Args: messages: conversation turns, each {role, content}. namespace: target namespace (uses default if empty). Batch extraction uses PartialSuccessById semantics; when category=quota the error is retryable=false. (Distinct from cortrix_memory_extract_trigger, which triggers extraction for an existing session by session_id.)
| Parameter | Type | Description |
|---|---|---|
messages * | array | |
namespace | string |
cortrix_task_status
Query async upload task progress (F42; GET /documents/tasks/{task_id}/progress).
| Parameter | Type | Description |
|---|---|---|
task_id * | string |
cortrix_cancel_task
Cancel an async upload task (F42; DELETE /documents/tasks/{task_id}). Returns 409 (passed through) if the task already finished and cannot be cancelled.
| Parameter | Type | Description |
|---|---|---|
task_id * | string |
cortrix_query_explain
Semantic search with explain enabled (POST /query?explain=true). Surfaces Class-A data-integrity fields (coverage_ratio / namespaces_failed) and the Class-B LLM-path explain section (ARCH section 1.6 phased rollout) into structured_data, so an agent can reason about retrieval quality.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
namespaces | ||
rerank | boolean | |
top_k | integer |
cortrix_memory_get_audit
Query the memory audit log (MEM02; reuses the F18a operation_log). There is no dedicated /memory/audit endpoint; the audit trail lives in the F18a operation_log. This maps to GET /operations filtered to the memory lifecycle actions (memory_extract, memory_invalidate, memory_revoke) — the canonical pointer the backend itself returns from /memory/invalidations. Args: memory_id: optional. The operation_log query surface has no per-memory_id filter (F18a OperationLogFilter exposes action/namespace_id/user_id/ r…
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
memory_id | ||
namespace | string |
cortrix_memory_revoke_fact
Self-service revoke of an auto-extracted fact (MEM02 D6). Marks the fact auto_revoke_eligible; the physical row is retained (full-retention model). D3.5 deferred: POST /memory/{id}/revoke not yet in api/paths/*.yaml — mock.
| Parameter | Type | Description |
|---|---|---|
memory_id * | string | |
namespace | string |
cortrix_memory_opt_out
Per-session memory opt-out (and opt-out revoke), MEM04 D2 + D5 combined. Args: session_id: session to opt out of memory extraction. opt_out: True to opt out, False to revoke the opt-out (admin scope). namespace: target namespace (uses default if empty). reason: optional free-text reason recorded with the opt-out / revoke. Routes to the backend's MEM04 surface (memory_routes.cpp M5): the session id is carried in the URL path, not the body. opt_out=True -> POST /memory/session/{id}/opt-out (write scope); opt_out=F…
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
namespace | string | |
opt_out | boolean | |
reason | string |
cortrix_batch_submit
Submit up to 100 documents to a namespace in one batch (TD-F42-BULK). Args: namespace: target namespace. documents: up to 100 items, each {doc_id, content, metadata?}. async_: must be True in V1 (topic 3). on_duplicate: skip / overwrite / error (topic 2). Returns a results list (same order as documents) + structured_data (succeeded / failed / total / coverage_ratio). A batch-level failure returns the GEN-Agent error response. Backed by the live POST /documents/batch route.
| Parameter | Type | Description |
|---|---|---|
documents * | array | |
namespace * | string | |
async_ | boolean | |
on_duplicate | string |
cortrix_list_operations
Query the operation log (F18a; CE 30-day retention + 100K cap; GET /operations). Args: user_id: defaults to the current agent user_id when omitted (cross-user needs an admin key, else CX_ERR_OPLOG_UNAUTHORIZED). namespace: filter by namespace (sent as namespace_id). action: single F18a action enum value. action_in: multi-select list of action enum values (joined as a CSV action_in). start_time / end_time: Unix-millisecond time range (sent as from_timestamp / to_timestamp). limit: ma…
| Parameter | Type | Description |
|---|---|---|
action | ||
action_in | ||
end_time | ||
limit | integer | |
namespace | ||
offset | integer | |
sort_order | string | |
start_time | ||
user_id |
cortrix_memory_list
List the current user_id's memories (MEM03 endpoint 1; GET /memory). Args: namespace: defaults to the current user_id's namespace when omitted. memory_type: filter by type (fact / preference / event). include_invalidated: include soft-deleted (status=invalidated) memories for transparency queries. limit: max rows (default 50, max 200). offset: pagination offset. Errors pass through: CX_ERR_MEM03_USER_MISMATCH / CX_ERR_MEM03_INVALID_TYPE / CX_ERR_MEM03_QUOTA / CX_ERR_MEM03_LIST_FAILED.
| Parameter | Type | Description |
|---|---|---|
include_invalidated | boolean | |
limit | integer | |
memory_type | ||
namespace | ||
offset | integer |
cortrix_memory_create
Create a memory (MEM03 endpoint 2; POST /memory). The POST path does not pass through LLM quality filtering (MEM03 topic 4 lock); extraction_method is set to 'user_create' server-side. Errors pass through: CX_ERR_MEM03_USER_MISMATCH / CX_ERR_MEM03_INVALID_TYPE / CX_ERR_MEM03_CONTENT_TOO_LONG / CX_ERR_MEM03_QUOTA / CX_ERR_MEM03_CREATE_FAILED.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
memory_type * | string | |
namespace * | string | |
metadata |
cortrix_memory_edit
Edit an existing memory's content / metadata (MEM03 endpoint 3; PATCH /memory/{id}). metadata merge semantics (not replace); extraction_method is overwritten to 'user_edit' server-side. Semantically a new user_edit memory + invalidation of the old one, hence PATCH not PUT. Errors pass through: CX_ERR_MEM03_MEMORY_NOT_FOUND / CX_ERR_MEM03_USER_MISMATCH / CX_ERR_MEM03_ALREADY_INVALIDATED / CX_ERR_MEM03_CONTENT_TOO_LONG / CX_ERR_MEM03_EDIT_FAILED / CX_ERR_MEM03_QUOTA.
| Parameter | Type | Description |
|---|---|---|
memory_id * | string | |
content | ||
metadata | ||
namespace | string |
cortrix_memory_invalidate
Soft-delete a memory (MEM03 endpoint 4; DELETE /memory/{id}). Sets status=invalidated + revoked_at + deleted_by_user_id; the physical row is retained (never hard-deleted) per the MEM02 D9 full-retention model and the MEM03 transparency vision. ``reason`` is written to metadata_json.invalidation_reason. Errors pass through: CX_ERR_MEM03_MEMORY_NOT_FOUND / CX_ERR_MEM03_USER_MISMATCH / CX_ERR_MEM03_ALREADY_INVALIDATED / CX_ERR_MEM03_INVALIDATE_FAILED / CX_ERR_MEM03_QUOTA.
| Parameter | Type | Description |
|---|---|---|
memory_id * | string | |
namespace | ||
reason |
cortrix_admin_db_credential_register
Register a database connection credential (F16a D1; admin only). Stores the secret in the encrypted secret store and returns a ref_id handle for later imports (the plaintext secret is never echoed back). Args: name: logical name to register the credential under (returned as ref_id's label). dsn: database connection string / secret (write-only, stored encrypted). expire_days: optional credential expiry in days (backend default applies if omitted). connection_ref: compatibility alias for older agent call sites; maps to nam…
| Parameter | Type | Description |
|---|---|---|
connection_ref | ||
description | ||
dsn | string | |
expire_days | ||
name | string |
cortrix_admin_db_import_run
Trigger a database import run (F16a D2; admin only). Two modes (mutually exclusive): * table + filter — import rows from ``table`` matching an optional ``filter``. * sql — import the result set of a raw ``sql`` query. Args: connection_ref: a credential previously registered via the register tool. namespace: target namespace to import into. table: source table name (table mode). filter: optional JSON filter DSL object (table mode). sql: raw SQL query (SQL mode). Exactly one…
| Parameter | Type | Description |
|---|---|---|
connection_ref * | string | |
namespace * | string | |
filter | ||
sql | ||
table |