---
title: "Connect a remote MCP server with a token you already have, or one that needs none"
method: POST
path: "/connections/mcp/token"
tags: ["Setup · Connections"]
---

# Connect a remote MCP server with a token you already have, or one that needs none

`POST /connections/mcp/token`

## Request

- Base URL: `https://api.ziggsai.com`
- URL: `https://api.ziggsai.com/connections/mcp/token`
- Auth: HTTP bearer

For servers that authenticate with a token the user mints themselves (GitHub's remote MCP server takes a personal access token) and for servers whose authorization server supports neither dynamic registration nor a pre-registered Ziggs client. The token is proved with one tools/list, then stored encrypted as a connection with provider "mcp"; it is never returned, and agents reach the server through the gateway under a grant exactly as they do for an OAuth-acquired connection.

## Request body

- ConnectMcpWithTokenDto
  - `serverUrl` string, required: Remote MCP server URL (https)
  - `token` string: Bearer token for that server (e.g. a personal access token). Stored encrypted in the vault and never returned. Omit only with keyless: true.
  - `keyless` boolean: The server needs no credential at all. The connection is created with an empty vault entry and the gateway sends no Authorization header: which is checked by connecting without one before anything is stored.
  - `label` string: Label for the account this token belongs to, shown next to the connection. Defaults to the server's host.

## Response `201`

Created

- McpConnectResponseSchema
  - `connection` ConnectionViewSchema, required
    - `connectionId` string, required
    - `ownerId` string, required
    - `provider` string, required
    - `externalAccountLabel` string, nullable
    - `externalAccountId` string, nullable
    - `scopesGranted` string[]
    - `mcpServerUrl` string, nullable: Remote MCP server URL for `provider: "mcp"` connections.
    - `status` string, required
    - `createdAt` string, date-time
  - `tools` string[], required

---

[API](https://skmtc.dev/ziggsai/apis/ziggs-developer-api.md) · [All operations](https://skmtc.dev/ziggsai/apis/ziggs-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ziggsai/apis/ziggs-developer-api/revisions/eda79030e072?raw)
