cortrix-mcp

v1.0.0rc2
cortrix-mcp Checked 3 hours ago Published 1 month ago

Cortrix 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).

ParameterTypeDescription
query *string
namespaces
rerankboolean
top_kinteger

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.

ParameterTypeDescription
content *string
filenamestring
metadata
namespacestring

cortrix_list_documents

List indexed documents in a namespace (GET /documents).

ParameterTypeDescription
limitinteger
namespacestring
offsetinteger

cortrix_list_namespaces

List authorized namespaces (GET /namespaces).

ParameterTypeDescription
limitinteger
offsetinteger

cortrix_create_namespace

Create a new namespace for data isolation (POST /namespaces).

ParameterTypeDescription
name *string

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.

ParameterTypeDescription
query_text *string
response_text *string
session_id *string
namespacestring

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.

ParameterTypeDescription
namespace *string
user_id *string
filter
limitinteger
offsetinteger

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).

ParameterTypeDescription
doc_id *string
namespacestring

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.

ParameterTypeDescription
data_dir *string
namespacestring
recursiveboolean

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).

ParameterTypeDescription
namespaces *array
query *string
rerankboolean
top_kinteger

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.

ParameterTypeDescription
content *string
filenamestring
metadata
namespacestring

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).

ParameterTypeDescription
memory_type *string
query *string
namespacestring
top_kinteger

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.

ParameterTypeDescription
namespacestring
session_idstring

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.)

ParameterTypeDescription
messages *array
namespacestring

cortrix_task_status

Query async upload task progress (F42; GET /documents/tasks/{task_id}/progress).

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
query *string
namespaces
rerankboolean
top_kinteger

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…

ParameterTypeDescription
limitinteger
memory_id
namespacestring

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.

ParameterTypeDescription
memory_id *string
namespacestring

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…

ParameterTypeDescription
session_id *string
namespacestring
opt_outboolean
reasonstring

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.

ParameterTypeDescription
documents *array
namespace *string
async_boolean
on_duplicatestring

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…

ParameterTypeDescription
action
action_in
end_time
limitinteger
namespace
offsetinteger
sort_orderstring
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.

ParameterTypeDescription
include_invalidatedboolean
limitinteger
memory_type
namespace
offsetinteger

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.

ParameterTypeDescription
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.

ParameterTypeDescription
memory_id *string
content
metadata
namespacestring

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.

ParameterTypeDescription
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…

ParameterTypeDescription
connection_ref
description
dsnstring
expire_days
namestring

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…

ParameterTypeDescription
connection_ref *string
namespace *string
filter
sql
table