---
title: "POST /mcp/oauth/token/"
method: POST
path: "/mcp/oauth/token/"
tags: ["mcp"]
---

# POST /mcp/oauth/token/

`POST /mcp/oauth/token/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/mcp/oauth/token/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

POST /mcp/oauth/token/ — Exchange code or refresh token for access token.

## Request body

- MCPOAuthTokenRequest
  - `grant_type` 'authorization_code' | 'refresh_token', required
  - `code` string
  - `refresh_token` string
  - `client_id` string, required
  - `client_secret` string, required
  - `redirect_uri` string

## Response `200`

OK

- MCPOAuthTokenResponse
  - `access_token` string, required
  - `token_type` 'Bearer', required
  - `expires_in` integer, required
  - `refresh_token` string
  - `scope` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `429`: Too many requests
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
