---
title: "Store a bearer token for an MCP server"
method: POST
path: "/api/mcp/token"
tags: ["v2", "mcp", "mcp"]
---

# Store a bearer token for an MCP server

`POST /api/mcp/token`

Store a manually provided bearer token as an MCP credential.

Used by the Copilot MCPSetupCard when the server doesn't support the MCP
OAuth discovery flow (returns 400 from /oauth/login).  Subsequent
``run_mcp_tool`` calls will automatically pick up the token via
``_auto_lookup_credential``.

## Request body

- MCPStoreTokenRequest — Request to store a bearer token for an MCP server that doesn't support OAuth.
  - `server_url` string, required — MCP server URL the token authenticates against
  - `token` string, password, required — Bearer token / API key for the MCP server

## Response `200`

Successful Response

- CredentialsMetaResponse
  - `id` string, required
  - `provider` string, required
  - `type` 'api_key' | 'oauth2' | 'user_password' | 'host_scoped', required
  - `title` string, nullable, required
  - `scopes` string[], nullable, required
  - `username` string, nullable, required
  - `host` string, nullable — Host pattern for host-scoped or MCP server URL for MCP credentials
  - `is_managed` boolean

## Other responses

- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/versions/382041c7ecb2/schema)
