Enable AI-powered industrial automation through Model Context Protocol integration.

  • Name: MCPServer
  • Version: 1.0.0.0
  • Interface: TCP/IP
  • Configuration:
    • Scripts / Classes


Preview Connector

This is the preview documentation for version 10.1.3 schedule for release in February, 20th.

Overview

The AI MCP for Runtime service bridges FrameworX solutions with AI language models, enabling intelligent automation assistance while maintaining industrial-grade safety. This connector exposes your solution's live data and functionality as structured tools that AI models can invoke.

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


Integration Architecture


AI ModelMCP ProtocolFrameworX Solution
Claude, GPT, GitHub Copilot
Model Context Protocol
TServer.exe (Runtime)
Structured Methods
Tag Data AccessHistorian QueriesAlarm MonitoringCustom Methods
Live values from UNSHistorical time-series dataActive & historical alarmsYour solution-specific tools

This diagram shows an AI model (such as Claude or GPT) communicating with a FrameworkX solution through the MCP Protocol, which acts as a standardized bridge for exchanging context and invoking tools. FrameworkX then exposes structured methods that the model can call to access tag data, query historical records, monitor alarms, and run custom operations.

When to Use MCP for Runtime

Use CaseExample
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?"

Why Custom Tools Matter

Some platforms may offer only built-in MCP tools that let AI read or write tags, or run queries, or perform specific tasks in the platform. In practice, this approach has limited value:

  • Real solutions have hundreds of equipment items and thousands of tags
  • Operators don't memorize tag names and their needs goes beyond plain data, it requires context, aggregation, and analysis 
  • Open access to running systems creates safety concerns and privacy issues
  • LLM hallucination risk makes direct control inappropriate

FrameworX approach: Custom Runtime Tools

Because FrameworX compiles .NET code at runtime, you can create domain-specific tools that expose exactly what you want, with descriptions that guide AI to correct usage. External applications query at the semantic level: "get tank levels" instead of "read Tag.Area1.Tank3.LT001.PV".

This gated access model means:

Generic ToolsCustom Tools
AI needs to know exact tag pathsAI uses semantic descriptions
Full system access (security risk)You control what's exposed
Requires tag naming knowledgeNatural language queries
Hallucination can cause errorsValidation in your code



Prerequisites

  • FrameworX 10.1 or later
  • .NET 8.0 runtime
  • Claude Desktop or compatible MCP client
  • Running FrameworX solution (TServer.exe)
  • Network connectivity

Configuration

The MCP Server starts automatically when your solution runs. You need to configure your AI client to connect to it.

Connection Methods

MethodUse CaseRequirements
stdioAI client on same machine as solutionLocal installation
HTTPAI client on different machineNetwork access, optional SSL

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\\MCP\\RuntimeMCP.exe",
      "args": ["/host:127.0.0.1", "/port:3101"],
      "transport": "stdio"
    }
  }
}

Note:
For Windows-only solutions, use the path <ProductPath>\fx-10\MCP\RuntimeMCP.exe (without net8.0).
For releases older than 10.1.3, use the path <ProductPath>\fx-10\TMCPServerStdio\TMCPServerStdio.exe

HTTP Configuration

Use HTTP when the AI client runs on a different machine than your solution.

MCP Server Settings (TMCPServerHttp.json in C:\Users\Public\Documents\FrameworX\MachineSettings):

{
  "appSettings": {
    "X_API_KEY": "",
    "CertFileName": "",
    "CertPass": "",
    "CertHash": "",
    "ListenPort": "3000",
    "Runtime": {
      "Host": "localhost",
      "Port": "3101",
      "Username": "guest",
      "Password": ""
    }
  }
}

AI Client Settings (GitHub Copilot .mcp.json):

{
  "servers": {
    "FrameworX Runtime": {
      "type": "http",
      "url": "http://localhost:3000",
      "headers": {
        "X-API-KEY": ""
      }
    }
  }
}

HTTP Settings Reference:

SettingDescription
X_API_KEYOptional authentication password
CertFileNameSSL certificate file (for HTTPS)
CertPassSSL certificate password
CertHashSSL certificate thumbprint (alternative to file)
ListenPortHTTP endpoint port (default: 3000)
Runtime.HostFrameworX runtime host (default: localhost)
Runtime.PortFrameworX runtime port (default: 3101)
Runtime.UsernameRuntime authentication user
Runtime.PasswordRuntime 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

  1. Click the LLM connector icon — you should see your solution name
  2. Go to Settings → Developer and verify the connection shows "running"
  3. Ask the AI a simple question like "What is the server uptime?"

Available Tools

AI MCP for Runtime provides 7 built-in tools, organized by function:

Info Tools (1 tool)


ToolPurpose
runtime_get_infoGet connection details, solution info, and context for using runtime tools. Call this first.

Tag Tools (3 tools)

Tools for querying tags and values from the live Unified Namespace (UNS).

ToolPurpose
runtime_get_valueGet current value of a tag or runtime object, including metadata (description, units, min/max)
runtime_browse_unsBrowse the live Unified Namespace structure to discover available tags and folders
runtime_search_tagsFind tags by partial name or description when you don't know the exact path


Alarm Tools (2 tools)

Tools for monitoring active alarms and querying alarm history.

ToolPurpose
runtime_get_active_alarmsGet currently active alarms (not yet normalized)
runtime_query_alarm_historyQuery historical alarm records from the Alarm Historian database


Historian Tools (1 tool)

Tools for querying historical time-series data.

ToolPurpose
runtime_get_tag_historyQuery historical values for a tag from the Historian database



eading Live Values (runtime_get_value):

  • "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 the Namespace (runtime_browse_uns):

  • "What tags are available under Tag.Plant1?"
  • "Show me the members of Tag.Pump1" (for UserType tags)
  • "What alarm groups exist?"
  • "Browse the Server namespace"

Searching for Tags (runtime_search_tags):

  • "Find all tags containing 'Temperature'"
  • "Search for tags related to 'pressure'"
  • "Find tags with 'pump' in the description"

Historical Analysis (runtime_get_tag_history):

  • "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?"

Active Alarms (runtime_get_active_alarms):

  • "Are there any active alarms?"
  • "What alarms are currently in alarm state?"
  • "Show me all unacknowledged alarms"

Alarm History (runtime_query_alarm_history):

  • "Show me alarms from the last 24 hours"
  • "How many alarms were acknowledged today?"
  • "Query the alarm history for Tag.Temperature1"
  • "What alarms occurred during the night shift?"

Custom Methods

You can extend the MCP server with your own solution-specific tools by creating custom methods in Scripts.

Tool names in runtime:
When naming your runtime tools, it's strongly recommended that you keep the pattern runtime_<toolName>.
When AI is running also MCP for Designer, or other third-party tools, that helps to correctly identify the right tool to use.
For adherence with MCP standards use snake_case for method names (e.g., runtime_get_tank_level), instead of RuntimeGetTankLevel that would be a typical C# convention.

Creating Custom Methods

  1. Navigate to Scripts → Classes
  2. Create a new class with type MCP Tool
  3. Define methods using MCP decorators:

csharp

[McpServerTool, Description("Get current tank level for a specific tank")]
public string runtime_get_tank_level(
    [Description("Tank identifier (1-4)")] string tank_id = "1")
{
    return @Tag[$"Tank{tank_id}_Level"].ToString();
}

Method Structure:

ElementPurpose
[McpServerTool]Marks method as MCP tool
[Description("...")]Explains what the tool does (shown to AI)
Method nameTool name (use snake_case)
Parameter descriptionsExplains expected input to AI
Return valueResult sent to AI


Custom Method Examples

Simple Value Retrieval:

csharp

[McpServerTool, Description("Get production count for today")]
public string runtime_get_production_count()
{
    return @Tag.Production.TodayCount.ToString();
}

With Error Handling:

csharp

[McpServerTool, Description("Get data for a specific tag with validation")]
public string runtime_get_tag_data(
    [Description("Full tag path")] string tag_name)
{
    try
    {
        if (!@Tag.Exists(tag_name))
            return $"Error: Tag '{tag_name}' not found";
        
        return @Tag[tag_name].ToString();
    }
    catch (Exception ex)
    {
        @Info.Trace($"MCP Error: {ex.Message}");
        return "Error: Unable to retrieve data";
    }
}

Aggregated Data:

csharp

[McpServerTool, Description("Get summary of all tank levels")]
public string runtime_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_KEY authentication 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 RuntimeMCP.exe path is correct in AI client config

AI cannot access methods

  • Ensure solution is running (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:3000 first before remote access

Related Documentation

Quick Start Tutorial

  • AI MCP for Runtime Tutorial — Creating and deploying MCP Tools

Example Implementation

  • 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

Change Log

VersionDateChanges
1.12026-027 built-in tools; Updated architecture diagram; Added runtime_ prefix best practice; Improved tool description

In this section...