---
title: "Create a Context Source"
method: POST
path: "/v1/context-sources"
tags: ["Context Sources"]
---

# Create a Context Source

`POST /v1/context-sources`

Create a Context Source in the Konnect Organization.

## Request body

- union
  - ApiResourcePayload
    - `name` string, required — The name of the Context Source. Must be unique within the organization and follow machine name conventions.
    - `display_name` string, required — The display name of the Context Source.
    - `description` string, required — A description of the Context Source.
    - `labels` Labels, required — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `type` 'api', required — The type of the Context Source.
    - `source` union, required — The source of the Context Source used in create and update requests.
      - MCPResourceSourceAPICatalogPayload — An MCP resource sourced from an API catalog entry.
        - `type` 'api_catalog', required
        - `config` MCPResourceSourceAPICatalogConfigPayload, required — Identifies the API catalog entry the Context Source was sourced from.
          - `api_id` string, uuid, required — The unique identifier for the API catalog entry.
          - `api_version_id` string, uuid, required — The unique identifier for the API catalog entry version.
          - `base_url` string, uri, nullable — Base URL to use when calling backing API service. This URL will be used over what is defined in the resource specification if provided Must include a protocol (http/https), and cannot contain query parameters or fragments.
          - `headers` object — Default headers sent to backing API service.
      - MCPResourceSourceRawInput — A raw spec upload used when creating or updating an MCP resource.
        - `type` 'raw', required — The type of the Context Source source.
        - `config` object, required
          - `spec` string, required — The raw contents of the API spec in JSON or YAML format.
          - `base_url` string, uri, nullable — Base URL to use when calling backing API service. This URL will be used over what is defined in the resource specification if provided Must include a protocol (http/https), and cannot contain query parameters or fragments.
          - `headers` object — Default headers sent to backing API service.
  - McpServerResourcePayload
    - `name` string, required — The name of the Context Source. Must be unique within the organization and follow machine name conventions.
    - `display_name` string, required — The display name of the Context Source.
    - `description` string, required — A description of the Context Source.
    - `labels` Labels, required — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `type` 'mcp_server', required — The type of the MCP resource.
    - `source` McpServerResourceSourcePayload, required
      - `type` 'remote_mcp_server', required — The type of the Context Source source.
      - `config` object, required — Configuration of a remote MCP Server.
        - `url` string, uri, required — URL to a remote MCP Server that must include a protocol (http/https), and cannot contain query parameters or fragments.
        - `headers` object, required — Headers to be used when making proxying requests to a MCP Server

## Response `201`

A response to creating a Context Source.

- union
  - ApiResource — The MCP resource object.
    - `id` string, uuid, required — The unique identifier for the Context Source.
    - `name` string, required — The unique name of the Context Source.
    - `display_name` string, required — The display name of the Context Source.
    - `description` string, required — A description of the Context Source.
    - `labels` Labels, required — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
    - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.
    - `type` 'api', required — The type of the Context Source.
    - `source` union, required — The source of an API Context Source.
      - MCPResourceSourceAPICatalog — An MCP resource sourced from an API catalog entry.
        - `type` 'api_catalog', required
        - `config` MCPResourceSourceAPICatalogConfig, required — Identifies the API catalog entry the Context Source was sourced from.
          - `api_id` string, uuid, required — The unique identifier for the API catalog entry.
          - `api_version_id` string, uuid, required — The unique identifier for the API catalog entry version.
          - `base_url` string, nullable, required — Base URL to use when calling backing API service. This URL will be used over what is defined in the resource specification if provided Must include a protocol (http/https), and cannot contain query parameters or fragments.
          - `headers` object, required — Default headers sent to backing API service.
      - MCPResourceSourceRaw — An MCP resource sourced from a raw spec upload.
        - `type` 'raw', required
        - `config` CommonApiResourceConfigResponse, required
          - `base_url` string, nullable, required — Base URL to use when calling backing API service. This URL will be used over what is defined in the resource specification if provided Must include a protocol (http/https), and cannot contain query parameters or fragments.
          - `headers` object, required — Default headers sent to backing API service.
  - McpServerResource — The MCP resource object.
    - `id` string, uuid, required — The unique identifier for the Context Source.
    - `name` string, required — The unique name of the Context Source.
    - `display_name` string, required — The display name of the Context Source.
    - `description` string, required — A description of the Context Source.
    - `labels` Labels, required — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
    - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
    - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.
    - `type` 'mcp_server', required — The type of the Context Source.
    - `source` MCPResourceRemoteMcpServerPayload, required
      - `type` 'remote_mcp_server', required — The type of the Context Source source.
      - `config` object, required — Configuration of a remote MCP Server.
        - `url` string, uri, required — URL to a remote MCP Server that must include a protocol (http/https), and cannot contain query parameters or fragments.
        - `headers` object, required — Headers to be used when making proxying requests to a MCP Server

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `409` — Conflict

## Changes

- **2026-09-30** `de79e1192f11` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kong/apis/konnect-api-go-sdk/changes/v1/context-sources/post.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api-go-sdk.md) · [All operations](https://skmtc.dev/kong/apis/konnect-api-go-sdk/llms.txt) · [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api-go-sdk/revisions/de79e1192f11?raw)
