| Page properties | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Enable AI-powered industrial automation through Model Context Protocol integration.
- Name: MCPServer
- Version: 1.0.0.0
- Interface: TCP/IP
- Configuration:
- Scripts / Classes
| Table of Contents | ||||||
|---|---|---|---|---|---|---|
|
Overview
The MCP (Model Context Protocol) Tool Connector AI MCP for Runtime service bridges FrameworX solutions with AI language models, enabling intelligent automation assistance while maintaining industrial-grade safety and determinism. This connector exposes your solution's live data and functionality as structured tools that AI models can invoke with parameters, not just generate text responses.
Note: This connector is for querying live data from running solutions (connects to TServer.exe). For AI-assisted solution configuration, see AI MCP for Designer Connector.
Key Capabilities
- Real-time Data Access
- — Query live tag values, historian data, and alarm states through AI
- Unified Namespace Browsing — Explore your tag structure and discover available data
- Historical Analysis — Query historian for trend analysis and past behavior investigation
- Alarm Monitoring — Check active alarms and query alarm history
- Custom Methods — Extend with your own solution-specific AI tools
- Platform Agnostic — Works with Claude, GitHub Copilot, and other MCP-compatible AI models
When to Use MCP for Runtime
| Use Case | Example |
|---|---|
| Process monitoring | "What is the current temperature in Tank1?" |
| Alarm investigation | "Are there any active alarms? What's causing them?" |
| Historical analysis | "Show me the temperature trend for the last 24 hours" |
| Data discovery | "What tags are available under Plant1/Line2?" |
| Operational questions | "What is the system uptime?" |
Technical Specifications
| Property | Value |
|---|---|
| Name | MCP Tool |
| Protocol | Model Context Protocol (MCP) |
| Interface | stdio/HTTP |
| Runtime | .NET 8.0 |
| AI Models | Claude |
| Configuration | Scripts → Classes |
Prerequisites
- FrameworX 10.1 or later
- .NET 8.0 runtime
- Claude Desktop or compatible MCP client
- Running FrameworX solution (TServer.exe)
- Network connectivity
Configuration
WorkflowThe
first step is to run the solution, which will automatically start theMCP Server
. The second step is to configure the client LLM to perform the queries.According to the claude documentation, there are three ways of connection to the MCP Server:
- stdio
- HTTP
- SSE
stdio
The following configuration uses stdio, which requires the MCP server to run on the same machine as the LLM. Therefore, if your solution is hosted on a remote machine, you must install the product in both environments: the local machine (where the LLM runs) and the remote machine (where the runtime is hosted).
Configure your AI client (e.g., Claude Desktop) to connect to the MCP server:
starts automatically when your solution runs. You need to configure your AI client to connect to it.
Connection Methods
| Method | Use Case | Requirements |
|---|---|---|
| stdio | AI client on same machine as solution | Local installation |
| HTTP | AI client on different machine | Network access, optional SSL |
| SSE | Server-sent events | Not yet tested |
stdio Configuration
Use stdio when the AI client runs on the same machine as your solution.
Configure Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"YourSolution": {
"command": "C:\\FrameworX\\fx-10\\net8.0\\TMCPServerStdio\\TMCPServerStdio.exe",
"args": ["/host:127.0.0.1", "/port:3101"],
"transport": "stdio"
}
}
}
Note: For
the command should be "Windows-only solutions,
\use the path
<ProductPath>\
\
fx-10\
\
TMCPServerStdio\
".
TMCPServerStdio.exe
(without net8.0).
HTTP Configuration
Use HTTP when the AI client runs on a different machine than your solution.
MCP Server Settings (TMCPServerHttp.json
HTTP
This method was only tested with GitHub Copilot. Other LLMs should work as well, but have not been tested.
Program: TMCPServerHttp
Install Path: <ProductPath>\fx-10\net8.0\TMCPServerHttp\ (NET 8.0 Runtime required to execute TMCPServerHttp.dll)
LLM Setting
Arguments in LLM Setting, example: .mcp.json (GitHub Copilot) or claude_desktop_config (ClaudeAI) (location may vary depending on the LLM)
Url:<url>: Endpoint containg Host:Port. Ex: http://localhost:3000, https://192.168.20.2:3000
When using certificate HTTP/SSL, the url must include "https"Headers: X_API_KEY (optional) used by authentication
MCP Server Setting
Arguments in TMCPServerHttp.json (located in C:\Users\Public\Documents\FrameworX\MachineSettings
X_API_KEY: (optional) used by authentication. It is a string password that will be required when client connects to the MCP server.
/CertFileName:<filename>: Certificate file name. Used by HTTP/SSL. Work with “CertPass“.
/CertPass:<pass>: Certificate password. Used by HTTP/SSL. Work with “CertFileName“.
/CertHash:<hash>: Certificate Thumbprint. Used by HTTP/SSL. Located at: (StoreName.My, StoreLocation.LocalMachine)
)
. Default is 3000Runtime section:
/Host<host>: Runtime Host/IP where runtime is running. Default is localhost
:
Runtime Port where runtime is running. Default is 3101/UserName<name>: User name used by connection to runtime
/Password:<pass>: User password used by connection to runtime
Multiple connections
To connect to several runtimes and/or listen several ports, call TMCPServerHttp with argument “/instance:<number>“.
Arguments in section “4” must include “instance”.
Example: TMCPServerHttp /instance:2 => X_API_KEY2, ListenPort2, Runtime2, etc…
| title | .mcp.json (GitHub Copilot) |
|---|
{
"serversappSettings": {
"FrameworX Runtime - HeaderLayoutX_API_KEY": {"",
"typeCertFileName": "http",
"urlCertPass": "http://localhost:3000",
"headersCertHash": {"",
"X-API-KEY"ListenPort": "3000",
}"Runtime": {
}
}
}| title | .TMCPServerHttp.json |
|---|
"Host": {
"localhost",
"X_API_KEYPort": "3101",
"CertFileNameUsername": "guest",
"CertPassPassword": "",
"CertHash": "",}
}
}
AI Client Settings (GitHub Copilot .mcp.json):
{
"ListenPortservers": "3000",{
"FrameworX Runtime": {
"Hosttype": "localhosthttp",
"Porturl": "3101http://localhost:3000",
"Usernameheaders": "guest",
{
"PasswordX-API-KEY": ""
}
}
}
}
HTTP Settings Reference:
| Setting | Description |
|---|---|
X_API_KEY | Optional authentication password |
CertFileName | SSL certificate file (for HTTPS) |
CertPass | SSL certificate password |
CertHash | SSL certificate thumbprint (alternative to file) |
ListenPort | HTTP endpoint port (default: 3000) |
Runtime.Host | FrameworX runtime host (default: localhost) |
Runtime.Port | FrameworX runtime port (default: 3101) |
Runtime.Username | Runtime authentication user |
Runtime.Password | Runtime authentication password |
Multiple Connections: To connect to multiple runtimes, use /instance:<number> argument and matching numbered settings (e.g., X_API_KEY2, ListenPort2, Runtime2).
Verifying Connection
- Click the LLM connector icon — you should see your solution name
- Go to Settings → Developer and verify the connection shows "running"
- Ask the AI a simple question like "What is the server uptime?"
Available Tools
AI MCP for Runtime provides these built-in tools:
Data Access
| Tool | Purpose |
|---|---|
| get_value | Get current value of a tag or runtime object |
| get_tag_metadata | Get tag description, units, range, and data type |
| get_children | Browse the Unified Namespace structure |
| search_tags | Find tags by name pattern |
Historical Data
| Tool | Purpose |
|---|---|
| get_tag_history | Query historical time-series data for a tag |
Alarms
| Tool | Purpose |
|---|---|
| get_active_alarms | Get currently active alarms |
| query_alarm_database | Query historical alarm records |
Example Queries
Reading Values:
- "What is the current value of Tag.Temperature1?"
- "Get the value of Tag.Plant1/Line2/Pressure"
- "What is the Server.SystemMonitor.CPUUsage?"
- "How many active alarms are there?" (uses Alarm.TotalCount)
Browsing Data:
- "What tags are available under Tag.Plant1?"
- "Show me the members of Tag.Pump1" (for UserType tags)
- "What alarm groups exist?"
- "Find all tags containing 'Temperature'"
Historical Analysis:
- "Show me the temperature history for today"
- "Get the historian data for Tag.Pressure from 8am to noon"
- "What was the highest temperature value today and when did it occur?"
Alarm Investigation:
- "Are there any active alarms?"
- "Show me alarms from the last 24 hours"
- "How many alarms were acknowledged today?"
- "Query the alarm history for Tag.Temperature1"
Custom Methods
You can extend the MCP server with your own solution-specific tools by creating custom methods in Scripts.
Creating Custom Methods
SSE
SSE configuration was not tested.
How to verify if the setting was done correctly
- Click in the LLM connector, you should see the <SolutionName> name.
- Go in Settings > Developer, and check if your solution is in a good state (running). (depends on the LLM).
Query Through AI
Once configured, the AI can access your solution data:
General questions
- What is the Server.SystemMonitor.Uptime of BottlingLine MCP Demo?
- Get value of Tag.Machine1.Temperature1
Alarm
- Is there any active alarm, or has there been one recently? Any acknowledged?
- Retrieve the alarms again, and check how many acknowledged alarms do we have? and how many are not?
Historian
- Retrieve the historical Brewery/BrewHouse/Temperature values from today.
- Show a trend visualization (only the trend) with the historical values of Brewery/BrewHouse/Temperature from today in JSX format
- Get all the historical value from today and return the highest and the time that hapenned
Custom Methods (methods you created)
- Get the last anomalies from the Bottling Line
Available Methods
When MCP server is running, by default you have three methods:
- Get Value
- Get Historian
- Get Alarms
- Navigate to Scripts → Classes
- Create a new class
- with type MCP Tool
- Define methods using MCP decorators
Description is the question you will ask the LLM.
MethodName is what the LLM will call. Each capital letter will appear as a space in the LLM interface.
Example- :
GetTankLevel will appear as "Get Tank Level".ParametersDescription explains what is expected for each parameter.
Parameters define the inputs.
Content defines the behavior or response of the method.
Result is what the LLM will receive in order to generate the answer, which it will then convert into a more human-readable response.
| language | c# |
|---|
[McpServerTool, Description("<Description>Get current tank level for a specific tank")]
public string <MethodName>get_tank_level(
[Description("<ParametersDescription>Tank identifier (1-4)")] <Parameters> string tank_id = "1")
{
<Content>
return <Result>@Tag[$"Tank{tank_id}_Level"].ToString();
}
Example:
Method Structure:
| Element | Purpose |
|---|---|
[McpServerTool] | Marks method as MCP tool |
[Description("...")] | Explains what the tool does (shown to AI) |
| Method name | Tool name (use snake_case) |
| Parameter descriptions | Explains expected input to AI |
| Return value | Result sent to AI |
Custom Method Examples
Simple Value Retrieval:
[McpServerTool, Description("Get currentproduction count tankfor leveltoday")]
public string GetTankLevel(
[Description("Tank identifier")] string tankId = "4")get_production_count()
{
return @Tag.Tank_{tankId}_Level"]Production.TodayCount.ToString();
}| Warning |
|---|
After every configuration change or after shutting down and restarting the solution, you must fully restart the Desktop LLM. This means not only closing the application window, but also terminating the process (either from the system tray icon or via the Task Manager). This is a requirement of the LLM. |
Error Handling
Within the custom methods, you can also add safeguards to help identify potential errors, as shown below:
| language | c# |
|---|
With Error Handling:
[McpServerTool, Description("SafeGet data retrievalfor a specific tag with validation")]
public string GetData(string tagNameget_tag_data(
[Description("Full tag path")] string tag_name)
{
try
{
if (!@Tag.Exists(tagNametag_name))
return $"Error: Tag '{tagNametag_name}' not found";
return @Tag[tagNametag_name].ToString();
}
catch (Exception ex)
{
@Info.Trace($"MCP Error: {ex.Message}");
return "Error: Unable to retrieve data";
}
}
Aggregated Data:
[McpServerTool, Description("Get summary of all tank levels")]
public string get_all_tank_levels()
{
var result = new StringBuilder();
for (int i = 1; i <= 4; i++)
{
var level = @Tag[$"Tank{i}_Level"].Value;
result.AppendLine($"Tank {i}: {level}%");
}
return result.ToString();
}
Important: After creating or modifying custom methods, fully restart the AI client (close from Task Manager, not just the window).
Best Practices
For AI Queries
- Be specific about tag paths when asking for values
- Use "active alarms" for current state, "alarm history" for past events
- Specify time ranges clearly for historical queries
- Ask the AI to browse the namespace if you're unsure of tag names
For Custom Methods
- Use descriptive names and descriptions — the AI relies on these
- Include parameter validation and error handling
- Return clear error messages that help the AI understand what went wrong
- Follow snake_case naming convention for consistency
- Keep methods focused on single tasks
Security Considerations
- Use
X_API_KEYauthentication for HTTP connections - Configure appropriate runtime user permissions
- Be cautious with write operations — consider read-only access for AI
- Review custom methods for security implications
Troubleshooting
MCP Server not starting
- Verify .NET 8.0 runtime
- is installed
- Check firewall settings for the configured port
- Confirm TMCPServerStdio.exe path is correct in AI client config
AI cannot access methods
- Ensure
- solution is running (
Runtime → Startup- TServer.exe active)
- Verify AI client configuration matches server settings
- Restart
- AI client completely (close
- via Task Manager)
- Check that MCP decorators are properly applied to custom methods
Data not updating
- Confirm tags are properly configured in the solution
- Verify real-time database connectivity
- Check
- custom method error handling for exceptions
Custom methods not appearing
- Verify class type is set to "MCP Tool"
- Check for syntax errors in method code
- Restart AI client completely after changes
HTTP connection failing
- Verify ListenPort is not blocked by firewall
- Check X_API_KEY matches between server and client
- For HTTPS, verify certificate is properly configured
- Test with
http://localhost:3000first before remote access
Related Documentation
Quick Start Tutorial
Build your first MCP
Tool and connect it to Claude AIconnection step by step:
- AI MCP for Runtime Tutorial
- — Creating and deploying MCP Tools
Example Implementation
Explore a complete working example
with MQTT integration:
- SolarPanels MCP Demo
- — Full solution demonstrating MCP Tools with solar panel monitoring
Technology Information
- AI-Ready by Design
- — Platform architecture for AI integration
Reference Information
- Scripts Module Reference
- — Complete scripting documentation
AI MCP for Designer
For AI-assisted solution configuration (creating tags, displays, alarms):
- AI MCP for Designer Connector — Enable AI to configure solutions
- AI MCP for Designer Tutorial — Step-by-step guide for AI-assisted configuration
In this section...
| Page Tree | ||
|---|---|---|
|