# Testing MCP Servers

> Test a UiPath MCP Server directly, outside any AI client, using the UiPath MCP Inspector, the open-source MCP Inspector, cURL, or Postman.

Before connecting an MCP Server to an AI client, test the connection and tool behavior directly. Testing outside an AI client lets you isolate whether an issue originates in the MCP Server, its authentication, or the AI client.

## Testing with the UiPath MCP Inspector

The UiPath MCP Inspector runs inside Orchestrator and requires no separate setup.

### Access the Inspector

1. On the **MCP Servers** page, select an MCP Server.
2. Select the Inspector icon.

   ![Inspector icon in the MCP Servers list, next to a selected server](https://dev-assets.cms.uipath.com/assets/images/orchestrator/Inspector_icon-921c2810.webp)

### Call a tool

1. Select a tool from the list.
2. Enter the tool's input parameters.
3. Select **Invoke** to inspect the result.

   ![Tool call form with input parameters and the returned JSON result](https://dev-assets.cms.uipath.com/assets/images/orchestrator/Inspector_Tools-aec31607.webp)

## Testing with the MCP Inspector (CLI)

The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is an open-source tool that connects to any MCP Server over Streamable HTTP.

### Prerequisites

* Node.js is installed to run the `npx` command.
* The MCP Server URL, available from the **MCP Servers** page in Orchestrator.
* A bearer token. For the simplest option, use a [personal access token (PAT)](./authenticating-with-a-personal-access-token.md). For other supported token types, check [MCP Server authentication](./mcp-server-authentication.md).

1. From a terminal, run the following command. It is the same on macOS, Linux, and Windows (PowerShell 7 or Git Bash):

   ```shell
   npx @modelcontextprotocol/inspector@0.22.0
   ```

   The command opens the Inspector web UI in your browser.
2. Enter the MCP Server URL.
3. Select **Streamable HTTP** as the transport type.
4. In the **Authentication** section, enter the token in the format `Bearer <token>`.
5. Select **Connect**.

   ![MCP Inspector connect screen with the server URL, transport type, and Authorization header filled in](https://dev-assets.cms.uipath.com/assets/images/orchestrator/MCP_Connect-28afff0c.webp)

### Result

Once connected, you can:
* List tools to verify all your tools appear with correct JSON schemas.
* Call tools to execute tools with test inputs and inspect responses.
* Watch the session to see the `initialize` → `initialized` → `request` lifecycle in real time.
* Validate schemas to catch type mismatches before they hit an LLM.

## Testing with cURL

Use cURL to send raw JSON-RPC requests and inspect the full request/response cycle, including headers.

### Prerequisites

* A bearer token. Check [MCP Server authentication](./mcp-server-authentication.md) for supported methods.
* The MCP Server URL, available from the **MCP Servers** page in Orchestrator.

1. Set the token and server URL as environment variables:

   ```shell
   TOKEN="your-bearer-token"
   SERVER_URL="https://cloud.uipath.com/{org}/{tenant}/agenthub_/mcp/{folder}/{slug}"
   ```

2. Initialize the MCP session:

   ```shell
   curl -v -X POST "$SERVER_URL" \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -H "Accept: application/json, text/event-stream" \
     -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "initialize",
       "params": {
         "protocolVersion": "2025-06-18",
         "capabilities": {},
         "clientInfo": {"name": "curl-test", "version": "1.0"}
       }
     }'
   ```

   Use the `-v` flag to see response headers, and save the `mcp-session-id` header value. Every subsequent request needs it.

   :::note
   UiPath MCP Servers support protocol version `2025-06-18`. Sending `2025-11-25` (the latest MCP spec version) may work, since the server responds with the version it supports, but use `2025-06-18` to avoid unsupported behavior.
   :::

3. Send the initialized notification:

   ```shell
   curl -X POST "$SERVER_URL" \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -H "mcp-session-id: $SESSION_ID" \
     -d '{"jsonrpc": "2.0", "method": "notifications/initialized"}'
   ```

   The server responds with `202 Accepted` and no body. The server requires this notification before it processes tool requests.

4. List the available tools:

   ```shell
   curl -X POST "$SERVER_URL" \
     -H "Authorization: Bearer $TOKEN" \
     -H "mcp-session-id: $SESSION_ID" \
     -H "Content-Type: application/json" \
     -d '{
       "jsonrpc": "2.0",
       "id": 2,
       "method": "tools/list"
     }'
   ```

5. Call a tool:

   ```shell
   curl -X POST "$SERVER_URL" \
     -H "Authorization: Bearer $TOKEN" \
     -H "mcp-session-id: $SESSION_ID" \
     -H "Content-Type: application/json" \
     -d '{
       "jsonrpc": "2.0",
       "id": 3,
       "method": "tools/call",
       "params": {
         "name": "add",
         "arguments": {"a": 5, "b": 3}
       }
     }'
   ```

6. Close the session:

   ```shell
   curl -X DELETE "$SERVER_URL" \
     -H "Authorization: Bearer $TOKEN" \
     -H "mcp-session-id: $SESSION_ID"
   ```

## Testing with Postman

Postman supports MCP requests natively.

1. Create an MCP request in your collection.
2. Select **HTTP** as the transport, for Streamable HTTP.
3. Enter the MCP Server URL.
4. In the **Authorization** tab, configure **Bearer Token** authentication with your token.
5. Select **Connect**.

Postman handles the session lifecycle, including `initialize` and `notifications/initialized`, automatically.

:::tip
To send raw JSON-RPC requests manually instead, for example to control each request and response individually, use Postman as a plain REST client and follow the same request flow as [Testing with cURL](#testing-with-curl).
:::
