Connect the Tosca MCP Server
We added this functionality in a patch. To use Model Context Protocol (MCP) with Tosca, you need to install patch 1 or later.
With the Model Context Protocol (MCP) integration, AI assistants can access your Tosca workspace and help you create, organize, update, use, and run test assets.
Before you can do that, you need to establish a connection. This topic tells you how.
Before you start
Before you start the setup, make sure you meet the following requirements:
-
The Tosca user machine where you want to use an AI assistant has a free HTTP port available. This port must be in the range 1024–65535.
-
Your AI assistant meets its own MCP requirements. Check the documentation for your AI assistant, as requirements and setup steps vary and continue to evolve rapidly. For example, some assistants like Claude Desktop may require you to install Node.js.
Establish the connection
To establish a connection between the Tosca MCP Server and your AI assistant, follow these steps:
-
On all machines where you want to use an AI assistant with Tosca, enable the MCP Server Addin:
-
Go to Project > Options > McpServerAddin.
-
Select Enabled.
-
Enter the Port that the AI assistant should use to communicate with the Tosca MCP Server.
-
Configure authentication. To do so, create a Windows system environment variable with the following configuration:
-
Name: MCP_LOCAL_AUTH_TOKEN
-
Value: a random string
-
-
Connect your AI assistant to the Tosca MCP Server. Please consult your assistant's own documentation for detailed information.
Here are two examples:
Example 1: Claude CodeTo connect Claude Code, you need to run a single command.
Source: Claude Code documentation (opens in new tab)
Command:
claude mcp add-json httpcommander '{"type":"http","url":"http://localhost:<port you specified in the Tosca options>","headers":{"Authorization":"Bearer ${MCP_LOCAL_AUTH_TOKEN}"}}'
Example:
claude mcp add-json httpcommander '{"type":"http","url":"http://localhost:1025","headers":{"Authorization":"Bearer ${MCP_LOCAL_AUTH_TOKEN}"}}'
Example 2: Claude DesktopTo connect Claude Desktop, you need to go to its Developer Settings page and trigger an edit. Then, add the server to a JSON file.
Source: Claude Desktop documentation (opens in new tab)
File:
"mcpServers": {
"commander-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:<port you specified in the Tosca options>/mcp",
"--header",
"Authorization: Bearer <value of the MCP_LOCAL_AUTH_TOKEN variable>"
]
}
}Example:
"mcpServers": {
"commander-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:1025/mcp",
"--header",
"Authorization: Bearer LZ50nhOsFmXB7KmIIya7"
]
}
}
What's next
Now that you're connected to the Tosca MCP Server, you're ready to use it.