# Discover MCP Servers

`GET /api/mcp/discover`

## Description
List the workflow MCP servers the caller can use, with the URL to configure in an MCP client. A workspace key sees its own workspace. Scoped and organization keys see only workspaces their grants reach. Servers in archived workspaces are left out. The list is not paginated.

## Responses

### 200 — The servers the caller can use.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "toolCount": {
            "type": "integer",
            "description": "Number of workflow tools the server exposes."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "description": "The server URL to configure in an MCP client."
          }
        }
      }
    },
    "authentication": {
      "type": "object",
      "description": "How to authenticate against each server URL.",
      "properties": {
        "method": {
          "type": "string"
        },
        "header": {
          "type": "string"
        }
      }
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 403 — A workspace key has no workspace scope.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "error": {
      "type": "string"
    }
  }
}
```
