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

# [Beta] Create an McpConfig.

> [Beta] Create a new McpConfig to connect to an upstream MCP (Model Context Protocol) server. The config specifies the target endpoint and which tools are allowed.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json post /v1/mcp-configs
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/mcp-configs:
    post:
      tags:
        - mcp-configs
      summary: '[Beta] Create an McpConfig.'
      description: >-
        [Beta] Create a new McpConfig to connect to an upstream MCP (Model
        Context Protocol) server. The config specifies the target endpoint and
        which tools are allowed.
      operationId: createMcpConfig
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpConfigCreateParameters'
      responses:
        '200':
          description: McpConfig created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpConfigView'
        '400':
          description: Bad request. Name already exists or is invalid.
        '401':
          description: Unauthorized. Invalid or missing authentication.
        '403':
          description: Forbidden. Account does not have devbox capability.
        '500':
          description: Internal server error.
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Runloop from '@runloop/api-client';

            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });

            const mcpConfigView = await client.mcpConfigs.create({
              allowed_tools: ['string'],
              endpoint: 'endpoint',
              name: 'name',
            });

            console.log(mcpConfigView.id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            mcp_config_view = client.mcp_configs.create(
                allowed_tools=["string"],
                endpoint="endpoint",
                name="name",
            )
            print(mcp_config_view.id)
components:
  schemas:
    McpConfigCreateParameters:
      type: object
      description: Parameters required to create a new McpConfig.
      properties:
        name:
          type: string
          description: >-
            The human-readable name for the McpConfig. Must be unique within
            your account. The first segment before '-' is used as the service
            name for tool routing (e.g., 'github-readonly' uses 'github' as the
            service name).
        endpoint:
          type: string
          description: >-
            The target MCP server endpoint URL (e.g.,
            'https://mcp.example.com').
        allowed_tools:
          type: array
          items:
            type: string
          description: >-
            Glob patterns specifying which tools are allowed from this MCP
            server. Examples: ['*'] for all tools, ['github.search_*',
            'github.get_*'] for specific patterns.
        description:
          description: Optional description for this MCP configuration.
          type:
            - string
            - 'null'
      required:
        - name
        - endpoint
        - allowed_tools
    McpConfigView:
      type: object
      description: >-
        An McpConfig defines a configuration for connecting to an upstream MCP
        (Model Context Protocol) server. It specifies the target endpoint and
        which tools are allowed.
      properties:
        id:
          type: string
          description: The unique identifier of the McpConfig.
        name:
          type: string
          description: The human-readable name of the McpConfig. Unique per account.
        endpoint:
          type: string
          description: >-
            The target MCP server endpoint URL (e.g.,
            'https://mcp.example.com').
        allowed_tools:
          type: array
          items:
            type: string
          description: >-
            Glob patterns specifying which tools are allowed from this MCP
            server (e.g., ['github.search_*', 'github.get_*'] or ['*'] for all
            tools).
        description:
          description: Optional description for this MCP configuration.
          type:
            - string
            - 'null'
        create_time_ms:
          type: integer
          format: int64
          description: Creation time of the McpConfig (Unix timestamp in milliseconds).
      required:
        - id
        - name
        - endpoint
        - allowed_tools
        - create_time_ms
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````