How to build an MCP (Model Context Protocol) Tool that exposes production KPIs and historical data to AI models, enabling intelligent analysis of industrial processes. This tutorial was done using ClaudeAI.
The steps 1 and 2 are only necessary if you want to create custom methods. If it is not your case, you can go directly to step 3.
By default, in any solution you run, you have the following methods:
Get value – Retrieves the value of a specific tag. You must provide the full path of the tag if it is located in lower levels of the Asset Tree.
Get tag historian – Retrieves historical values from a tag. The tag must be stored in a historian database.
Get alarm online – Retrieves all information related to current and historical alarms.
Navigate to Scripts → Classes
Click in the create a New Class button
In Create new Code, select MCPTool
Click OK
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 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.
Have Claude AI Desktop downloaded
Go in Settings → Developer → Edit Config and open the ”claude_desktop_config.json” in Notepad.
Copy and paste the .json content into the ”claude_desktop_config.json”:
{
"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.
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 any method in a Claude chat. e.g: “What is the Server.SystemMonitor.Uptime?” or "What is the value of tag Facility1.Sector4.Machine2.Pressure" and it returns the value requested.
By default, in any solution you have the following methods:
Get tag historian
Get alarm online
Get value
And you also can create custom methods in the scripts like shown in steps 1 and 2. More examples and information about the queries and custom methods, you can find in: AI MCP Tool Connector.
If when you open ClaudeAI and you don't see you solution in Search and Tools: