Skip to main content
Documentation

MCP Server

Diafunc ships a Model Context Protocol (MCP) server so MCP-capable clients — such as Claude Desktop, IDE assistants, and custom agents — can drive the platform directly. The server exposes the same project, entity, function, table, notebook, evaluation, and analysis operations that are available through the REST APIs, but packaged as MCP tools, resources, and prompts.
The MCP server is currently offered as a preview. The set of tools and their argument schemas may still evolve between minor versions; callers should not yet take hard dependencies on specific tool names.

Endpoint

The MCP server is reached over Server-Sent Events at a single endpoint:
/api/v1/language/mcp
The server identifies itself as Diafunc and advertises a short instruction block that summarizes the typical workflow, the set of supported entity types, and the five scripting languages available for functions (Java, Kotlin, Scala, JavaScript, Python).

Authentication

The MCP server uses the same API token model as the REST APIs: every request must carry an Authorization: Bearer dfat_... header. Tool calls run with the scopes of the supplied token, so the set of operations an MCP client can actually perform is capped by the token's scope grants.
See Authentication for the shared token, scope, and error model.

Capabilities

The server exposes three kinds of capabilities.
Tools — callable operations the client can invoke on behalf of the user. Tools are organized by domain:
Projects — list, read, create, and delete projects; list and create project branches. Deleting a project is permanent, removes everything in it, and requires the project owner role.
Entities — create, read, update, and delete entities; the supported types are function, table, notebook, and text.
Functions — create and update functions, read their source code, execute them, and inspect the resulting evaluation, outputs, and logs.
Tables — read table snapshots, append rows and columns, and merge cells.
Notebooks — manage the hierarchical structure of a notebook entity.
Content — download and upload the raw content attached to an entity, including the MIME type.
Links — create, list, and remove relationships between entities.
Versions and triggers — track entity versions and configure triggers that start evaluations automatically.
Analyses — drive the automatic-analysis workflow end to end, from recipe creation and data upload to queueing runs and reading results. The tools mirror the Analysis API, where the full set of operations is documented.
Data sources — create, read, list, refresh, and delete data sources; list the available data-source types and read the data-sources dashboard.
Skeletons — create, read, list, update, and delete skeletons.
Search — search and filter entities across a project.
Resources — read-only documents exposed under the diafunc:///docs/ scheme, covering entity types, supported languages, and common workflow patterns. Clients can fetch these resources to ground their prompts in up-to-date reference material.
Prompts — reusable prompt templates for common workflows: creating and executing a function, analyzing a table, and composing a multi-step data pipeline.

Typical workflow

A typical MCP-driven session follows the same shape as scripting against the REST APIs:
1. List the user's projects and either pick one or create a new project.
2. List the entities in the project, or create the ones needed for the task — typically tables for input data and functions for analysis logic.
3. Create a function with its source code, execute it, and read the last evaluation together with its outputs and logs.
4. Read back the result using a table snapshot, or upload and download raw content for non-tabular data.
All operations are scoped to a project ID; the branch is usually main.

Connecting an MCP client

Most MCP clients expect a JSON configuration entry that points at the server's URL and carries the Authorization header. The snippet below shows a Claude Desktop configuration that registers Diafunc as an MCP server; other clients use equivalent fields.

Claude Desktop configuration

Replace the token placeholder with an API token issued for the project the client should operate on. Revoking the token at any time disables the MCP connection immediately.

The Language service

The MCP server is hosted by the platform's Language service — the component that also powers the built-in conversational assistant, including chat sessions, response streaming, file uploads, and token accounting. The Language service itself is an internal platform component: its REST endpoints are not a public API and may change without notice. The MCP server documented on this page is the supported surface for connecting language-driven tooling to the platform.
The underlying language model provider is selected server-side; MCP clients and assistant users see the same behavior regardless of the configured provider. Assistant token usage is accounted against monthly platform-wide limits.
See Assistant for how the assistant is used interactively from the Lab and the command line.

See also