Skip to main content
POST
/
v1
/
identity
/
token
Get/Create Token
curl --request POST \
  --url https://api.example.com/v1/identity/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": "<string>"
}
'
{
  "access_token": "<string>",
  "refresh_token": "<string>",
  "expires_in": 123,
  "token_type": "<string>"
}

Get/Create Token

Get or create an MCP Identity Token (MIT) for a user. If the user doesn’t exist, a new identity is created.

Request

curl -X POST https://api.mcprank.com/v1/identity/token \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Content-Type: application/json" \
  -d '{"user_id": "user_123"}'

Body Parameters

user_id
string
required
Your user’s unique identifier in your system

Response

access_token
string
The MCP Identity Token (JWT) - use this in Authorization header for proxy requests
refresh_token
string
Token for refreshing the MIT when it expires
expires_in
integer
Seconds until the access token expires (typically 3600 = 1 hour)
token_type
string
Always “Bearer”

Example Response

{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "refresh_token": "rt_abc123...",
  "expires_in": 3600,
  "token_type": "Bearer"
}

Usage

After obtaining the MIT, use it in proxy requests:
curl https://api.mcprank.com/v1/proxy/google/gmail/v1/users/me/profile \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..."

Notes

  • The MIT is a JWT containing {user_id, developer_id, exp}
  • MITs expire after 1 hour - use the refresh token to get a new one
  • OAuth tokens for providers are stored server-side, not in the MIT
  • If the user hasn’t connected a provider, proxy requests will return 403