---
orphan: true
---

# Detect MCP connection

Probes the MCP service and returns discoverable tools; probing does not save connections.

```text
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/connections/actions/probe-mcp
```

## Before you call

The example below uses:

- `$AI_STUDIO_API_KEY`: The actual personal access token, passed through the `X-API-Key` Header.
- `$WORKSPACE_ID`: Target workspace ID, passed through `X-Workspace-ID` Header.

## Request example

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/connections/actions/probe-mcp" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "endpoint_uri": "https://mcp.example.com",
    "transport": "http-streaming"
  }'
```

## Request body

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `endpoint_uri` | string | No | MCP service address to probe. Required if `connection_id` is not provided. |
| `connection_id` | string | No | The saved connection ID. Required if `endpoint_uri` is not provided. |
| `auth_type` | string | No | Authentication type. |
| `api_key_header` | string | No | The request header name used by API Key. |
| `credential` | object | No | Credentials to use when probing, can contain `bearer_token`, `api_key`, `basic_username`, `basic_password`, or `custom_headers`. |
| `transport` | string | No | MCP transmission method: `sse` or `http-streaming`. Use `http-streaming` when not provided. |

## Successful response

Returns `200` and the found tool on success.

```json
{"code":0,"data":{"tools":[]}}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `data.tool_count` | integer | The number of tools found. |
| `data.tools` | array | Tools returned by MCP service. |
| `data.protocol_version` | string | MCP protocol version; will not be returned if not provided. |

## Error response

```json
{"code":2,"message":"invalid request body"}
```
