Sample Use Cases
* 
The Model Context Protocol (beta) is currently offered in preview mode and provides only basic functional validation. Full qualification and expanded capabilities will be introduced in future releases.
Prerequisites
1. Create an AppKey in ThingWorx Composer. Set an appropriate expiration date.
2. Set up the MCP client with VS Code IDE and Claude Desktop.
Set Up ThingWorx MCP Server in VS Code IDE
1. Open VS Code IDE.
2. Press Ctrl+Shift+P to open the Command Palette.
3. Select the command MCP Add Server.
4. Select HTTP (HTTP or Server-Sent Events).
5. Enter ThingWorx Server URL>/mcp and press Enter.
6. Enter the server name, for example, ThingWorxMCPServer, and press Enter.
7. Select Global or Workspace based on business needs, then press Enter.
The file mcp.json is created in VS Code IDE with url and type as keys.
8. Add the following code after “type”: "headers": {<APPLICATION_KEY>"}
Your mcp.json file should look like this:

{
"servers": {
"ThingworxMCP": {
"url": "https://centr154-eastus-iot-01-twx.ptcdevops.com/Thingworx/mcp",
"type": "http",
"headers": {
"appKey": "a57da3b7-a7f7-4b05-b48a-ac6ccdc21939"
}
}
},
"inputs": []
}
9. This starts the MCP client in VS Code IDE.
If ThingWorx is configured for single sign-on (SSO), use the following URL format: <ThingWorx Server URL>rp>mcp.
Example Scenario
A manufacturing plant has multiple machines to monitor with the following critical KPIs:
Status
Temperature
Humidity
Energy consumption
Daily runtime
Daily downtime
Create the following entities:
Plant1.Machine.TT (ThingTemplate)
Properties:
Status (STRING | Persist | Logged)
Temperature (NUMBER | Persist | Logged)
Humidity (NUMBER | Persist | Logged)
EnergyConsumption (NUMBER | Persist | Logged)
Plant1.WeldingMachine1.Thing Thing
Plant1.WeldingMachine2.Thing Thing
Plant1.WeldingMachine3.Thing Thing
Plant1.WeldingMachine4.Thing Thing
Plant1.WeldingMachine.VS (Value Stream)
Ensure all Things stream live data at regular intervals.
Use Case 1 
Purpose
A plant manager or machine supervisor needs an immediate operational snapshot of a machine on the factory floor. The goal is to quickly understand current performance and identify abnormal conditions across key operational metrics.
User Prompt
Get the latest machine status with critical KPIs.
Result
A summary of machine status with the latest KPI values, such as energy consumption, temperature, and total runtime.
Steps
1. Create a HelperThing named MCP.HelperThing in ThingWorx.
2. Create a service GetCurrentMachineStatusKPI with:
Input: machineName (STRING)
Output: result (STRING)
3. Open the MCPServices resource and go to the Services tab.
4. Search for theAddTools service and click Execute.
5. In the toolInfo input, click +Add.
6. Enter:
Service Provider Name: MCP.HelperThing
Service Provider Type: Thing
Service Name: GetCurrentMachineStatusKPI
Description: Service returns the latest status with KPIs. It takes machineName as input and returns KPI data.
Application Name: ThingWorx
7. Click Set.
8. Click Save.
9. Click Execute:
The tool is added successfully.
Execute GetAllTools to confirm the tool was added.
10. In VS Code IDE, ensure the MCP client is running. You should see the number of tools and prompts on the screen.
11. Open the chat window on the right-hand side.
12. Enter the prompt: Get the latest machine status with critical KPIs.
The output should display the requested KPI data.
Use Case 2 
Purpose
A plant manager or machine supervisor needs an immediate operational snapshot of a machine but may not know how to phrase an effective prompt. This use case helps users access machine information quickly without requiring prompt-engineering expertise.
Result
The system provides ready-to-use sample prompts that users can consume, customize, and refine based on their needs. This enables quick and consistent access to critical machine information.
Steps
1. Open the MCPServices resource and go to the Services tab.
2. Search for the AddPrompts service and click Execute.
3. In the promptInfo input, click +Add.
4. Enter the following details:
Name: Get Current Status of Machine
Description: A prompt to get the current status of a machine. It takes machineName as input.
Content:

{
"text": "Get current status of {machineName}",
"type": "text"
}
Prompt Arguments: Add the argument machineName.
5. Click Add.
6. Click Save.
7. Click Execute.
The prompt is added successfully.
Execute GetAllPrompts to confirm the prompt was added.
8. In VS Code IDE, ensure the MCP client is running. You should see the number of tools and prompts on the screen.
9. Open the chat window on the right-hand side.
10. Enter / in the chat window and select the prompt added in the previous steps.
11. Enter input values and press Enter. The output should display the requested machine status.
Use Case 3 
Purpose
A plant manager or machine operator has access to relevant business and operational data but does not know how to query the dataset, extract the required information, or derive meaningful insights.
Result
The available data is ingested and exposed as a resource for the LLM to use as contextual reference. The LLM parses and interprets this data and generates an output that aligns with the user’s prompt, delivering clear, actionable insights without requiring the user to understand the underlying data structure or query language.
Steps
1. Open the MCPServices resource and go to the Services tab.
2. Search for the AddResources service and click Execute.
3. In the resourceInfo input, click +Add.
4. Enter the following details:
Name: QueryMachineData
URI: file:///C:/Thingworx/ThingworxRepository/DataRepository/all-available-machine-data.json
* 
The JSON file referenced in the URI path contains machine data exported from the Value Stream.
Description: A resource to get machine data. It takes the machine name as input and returns an InfoTable.
Service Provider Name: MCP.HelperThing
Service Provider Type: Thing
5. Click Add.
6. Click Save.
7. Click Execute.
The resource is added successfully.
Execute GetAllResources to confirm the prompt was added.
8. In VS Code IDE, ensure the MCP client is running. You should see the number of tools and prompts on the screen.
9. Press Ctrl+Shift+P to open the Command Palette.
10. Select the command MCP: Browse Resources.
11. Select QueryMachineData from the list. all-available-machine-data.json is added as a resource for the LLM in the chat window.
12. Enter a prompt for the attached data.
Was this helpful?