---
title: "Token Endpoint"
method: POST
path: "/{mcp_server_name}/token"
tags: ["mcp"]
---

# Token Endpoint

`POST /{mcp_server_name}/token`

Accept the authorization code from client and exchange it for OAuth token.
Supports PKCE flow by forwarding code_verifier to upstream provider.

1. Call the token endpoint with PKCE parameters
2. Store the user's token in the db - and generate a LiteLLM virtual key
3. Return the token
4. Return a virtual key in this response

## Path parameters

- `mcp_server_name` string, nullable, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-21** `6246f8d427b7` — 2 info
  - api tag `mcp` added
  - api tag `mcp_discoverable` removed
- **2026-09-20** `3b2b241e4b0b` — 2 info
  - api tag `mcp_discoverable` added
  - api tag `mcp` removed
- **2026-09-18** `082b5fabd909` — 1 info
  - endpoint added
- **2026-09-16** `7afc3544d64d` — 1 breaking
  - api path removed without deprecation
- **2026-09-14** `df0c3a8ce5ea` — 1 info
  - endpoint added

[Full history](https://skmtc.dev/flock/apis/litellm-api/changes/:mcp_server_name/token/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flock/apis/litellm-api/revisions/c71315002afa?raw)
