---
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 entered MCP credential. Accepts a bare token (sent as Bearer, unchanged from before), an explicit `Basic <value>` or `Bearer <value>`, or a complete `Authorization:` header.

## Request body

- MCPStoreTokenRequest — Request to store a manual Basic/Bearer credential or Authorization header.
  - `server_url` string, required — MCP server URL the credential authenticates against
  - `token` string, password, required — Bare Bearer token, Basic/Bearer value, or complete Authorization header

## Response `200`

Successful Response

- CredentialsMetaResponse
  - `id` string, required
  - `provider` string, required
  - `type` 'api_key' | 'oauth2' | 'user_password' | 'host_scoped' | 'device_code', 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
  - `mcp_auth_scheme` 'basic' | 'bearer', nullable — Manual authorization scheme for MCP credentials
  - `is_managed` boolean

## Other responses

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

## Changes

- **2026-09-07** `d3946c727d24` — 1 warning, 1 info
  - the `token` request property's maxLength was set to `8192`
  - added the optional property `mcp_auth_scheme` to the response with the `200` status
- **2026-08-20** `ae1be5efc67a` — 1 warning
  - added the new `device_code` enum value to the `type` response property for the response status `200`

[Change history](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/changes/api/mcp/token/post.md)

---

[API](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc.dev/significant-gravitas/apis/autogpt-agent-server/revisions/a8f415ca28ec?raw)
