Configuring an MCP server endpoint in VS Code
HCL DevOps Test Hub (Test Hub) provides a Model Context Protocol (MCP) server endpoint, allowing an MCP-compliant client such as VS Code to access specific server-side tools. The endpoint offers several tools that provide access to teamspace, project, and test asset details, along with the ability to run tests and obtain result details. You to access the endpoint with this configuration.
Before you begin
- Obtained the hostname or IP address of Test Hub.
- Obtained a valid offline token of Test Hub for authorization.
- Logged in to VS Code.
About this task
You can configure the connection by using the HTTP transport type and authorize access using an offline token.
Procedure
- Press Ctrl+Shift+P to open the command palette in VS Code.
- Type MCP add and select the MCP: Add Server... option from the list.
- Select the HTTP (HTTP or Server-Send-Events) option.
-
Paste the URL of the Test Hub MCP server in the Enter Server URL field in the
following format:
https://<server_hostname>/test/mcp/stream
For example, https://testhubserver.com/test/mcp/stream
-
Enter a name to identify the server, or accept the default when prompted to
enter the server ID in the Enter Server ID field.
For example, myTestHub_mcp.
-
Select one of the following workspace options when prompted:
- Global: Ensures the tools are available from all your workspaces.
- Workspace: Ensures the tools are available from only the current workspace.
- Open the mcp.json file from the explorer.
-
Add the following configuration block into your settings after "type":
"http":
For example,"headers": { "Authorization": "Offline <myOfflineToken>" }"myTestHub_mcp": { "url": "https://testhubserver.com/test/mcp/stream", "type": "http", "headers": { "Authorization": "Offline xxxxxxxxxxxx" } } - Save the .JSON file.
-
Perform one of the following steps to connect to the server:
- Click Start that is displayed above the server name in the .JSON file.
- Click Extensions, right-click the server name, and then select Start Server.
The client connects to the server endpoint.