---
title: "Add Session Mcp Server"
method: POST
path: "/v1/mcp/server/oauth/session"
tags: ["mcp_management"]
---

# Add Session Mcp Server

`POST /v1/mcp/server/oauth/session`

Temporarily cache an MCP server in memory without writing to the database

## Headers

- `litellm-changed-by` string, nullable — The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

## Request body

- NewMCPServerRequest
  - `alias` string, nullable
  - `allow_all_keys` boolean
  - `allowed_tools` string[], nullable
  - `approval_status` string, nullable — Server-managed: set by the endpoint; caller values are overridden.
  - `args` string[]
  - `audience` string, nullable
  - `auth_type` 'none' | 'api_key' | 'bearer_token' | 'basic' | 'authorization' | 'oauth2' | 'aws_sigv4' | 'token' | 'oauth2_token_exchange' | 'oauth2_id_jag' | 'true_passthrough' | 'oauth_delegate', nullable
  - `authorization_url` string, nullable
  - `available_on_public_internet` boolean
  - `byok_api_key_help_url` string, nullable
  - `byok_description` string[]
  - `command` string, nullable
  - `credentials` MCPCredentials
    - `audience` string, nullable
    - `auth_value` string, nullable
    - `aws_access_key_id` string, nullable
    - `aws_region_name` string, nullable
    - `aws_role_name` string, nullable
    - `aws_secret_access_key` string, nullable
    - `aws_service_name` string, nullable
    - `aws_session_name` string, nullable
    - `aws_session_token` string, nullable
    - `client_assertion_signing_alg` string, nullable
    - `client_id` string, nullable
    - `client_private_key` string, nullable
    - `client_private_key_id` string, nullable
    - `client_secret` string, nullable
    - `id_jag_resource` string, nullable
    - `id_jag_resource_token_endpoint` string, nullable
    - `redirect_uris` string[], nullable
    - `scopes` string[], nullable
    - `subject_token_type` string, nullable
    - `token_endpoint_auth_method` 'client_secret_basic' | 'client_secret_post', nullable
    - `token_exchange_endpoint` string, nullable
    - `token_exchange_profile` string, nullable
    - `upstream_resource` string, nullable
    - `upstream_token_header` string, nullable
  - `dcr_bridge` boolean, nullable
  - `delegate_auth_to_upstream` boolean
  - `description` string, nullable
  - `env` object
  - `env_vars` MCPEnvVar[], nullable
    - `description` string, nullable
    - `name` string, required
    - `scope` 'global' | 'user' — Scope for an MCP server environment variable. - ``global``: value is provided by the admin and used for all users. - ``user``: each user must provide their own value via the per-user env-var endpoint. The admin-supplied ``value`` is treated as a placeholder/hint and is not used at request time.
    - `value` string
  - `extra_headers` string[], nullable
  - `instructions` string, nullable
  - `is_byok` boolean
  - `issuer` string, nullable
  - `max_concurrent_requests` integer, nullable
  - `mcp_access_groups` string[]
  - `mcp_info` object, nullable
  - `oauth2_flow` 'client_credentials' | 'authorization_code', nullable
  - `oauth_passthrough` boolean
  - `registration_url` string, nullable
  - `server_id` string, nullable
  - `server_name` string, nullable
  - `source_url` string, nullable
  - `spec_path` string, nullable
  - `static_headers` object, nullable
  - `subject_token_type` string, nullable
  - `submitted_at` string, date-time, nullable — Server-managed: set by the endpoint; caller values are overridden.
  - `submitted_by` string, nullable — Server-managed: set by the endpoint; caller values are overridden.
  - `timeout` number, nullable
  - `token_exchange_endpoint` string, nullable
  - `token_exchange_profile` string, nullable
  - `token_url` string, nullable
  - `tool_name_to_description` object, nullable
  - `tool_name_to_display_name` object, nullable
  - `transport` 'sse' | 'http' | 'stdio'
  - `url` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-23** `7ed45f30a5f0` — 2 info
  - api tag `mcp_management` added
  - api tag `mcp` removed
- **2026-09-21** `6246f8d427b7` — 2 info
  - api tag `mcp` added
  - api tag `mcp_management` removed
- **2026-09-19** `c357baf422ab` — 2 info
  - api tag `mcp_management` added
  - api tag `mcp` removed
- **2026-09-18** `082b5fabd909` — 1 info
  - endpoint added
- **2026-09-16** `7afc3544d64d` — 1 breaking
  - api path removed without deprecation

[Full history](https://skmtc.dev/flock/apis/litellm-api/changes/v1/mcp/server/oauth/session/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/7ed45f30a5f0?raw)
