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

You must have completed the following tasks:
  • 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

  1. Press Ctrl+Shift+P to open the command palette in VS Code.
  2. Type MCP add and select the MCP: Add Server... option from the list.
  3. Select the HTTP (HTTP or Server-Send-Events) option.
  4. 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

  5. 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.
  6. 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.
    An mcp.json configuration file is created.
  7. Open the mcp.json file from the explorer.
  8. Add the following configuration block into your settings after "type": "http":
        "headers": {
        "Authorization": "Offline <myOfflineToken>"
    }
    For example,
    "myTestHub_mcp": {
        "url": "https://testhubserver.com/test/mcp/stream",
        "type": "http",
        "headers": {
            "Authorization": "Offline xxxxxxxxxxxx"
    }
    }
  9. Save the .JSON file.
  10. 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.

Results

You have configured an MCP server endpoint in VS Code.

What to do next

In the VS Code chat window, you can type a prompt that requires data from the server. For example, you can enter Get the list of projects or List the latest failed test runs.