> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Mcp Oauth Provider

> Create an OAuth provider via MCP auto-discovery.



## OpenAPI

````yaml https://api.host.langchain.com/openapi.json post /v2/auth/providers/mcp-discover
openapi: 3.1.0
info:
  title: LangSmith Deployment Control Plane API
  description: >
    The LangSmith Deployment Control Plane API is used to programmatically
    create and manage

    Agent Server deployments. For example, the APIs can be orchestrated to

    create custom CI/CD workflows.


    ## Host

    https://api.host.langchain.com


    ## Authentication

    To authenticate with the LangSmith Deployment Control Plane API, set the
    `X-Api-Key` header

    to a valid [LangSmith API
    key](https://docs.langchain.com/langsmith/create-account-api-key#create-an-api-key).


    ## Versioning

    Each endpoint path is prefixed with a version (e.g. `v1`, `v2`).


    ## Quick Start

    1. Call `POST /v2/deployments` to create a new Deployment. The response body
    contains the Deployment ID (`id`) and the ID of the latest (and first)
    revision (`latest_revision_id`).

    1. Call `GET /v2/deployments/{deployment_id}` to retrieve the Deployment.
    Set `deployment_id` in the URL to the value of Deployment ID (`id`).

    1. Poll for revision `status` until `status` is `DEPLOYED` by calling `GET
    /v2/deployments/{deployment_id}/revisions/{latest_revision_id}`.

    1. Call `PATCH /v2/deployments/{deployment_id}` to update the deployment.
  version: 0.1.0
servers: []
security: []
paths:
  /v2/auth/providers/mcp-discover:
    post:
      tags:
        - Auth Service (v2)
      summary: Create Mcp Oauth Provider
      description: Create an OAuth provider via MCP auto-discovery.
      operationId: create_mcp_oauth_provider_v2_auth_providers_mcp_discover_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPOAuthProviderCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthProviderResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - API Key: []
        - Tenant ID: []
        - Bearer Auth: []
components:
  schemas:
    MCPOAuthProviderCreateRequest:
      properties:
        provider_id:
          type: string
          title: Provider Id
        name:
          type: string
          title: Name
        mcp_server_url:
          type: string
          title: Mcp Server Url
      type: object
      required:
        - provider_id
        - name
        - mcp_server_url
      title: MCPOAuthProviderCreateRequest
      description: Request model for creating OAuth provider via MCP auto-discovery.
    OAuthProviderResponse:
      properties:
        id:
          type: string
          title: Id
        organization_id:
          type: string
          title: Organization Id
        provider_id:
          type: string
          title: Provider Id
        name:
          type: string
          title: Name
        client_id:
          type: string
          title: Client Id
        auth_url:
          type: string
          title: Auth Url
        token_url:
          type: string
          title: Token Url
        uses_pkce:
          type: boolean
          title: Uses Pkce
        code_challenge_method:
          anyOf:
            - type: string
            - type: 'null'
          title: Code Challenge Method
        provider_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Type
        mcp_server_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Mcp Server Url
        token_endpoint_auth_method:
          type: string
          title: Token Endpoint Auth Method
          default: client_secret_post
        is_dynamic_client:
          type: boolean
          title: Is Dynamic Client
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - organization_id
        - provider_id
        - name
        - client_id
        - auth_url
        - token_url
        - uses_pkce
        - code_challenge_method
        - created_at
        - updated_at
      title: OAuthProviderResponse
      description: Response model for OAuth provider.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````