#5026·cognee

cognee-mcp: let remember() select an uploaded ontology (ontology_key) in API mode

Author: borgoCreated Sep 11, 2026Updated Sep 15, 2026
LabelsFeatureINTEGRATIONS

Summary

The Cognee REST API supports per-request ontology grounding: POST /api/v1/ontologies uploads an OWL file under an ontology_key, and POST /api/v1/remember / POST /api/v1/cognify accept ontology_key to ground extraction with it. cognee-mcp (0.5.5, and main) exposes remember(data, filename, content_base64, dataset_name, session_id, custom_prompt, background) without any ontology parameter, and CogneeClient.remember never sends ontology_key.

Today the only way to ground MCP writes is the server-global ONTOLOGY_FILE_PATH environment variable, which is static, applies to every dataset, and requires a file mount on the server.

Use case

Several agent workspaces share one self-hosted Cognee server. Each workspace owns its own (evolving) ontology alongside its agent instructions and writes to its own dataset (dataset_name). We want to upload each ontology once via /api/v1/ontologies and have the MCP remember call pick it per write, without touching the server configuration.

Proposal

Add an optional ontology_key: str | list[str] | None parameter to the remember tool and forward it as the ontology_key form field in API mode (and as config={"ontology_config": ...} in local mode, resolved through OntologyService). Optionally a COGNEE_MCP_DEFAULT_ONTOLOGY_KEY env var for clients that cannot pass it.

Environment

cognee-mcp 0.5.5 (PyPI), Cognee server 1.5.4 (Docker), API mode (--api-url), stdio transport.