Skip to main content

Unofficial MCP server for Cognite Data Fusion data modeling

Project description

cog-mcp-experimental

MCP server for Cognite Data Fusion data modeling. Exposes data model schemas as resources, instance operations (list, search, query, aggregate, retrieve), and AI document tools (question answering and summarization).

Quick start

uvx cog-mcp-experimental

Configuration

Configuration is via environment variables — either passed through your MCP client's config, or loaded from a .env file in the working directory.

Using a .env file

Create a .env file (and add it to .gitignore):

CDF_CLIENT_ID=your-client-id
CDF_TENANT_ID=your-tenant-id
CDF_CLUSTER=westeurope-1
CDF_PROJECT=your-project
CDF_CLIENT_SECRET=your-secret
CDF_DATA_MODELS=[{"space": "mySpace", "externalId": "MyModel", "version": "1"}]
CDF_INSTANCE_SPACES=["instanceSpace1"]

The .env file does not override existing environment variables — explicit env vars from your MCP client config or shell always take precedence.

Required environment variables

Variable Description
CDF_CLIENT_ID OAuth client ID
CDF_TENANT_ID Azure AD tenant ID
CDF_CLUSTER CDF cluster (e.g. westeurope-1)
CDF_PROJECT CDF project name
CDF_CLIENT_SECRET OAuth client secret
CDF_DATA_MODELS JSON array of data models: [{"space": "s", "externalId": "m", "version": "1"}]
CDF_INSTANCE_SPACES JSON array of space IDs for automatic instance filtering: ["space1"]

Optional

Variable Description
CDF_TOKEN_URL Override OAuth token URL (defaults to Azure AD)

Client setup

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "cog-mcp-experimental": {
      "command": "uvx",
      "args": ["cog-mcp-experimental"],
      "env": {
        "CDF_CLIENT_ID": "your-client-id",
        "CDF_TENANT_ID": "your-tenant-id",
        "CDF_CLUSTER": "westeurope-1",
        "CDF_PROJECT": "your-project",
        "CDF_CLIENT_SECRET": "your-secret",
        "CDF_DATA_MODELS": "[{\"space\": \"mySpace\", \"externalId\": \"MyModel\", \"version\": \"1\"}]",
        "CDF_INSTANCE_SPACES": "[\"instanceSpace1\"]"
      }
    }
  }
}

Cursor

.cursor/mcp.json or ~/.cursor/mcp.json:

{
  "mcpServers": {
    "cog-mcp-experimental": {
      "command": "uvx",
      "args": ["cog-mcp-experimental"],
      "env": {
        "CDF_CLIENT_ID": "your-client-id",
        "CDF_TENANT_ID": "your-tenant-id",
        "CDF_CLUSTER": "westeurope-1",
        "CDF_PROJECT": "your-project",
        "CDF_CLIENT_SECRET": "${env:CDF_CLIENT_SECRET}",
        "CDF_DATA_MODELS": "[{\"space\": \"mySpace\", \"externalId\": \"MyModel\", \"version\": \"1\"}]",
        "CDF_INSTANCE_SPACES": "[\"instanceSpace1\"]"
      }
    }
  }
}

Claude Code

claude mcp add --transport stdio \
  --env CDF_CLIENT_ID=your-client-id \
  --env CDF_TENANT_ID=your-tenant-id \
  --env CDF_CLUSTER=westeurope-1 \
  --env CDF_PROJECT=your-project \
  --env 'CDF_DATA_MODELS=[{"space":"mySpace","externalId":"MyModel","version":"1"}]' \
  --env 'CDF_INSTANCE_SPACES=["instanceSpace1"]' \
  cog-mcp-experimental -- uvx cog-mcp-experimental

CDF_CLIENT_SECRET is inherited from your shell environment.

Tools

Discovery

Tool Description
list_views List available views with their space, externalId, and version
get_view_schema Get full property schema for a view (names, types, relations)
get_filter_docs Reference documentation for filter syntax
get_query_docs Reference documentation for graph query syntax

Instance operations

Tool Description
list_instances List/filter instances of a view with pagination
search_instances Full-text search across instances
aggregate_instances Count, sum, avg, min, max, histogram
query_instances Graph query across related instances
retrieve_instances Get specific instances by ID

All instance tools automatically apply space filters from CDF_INSTANCE_SPACES.

AI document tools

Tool Description
ask_documents_question Ask questions about PDF documents using document instanceId values
summarize_document Summarize a single PDF document using document instanceId

Resources

The same discovery information is also available as MCP resources for clients that support them:

URI Description
cdf://views List all available views
cdf://views/{space}/{externalId}/{version} View schema with property details
cdf://docs/filters Filter syntax reference
cdf://docs/querying Query syntax reference

Development

git clone <repo>
cd cog-mcp
uv sync
uv run cog-mcp-experimental

Test with MCP Inspector:

npx @modelcontextprotocol/inspector

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cog_mcp_experimental-0.2.4.tar.gz (70.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cog_mcp_experimental-0.2.4-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file cog_mcp_experimental-0.2.4.tar.gz.

File metadata

  • Download URL: cog_mcp_experimental-0.2.4.tar.gz
  • Upload date:
  • Size: 70.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cog_mcp_experimental-0.2.4.tar.gz
Algorithm Hash digest
SHA256 56492073693b2dc80401b8fb3b2cf56e5484cd42658d9d0dbc171cd66aed9168
MD5 dd374cdb38fb5185fc143c624a2b0636
BLAKE2b-256 1aa26957c8cc5de831625bc286d73a8fb09a7d23ac0aac51076a8b5be545ad57

See more details on using hashes here.

File details

Details for the file cog_mcp_experimental-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: cog_mcp_experimental-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cog_mcp_experimental-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6a64be02fe76459751008abd45f76a4296d2c10b39a7fc624af5ad9b64001bdd
MD5 a362d7fc385dab6eaf1afffe80900b9b
BLAKE2b-256 aa0f1364833e6a77be2a4ca432be4e90940699535dd24fcaf4b937a69e5e4297

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page