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

# Get MCP JSON

> Generate a ready-to-commit project-scope .mcp.json for a Claude Code team rollout

## Overview

Returns the exact `.mcp.json` content to commit at a repository root so every Claude Code seat in that repo connects to Danube under one organization. The API key is the placeholder `${DANUBE_API_KEY}`, which Claude Code expands from each engineer's environment at connect time, so no secret lands in the repo. When an organization resolves for the caller, a `danube-org-id` header pins every seat to it.

The organization is resolved the same way as [Get Org Context](/api-reference/endpoint/claude_code_org_context): explicit selector, then the key's bound organization, then the personal organization. If resolution fails for a reason other than `401` or `404`, the template is still returned with `org` set to `null` and no `danube-org-id` header.

The step-by-step rollout is in the [Claude Code guide](/mcp-clients/claude-code).

**Auth:** Accepts either JWT or API key (`danube-api-key` header).

The Python and TypeScript SDKs do not wrap this endpoint yet. Call it directly.

## Query Parameters

<ParamField query="org_id" type="string">
  Organization UUID to pin. Requires membership.
</ParamField>

## Headers

<ParamField header="danube-org-id" type="string">
  Same as `org_id`. Ignored when the query parameter is present.
</ParamField>

## Response

<ResponseField name="file" type="string">
  Always `.mcp.json`
</ResponseField>

<ResponseField name="scope" type="string">
  Always `project`
</ResponseField>

<ResponseField name="mcp_json" type="object">
  The file content to commit

  <Expandable title="mcp_json object">
    <ResponseField name="mcpServers.danube.type" type="string">
      Always `http`
    </ResponseField>

    <ResponseField name="mcpServers.danube.url" type="string">
      The MCP connection URL, `https://mcp.danubeai.com/mcp` on the hosted deployment
    </ResponseField>

    <ResponseField name="mcpServers.danube.headers" type="object">
      `danube-api-key` set to the literal `${DANUBE_API_KEY}` placeholder, plus `danube-org-id` when an organization resolved
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="org" type="object">
  The pinned organization, or `null`

  <Expandable title="org object">
    <ResponseField name="org_id" type="string">
      Organization UUID
    </ResponseField>

    <ResponseField name="org_name" type="string">
      Organization display name
    </ResponseField>

    <ResponseField name="org_slug" type="string">
      Organization URL slug
    </ResponseField>

    <ResponseField name="role" type="string">
      The caller's role: `owner`, `admin`, `member` or `viewer`
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="instructions" type="string">
  Human-readable commit instructions, including the equivalent `claude mcp add` command
</ResponseField>

## Errors

| Code | Meaning                                                                |
| ---- | ---------------------------------------------------------------------- |
| 401  | No credentials, or no profile exists for the caller                    |
| 404  | The selected organization does not exist or the caller is not a member |

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -s "https://api.danubeai.com/v1/claude-code/mcp-json" \
    -H "danube-api-key: YOUR_API_KEY"
  ```

  ```bash cURL (write the file) theme={null}
  curl -s "https://api.danubeai.com/v1/claude-code/mcp-json" \
    -H "danube-api-key: YOUR_API_KEY" | jq '.mcp_json' > .mcp.json
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "file": ".mcp.json",
    "scope": "project",
    "mcp_json": {
      "mcpServers": {
        "danube": {
          "type": "http",
          "url": "https://mcp.danubeai.com/mcp",
          "headers": {
            "danube-api-key": "${DANUBE_API_KEY}",
            "danube-org-id": "8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10"
          }
        }
      }
    },
    "org": {
      "org_id": "8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10",
      "org_name": "Acme Robotics",
      "org_slug": "acme-robotics",
      "role": "admin"
    },
    "instructions": "Commit this as .mcp.json at the repo root (project scope). Each engineer sets DANUBE_API_KEY in their environment ... Equivalent CLI: claude mcp add --transport http --scope project danube https://mcp.danubeai.com/mcp --header 'danube-api-key: ${DANUBE_API_KEY}' --header 'danube-org-id: 8f0c2c4e-6c1b-4f7e-9d2a-3b5e1a9c7d10'"
  }
  ```
</ResponseExample>
