Configuring an MCP server endpoint in VS Code
You can configure an MCP server endpoint that enables 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 retrieve test results.
Before you begin
- Obtained the hostname or IP address of Test Hub.
- Logged in to VS Code.
About this task
While configuring the endpoint, you will be prompted to authenticate the connection by entering the credentials. And when you run tests using the tool, you must provide an offline token for authentication.
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
For example, https://testhubserver.com/test/mcp
-
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.
-
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.
VS Code displays a notification stating that the MCP server requires authentication. -
Click Allow.
A second notification is displayed asking whether you want to open an external website.
-
Click Open.
Your default browser opens and displays the Test Hub login page.
-
Sign in with your Test Hub
credentials.
A consent screen is displayed requesting access to Test Hub MCP tools.
-
Click Yes to approve and complete the connection.
After successful authentication, VS Code displays the number of available MCP tools.
Note:The MCP server times out after 30 minutes of inactivity. If no tool calls occur during this period, your session will expire and you are prompted to re-authenticate.