Skip to content

MCP Services / MCP Coding

Added in version 7.6.0

MCP Coding is a feature of DataFlux Func that supports AI Agents in writing and managing Scripts in Func.

Users can allow AI Agents to participate in writing and managing functions in DataFlux Func through MCP Services.

1. Connection Steps

Follow the steps below to connect an MCP client / AI Agent to DataFlux Func's MCP Coding service.

1.1 Create an Access Token

Accessing DataFlux Func's MCP Coding service requires creating an Access Token and enabling the MCP Coding feature.

And you can specify the functions to be exposed in the rules (e.g., by Script Set ID).

add-access-token.png

add-access-token-2.png

1.2 Permission Rules

Permission rules can be manually edited and are matched from top to bottom; the first matching rule determines the permission.

Examples:

Rule (Exact Match ID) Match Target Match ID Permission
scriptSet:mytest:r Script Set mytest Read
scriptSet:mytest:rw Script Set mytest Read, Modify
scriptSet:mytest:rwx Script Set mytest Read, Modify, Execute
scriptSet:mytest:rwxp Script Set mytest Read, Modify, Execute, Publish
script:mytest__demo:r Script mytest__demo Read
Rule (Wildcard ID) Match Target Wildcard ID Permission
scriptSet:my*:r Script Set Match my* as wildcard Read
script:mytest__de*:r Script Match mytest__de* as wildcard Read

1.3 Configure the MCP Client

DataFlux Func's MCP Services follow the MCP specification

Before actual integration, it is recommended to use MCP Inspector for debugging.

Add the following configuration to the MCP client / AI Agent:

Configuration Item Value
URL {DataFlux Func access address}/mcp/coding
Request Header X-Dff-Access-Token: atk-xxxxx:xxxxx
Example: OpenCode Configuration
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "mcp": {
    "dataflux-func-mcp-coding": {
      "enabled": true,
      "type"   : "remote",
      "url"    : "{DataFlux Func access address}/mcp/coding",
      "headers": {
        "X-Dff-Access-Token": "atk-xxxxx:xxxxx"
      }
    }
  }
}
Example: Codex Configuration
1
2
3
4
[mcp_servers.dataflux-func-mcp-coding]
enabled      = true
url          = "{DataFlux Func access address}/mcp/coding"
http_headers = { "X-Dff-Access-Token" = "atk-xxxxx:xxxxx" }
Example: Claude Code Configuration
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "mcpServers": {
    "dataflux-func-mcp-coding": {
      "type": "http",
      "url": "{DataFlux Func access address}/mcp/coding",
      "headers": {
        "X-Dff-Access-Token": "atk-xxxxx:xxxxx"
      }
    }
  }
}
Example: Generic JSON Configuration
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
  "mcpServers": {
    "dataflux-func-mcp-coding": {
      "url": "{DataFlux Func access address}/mcp/coding",
      "headers": {
        "X-Dff-Access-Token": "atk-xxxxx:xxxxx"
      }
    }
  }
}

1.4 Initialize Local Collaboration Instructions

The latest MCP Coding service's help tool already includes the recommended local AGENTS.md collaboration instructions, so there is no need for users to create them manually.

After integration, it is recommended that the AI Agent first call the help tool of the MCP Services dataflux-func-testing, and initialize according to the returned suggestions.

2. Practical Usage Examples

MCP Coding has many built-in prompts and tool instructions for Func development. When entering prompts, you can directly describe the goal on the premise that the AI Agent already fully understands Func's best practices.

For example:

  • Initialize according to the suggestions of the MCP Services dataflux-func-testing
  • Synchronize all code in the Script Set demo

First, please confirm whether the AI Agent has successfully connected to DataFlux Func's MCP Coding service:

opencode-mcp-status.png

After that, simply enter prompts as usual

opencode-process.png

opencode-process-2.png

After the AI Agent completes, refresh in DataFlux Func to see the AI-written code

code.png