Connect an AI model to your running FrameworX solution and query live operational data using Model Context Protocol (MCP).
Prerequisites:
AI Runtime exposes your solution data to AI models like Claude, enabling natural language queries against your industrial system. This tutorial covers:
Every FrameworX solution includes three pre-configured MCP tools:
| Tool | Purpose |
|---|---|
| runtime_get_value | Query current tag values and metadata from the live Unified Namespace |
| runtime_browse_uns | Explore the namespace structure to discover available tags |
| runtime_search_tags | Find tags by partial name or description |
| runtime_get_tag_history | Retrieve historical data for trend analysis |
| runtime_get_active_alarms | Get currently active alarms |
| runtime_query_alarm_history | Query past alarm records from the Alarm Historian |
When built-in tools aren't enough, you can create custom MCP tools using Script Classes. Custom tools let you:
Note: This tutorial covers AI Runtime, which queries live data from running solutions. For AI-assisted solution configuration (creating tags, displays, etc.), see [AI Designer In Action](AI Designer In Action).
In the Script code, you can have multiple methods and they follow this format:
[McpServerTool, Description("<This is the question>")]
public string <MethodName> (
[Description("<Description of the parameter>")] <Parameters>)
{
<Logic>
<Return>
}
Example:
[McpServerTool, Description("Performs concatenation of two input text values.")]
public string runtime_concat(
[Description("The first text value to be used in the operation.")] string parameter1,
[Description("The second text value to be used in the operation, concatenated after the first.")] string parameter2)
{
return parameter1 + parameter2;
}
The logic can process the data and return it as a string, so the AI will receive it.
Naming Convention: Use the
runtime_prefix for your custom methods to distinguish them from Designer tools. Use snake_case (e.g.,runtime_get_tank_level).
{
"mcpServers": {
"<SolutionName>": {
"command": "<ProductPath>\\fx-10\\net8.0\\TMCPServerStdio\\TMCPServerStdio.exe",
"args": [ "/host:127.0.0.1", "/port:<port>" ],
"transport": "stdio"
}
}
}
Replace the placeholders with the following values (including the < and > characters): <SolutionName>: Any name of your choice; it serves only as an identifier. <ProductPath>: The directory where the product was installed. You can find this in Solution Center > About FrameworX > InstalledPath. <Port>: The port on which your solution is running. This can be found in Designer > Solution > Settings > Port.
The <ProductPath> has to have double counter slash instead of one.
Save and close the file.
Close Claude completely (it must be closed through the Windows Task Manager).
Open Claude again.
Go to Settings → Developer; it should display "running".
Open a new chat and click the Search and Tools icon. You should see the name of your solution there.
You can query your solution using natural language. Claude will automatically select the appropriate tool.
Reading Live Values (runtime_get_value):
Browsing the Namespace (runtime_browse_uns):
Searching for Tags (runtime_search_tags):
Historical Data (runtime_get_tag_history):
Alarms (runtime_get_active_alarms, runtime_query_alarm_history):
Built-in Tools Summary:
| Tool | When to Use |
|---|---|
| runtime_get_value | Current values, system status, alarm counts |
| runtime_browse_uns | Discover what tags exist in a folder |
| runtime_search_tags | Find tags when you don't know the exact path |
| runtime_get_tag_history | Historical trends and past values |
| runtime_get_active_alarms | Current alarm state |
| runtime_query_alarm_history | Past alarm events and patterns |
For custom methods you created (Steps 1-2), just describe what you need and Claude will use them.
More examples and complete tool reference: [AI Runtime Connector](AI Runtime Connector).
If when you open ClaudeAI and you don't see your solution in Search and Tools: