MCP Server

The Model Context Protocol (MCP) server exposes Adsify’s PLC capabilities to AI assistants. Instead of manually constructing API calls, users can interact with PLCs through natural language — asking an AI assistant to read variables, browse symbols, or check EtherCAT health.

Endpoint

Endpoint: MCP Endpoint API_MCP_ENDPOINT
status: implemented
component: Mcp
method: MCP
route: /mcp
policy: ReadAccess

Model Context Protocol server endpoint. Enforces the ReadAccess policy; the write_variable tool enforces WriteAccess internally.

Transport: Streamable HTTP with SSE fallback.

Feature Flag

The MCP server is disabled by default. Enable it in configuration:

{
  "Features": {
    "Mcp": { "Enabled": true }
  }
}

Authentication

The MCP endpoint uses the same authentication as the REST API:

  • Production: JWT Bearer token required. The /mcp endpoint enforces the ReadAccess policy. The write_variable tool enforces WriteAccess internally.

  • Development: When no Authority is configured, authentication is bypassed.

Tools

The tools are specified in MCP Tools (SPEC_MCP_TOOLS).

Tool

Description

Auth

list_plcs

List all configured PLCs with connection status

ReadAccess

get_plc_status

Get connection state and device info for a PLC

ReadAccess

read_variable

Read a PLC variable by symbol path

ReadAccess

read_variables

Batch read multiple variables

ReadAccess

write_variable

Write a value to a PLC variable

WriteAccess

browse_symbols

List/search symbols at a path or by pattern

ReadAccess

get_symbol_info

Get detailed type info for a symbol

ReadAccess

get_device_info

Get PLC device name, version, state

ReadAccess

get_ethercat_health

Get EtherCAT master state and slave summary

ReadAccess

get_ethercat_slave

Get detailed info for a specific EtherCAT slave

ReadAccess

Resources

The resources are specified in MCP Resources (SPEC_MCP_RESOURCES).

Resource URI

Description

adsify://plcs

List of all PLCs with status

adsify://plcs/{plcId}/state

Current PLC device state

adsify://plcs/{plcId}/symbols

Root-level symbol tree

adsify://plcs/{plcId}/ethercat/health

EtherCAT diagnostics summary

Client Configuration

Claude Code

claude mcp add --transport http --scope user adsify http://localhost:5000/mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "adsify": {
      "type": "http",
      "url": "http://localhost:5000/mcp",
      "headers": {
        "Authorization": "Bearer <jwt-token>"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json:

{
  "servers": {
    "adsify": {
      "type": "http",
      "url": "http://localhost:5000/mcp",
      "headers": {
        "Authorization": "Bearer <jwt-token>"
      }
    }
  }
}

In development mode (no Authority configured), no Authorization header is needed.

Example Prompts

Once connected, try asking your AI assistant:

  • “Is the PLC running? What’s the current state?”

  • “Read all motor parameters and tell me if anything looks abnormal”

  • “What symbols are available under GVL?”

  • “Show me the EtherCAT slave health – are any in error state?”