Skip to content

MCP Server

KUKAN provides a Model Context Protocol (MCP) compliant server endpoint. This enables Claude, ChatGPT, and other MCP-compatible AI agents to search and browse the data catalog.

POST /api/mcp

Operates in stateless mode using the Streamable HTTP transport.

Add the following to your settings:

{
"mcpServers": {
"kukan": {
"type": "url",
"url": "https://your-kukan-site/api/mcp"
}
}
}
Terminal window
curl -X POST https://your-kukan-site/api/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": { "name": "test", "version": "0.1" }
}
}'

All tools are read-only. Access to private datasets is controlled based on the authenticated user’s permissions.

ToolDescription
search_datasetsSearch datasets by keyword or natural language (hybrid search). Supports organization and tag filters
get_datasetGet detailed dataset information including resource list
get_resourceGet resource (file) metadata and URL
get_resource_schemaGet a resource’s column schema (names, types, row count, stats). CSV/TSV only
query_resourceRun a read-only SQL query (SELECT only) over a resource’s data. CSV/TSV only
list_organizationsList organizations
list_groupsList groups (categories)
list_tagsList tags

Search the data catalog. Besides keywords, natural-language queries work too — semantically related datasets are included in the results (hybrid search).

ParameterTypeRequiredDescription
qstringYesSearch keywords or a natural-language query
organizationstringNoFilter by organization name (slug)
tagsstring[]NoFilter by tag names
semanticbooleanNofalse limits results to keyword matches only (default: true)
offsetnumberNoNumber of results to skip (default: 0)
limitnumberNoMaximum results (default: 10, max: 50)

Get detailed information about a dataset.

ParameterTypeRequiredDescription
nameOrIdstringYesDataset name (slug) or UUID

Get resource metadata. Returns the download URL for uploaded files.

ParameterTypeRequiredDescription
idstringYesResource UUID

Get a resource’s column schema (names, types, nullability, row count, and min/max for numeric columns). Only CSV/TSV resources with a generated preview are queryable. The output names the query table data and includes an example query, so the agent can write SQL after inspecting the schema.

ParameterTypeRequiredDescription
idstringYesResource UUID

Run a read-only SQL query (SELECT / WITH only) over a resource’s data and return the result as a Markdown table. The data is exposed as a table named data. Use get_resource_schema first to learn the column names and types.

ParameterTypeRequiredDescription
idstringYesResource UUID
sqlstringYesA single SELECT/WITH statement over the data table

Runs in a throwaway in-memory DuckDB instance with external access disabled and row/byte/time limits. Double-quote column names that contain non-ASCII characters. See the REST /resources/{id}/query endpoint for limits and error details.

ParameterTypeRequiredDescription
qstringNoSearch by name
offsetnumberNoNumber of results to skip (default: 0)
limitnumberNoMaximum results (default: 20, max: 100)
ParameterTypeRequiredDescription
qstringNoSearch by name
offsetnumberNoNumber of results to skip (default: 0)
limitnumberNoMaximum results (default: 20, max: 100)
ParameterTypeRequiredDescription
qstringNoSearch by name
offsetnumberNoNumber of results to skip (default: 0)
limitnumberNoMaximum results (default: 50, max: 200)

The MCP endpoint integrates with KUKAN’s authentication system.

  • Unauthenticated: Access to public datasets only
  • Authenticated: Access to private datasets within your organizations
  • System admin: Access to all datasets

Include authentication headers in your request when authentication is needed.

  • Protocol: MCP (Model Context Protocol) 2025-03-26
  • Transport: Streamable HTTP
  • Mode: Stateless (no session management)
  • Response format: JSON-RPC 2.0