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.
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.
-
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/mcpFor 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:
An
mcp.json configuration file is created.
-
Open the mcp.json file from the explorer.
-
Perform one of the following steps to connect to the 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.
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. If
you enter a prompt such as Execute the test <test_name> for
running the test, the tool retrieves the test assets details from the server and then
displays a prompt to enter the offline token to process the request. You must generate a
token, copy it and paste the token in the VS Code chat window for the test run to
complete.