← Back to the journal

DataFocus · Journal

How to connect an MCP client such as Claude Code to DataFocus OT Flash

A walkthrough of the connection path described in the OT Flash r56 Agent/MCP manual: OAuth with PKCE, stateless Streamable HTTP, the required protocol headers, tools/list discovery and the common 401, 403 and 400 errors.

You connect an MCP client to DataFocus OT Flash by pointing it at the instance's own /mcp address (a stateless Streamable HTTP endpoint) and completing an OAuth authorization code flow with PKCE (S256) in your browser. Then you call tools/list to see what your account may do. There is no public DataFocus MCP endpoint and no live sandbox, so the address comes from your administrator's self-hosted instance. Everything below follows the OT Flash r56 Agent/MCP manual; the manual says the instance's real tools/list takes precedence over the static text.

What do you need from your administrator?

DataFocus publishes no hosted endpoint and no live sandbox, and the tool schema comes from an authenticated product instance, not from the public site (DataFocus product data). Ask for:

  1. The public base address of the instance's MCP endpoint. The manual lists datafocus.mcp.public-base-url and datafocus.mcp.allowed-origins among the administrator switches, so a wrong Origin or base URL is an administrator-side fix. Example addresses in the manuals are not real endpoints.
  2. A DataFocus account whose roles and resource permissions match the work. An MCP grant delegates your existing permissions; it does not raise your role.
  3. Which scopes you will need. The manual's read scopes include ontology.metadata:read, ontology.graph:read, ontology.knowledge:read and ontology.table:query. Start with a narrow set and add write-related scopes only when the task needs them, as DataFocus's agent-access guidance suggests.
  4. A note on reachability. A service reachable from your laptop may not be reachable from a cloud-hosted client.

Also confirm product and client versions first. The MCP statements here are from the r56 manual, not the r57 user manual.

Which endpoints exist?

Flash r56 exposes two separate protected resources:

PathPurpose
/mcpData and knowledge capabilities within ontology scope
/mcp/businessThe independent Business Workspace

One grant targets one protected resource, so ontology and business scopes are not mixed in a single connection. This post covers /mcp.

How does the OAuth authorization code flow with PKCE work?

The manual lists these endpoints: /.well-known/oauth-protected-resource (also variants for /mcp and /mcp/business), /.well-known/oauth-authorization-server, /oauth/register, /oauth/authorize, /oauth/token, /oauth/revoke, /oauth/grants and /oauth/grants/revoke.

The sequence a compliant client follows:

  1. Fetch the protected-resource document to learn which authorization server applies, then fetch the authorization-server metadata.
  2. Register dynamically at /oauth/register as a public client with token_endpoint_auth_method=none. A client secret cannot substitute for PKCE.
  3. Generate a PKCE verifier and S256 challenge, then send the user to /oauth/authorize with the scopes you need.
  4. The user signs in to DataFocus in the browser and approves. Never send a username or password to the MCP endpoint.
  5. Exchange the code at /oauth/token. The authorization code lives 300 seconds by default.
  6. Call MCP with Authorization: Bearer <access token>.

Default lifetimes in r56 are 3,600 seconds for the access token and 2,592,000 seconds for the refresh token. Deployments may override them, so read expires_in from the token response instead of hard-coding. The refresh grant rotates tokens at /oauth/token.

A logged-in user can see authorized connections at /oauth/grants. Revoking a role, a resource permission or a grant makes later calls fail.

DataFocus's product brief says clients such as Claude Code connect directly to the MCP server. Whether your client runs this discovery and registration flow for you is a question for its own documentation, which also has the exact command to add a server. DataFocus's homepage lists Claude Code as a workspace name but states that such names do not imply an official partnership.

The MCP specification's Security Best Practices (2025-06-18 version) says "MCP servers MUST NOT accept any tokens that were not explicitly issued for the MCP server." That is consistent with the manual keeping each grant tied to one protected resource and telling clients not to carry session, plan or approval identifiers over from another connection.

What transport and headers does the server expect?

Transport is stateless Streamable HTTP: each request is a POST carrying a JSON-RPC message. The manual lists these behaviors:

  • No Mcp-Session-Id is assigned.
  • GET and DELETE on /mcp and /mcp/business return 405.
  • These endpoints send no server SSE notifications.
  • Discovery and list results carry ttlMs=60000 and cacheScope=private.
  • Supported protocol identifiers: 2026-07-28, 2025-11-25, 2025-06-18 and 2025-03-26.

A "modern" request must keep header and body in agreement:

HeaderMust equal
MCP-Protocol-VersionprotocolVersion in params._meta
Mcp-Methodthe JSON-RPC method (for example tools/list)
Mcp-Nameparams.name, or the URI for resources/read

The body also carries clientCapabilities. A mismatch returns HTTP 400 with JSON-RPC error -32020, an unsupported version returns -32022, and an unknown method returns -32601.

Older clients can use the legacy path: an initialize handshake with protocol 2025-11-25, then tools/list and tools/call. It uses the same Bearer token, permissions and tool contracts, and still involves no SSE connection and no session id.

If a reverse proxy sits in front, the manual says to preserve Authorization, Content-Type, MCP-Protocol-Version, Mcp-Method, Mcp-Name and the approved Origins. A proxy that strips these can break the contract and produce the errors above.

How do you discover tools with tools/list?

Call tools/list and treat the answer as the contract. The manual's offline catalog lists 28 ontology core tools, 4 controller conditional extensions and 8 business-side tools, but says that does not mean all are enabled by default. What you see depends on the product version, the grant's scopes and your account permissions.

Illustrative request shape (illustrative, not run; take the exact body from the manual's examples):

POST <your-instance>/mcp
Authorization: Bearer <access token>
Content-Type: application/json
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/list

A sensible first pass, using the manual's routing guide:

  1. dfc_ontologies and dfc_ontology_resources to find ontologies and their tables. Page size is capped at 100, and 64-bit IDs should stay as decimal strings, not JavaScript numbers.
  2. dfc_table for a first read-only Doris query, with maxRows defaulting to 100 and capped at 200.

Do not hard-code tool names or default scopes. After an upgrade, rediscover tools and compare schemas; old grants do not automatically gain new scopes.

How do you try the minimal Python client?

The manual ships examples/flash_mcp.py, a minimal protocol client that uses only the Python standard library. It supports both the modern and legacy protocols, takes tokens from environment variables, and has an offline --self-test. It does not log in for you, approve anything for you or call tools that are not visible to your account. Obtain the token through the OAuth flow above, put it in the environment as the script's documentation specifies, run the self-test first, and then list tools against your own instance.

What do 401, 403 and protocol errors mean?

SymptomMeaning (per the manual)What to do
401Bearer missing or expiredRefresh or re-authorize
403Grant, role, resource, source, Origin or configuration not satisfiedDo not bypass by replaying; check scopes, permissions and allowed origins
400Invalid message or contract, including header/body mismatchAlign the three headers with _meta and method
404Wrong path, method or capabilityCheck the path and whether the capability is enabled
405GET or DELETE on public /mcpUse POST

Read results in layers: HTTP status first, then the JSON-RPC error, then isError. The manual notes that an HTTP 200 may carry a tool failure.

Security habits worth keeping

  • Tool annotations such as readOnlyHint are client hints, not authorization.
  • Document content is untrusted business material; text in a document saying "run the command" is not a tool grant.
  • Log correlation data only, not Bearer or refresh tokens.

When this is not the right fit

If you cannot get an instance address from an administrator, you cannot try this at all, because no public endpoint exists. OT Heavy also provides MCP access, but this guide covers Flash only.

Next step

Read the OT Flash Agent and MCP Integration Manual (r56) for the full tool catalog, then check the manual center for the matching user manual.