VS Code Copilot Integration

Goal: Query your industrial data from within VS Code.


Prerequisites

  • VS Code with GitHub Copilot extension
  • Copilot Chat enabled
  • OpenIndustrial workspace with warm queries
  • API key with appropriate scopes

Step 1: Install MCP Extension

  1. Open VS Code Extensions (Ctrl+Shift+X)
  2. Search for "MCP Tools"
  3. Install the official MCP extension
  4. Reload VS Code

Step 2: Configure MCP Server

  1. Open VS Code settings (Ctrl+,)
  2. Search for "MCP"
  3. Click "Edit in settings.json"
  4. Add your OpenIndustrial server:
{
  "mcp.servers": {
    "open-industrial": {
      "command": "npx",
      "args": [
        "-y",
        "@openindustrial/mcp-server",
        "--workspace", "YOUR_WORKSPACE_ID",
        "--token", "YOUR_API_TOKEN"
      ]
    }
  }
}

Step 3: Verify Connection

  1. Open Copilot Chat (Ctrl+Shift+I)
  2. Type: @mcp list tools
  3. You should see your warm queries listed

Step 4: Query Your Data

In Copilot Chat, use the @mcp prefix:

@mcp What's the average temperature from the last hour?

Copilot will:

  1. Identify the relevant warm query tool
  2. Execute it with parameters
  3. Return results in the chat

Use Cases for Developers

Debugging with Real Data

@mcp Show me the last 10 error events from device T-07

Get real error data while debugging device communication code.

Writing Documentation

@mcp What fields does the production-metrics query return?

Document your data schemas based on actual query shapes.

Code Generation

@mcp What's the structure of device telemetry?
I need to write a TypeScript interface for it.

Generate type definitions from real data structures.

Thinking Tip:

Copilot can generate code that matches your actual data shapes when it has access to real query results.


Example Workflow

  1. Query current state:

    @mcp What's the current status of Line 2?
    
  2. Understand the data:

    @mcp What metrics are available for production lines?
    
  3. Generate code:

    Based on those metrics, write a function that calculates OEE
    
  4. Validate against real data:

    @mcp Run the OEE calculation for Line 2 last shift
    

Multi-Tool Queries

Copilot can combine multiple MCP tools:

@mcp Compare temperature readings from sensors T-01 and T-07
and tell me if there's a significant difference

The AI orchestrates multiple queries, but each one goes through the governed layer. Full audit trail maintained.


Troubleshooting

IssueSolution
Tools not appearingReload VS Code, check extension is active
@mcp not recognizedEnsure MCP extension is installed
Authentication errorsVerify token in settings.json
Slow first queryMCP server initializing; subsequent queries faster

Security

  • Store tokens in VS Code settings (local to your machine)
  • Use environment variables for shared team configs
  • Create dedicated token for VS Code usage
  • Review audit logs periodically

Next Steps

If you want to...Go to...
Connect Claude DesktopClaude Desktop →
Build custom clientCustom Clients →
Understand MCP protocolMCP Overview →
On this page