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

# Get MCP server code snippets

> Returns ready-to-use connection snippets (Cursor, VS Code, Claude, Python, TypeScript, Windsurf, Codex) for the MCP server. `gatewayBaseURL` sets the proxy base URL in the snippets.



## OpenAPI

````yaml /openapi.json get /api/svc/v1/mcp/{mcpServerId}/code-snippets
openapi: 3.1.0
info:
  title: TrueFoundry API
  description: API for TrueFoundry
  version: 0.1.0
  contact: {}
servers:
  - url: https://{controlPlaneURL}
    variables:
      controlPlaneURL:
        default: app.truefoundry.com
        description: Control Plane URL
security: []
tags:
  - name: Agent
  - name: Agent Skills
  - name: Applications
  - name: Metrics
  - name: Apply
  - name: Artifacts
  - name: Audit Logs
  - name: Clusters
  - name: Jobs
  - name: Logs
  - name: MCP Servers V2
  - name: MLRepos
  - name: Model Deployments
  - name: Models
  - name: Personal Access Tokens
  - name: Prompts
  - name: Provider Integrations
  - name: SCIM v2
  - name: Secret Groups
  - name: Secrets
  - name: Teams
  - name: Traces
  - name: Users
  - name: Virtual Accounts
  - name: Role Bindings
  - name: Workspaces
paths:
  /api/svc/v1/mcp/{mcpServerId}/code-snippets:
    get:
      tags:
        - MCP Servers V2
      summary: Get MCP server code snippets
      description: >-
        Returns ready-to-use connection snippets (Cursor, VS Code, Claude,
        Python, TypeScript, Windsurf, Codex) for the MCP server.
        `gatewayBaseURL` sets the proxy base URL in the snippets.
      operationId: MCPServerV2.getCodeSnippet
      parameters:
        - name: mcpServerId
          required: true
          in: path
          description: MCP server id (the `id` returned by `GET /v1/mcp`, not the `name`).
          schema:
            example: mcp-01HXYZ...
            type: string
        - name: gatewayBaseURL
          required: true
          in: query
          description: >-
            Base URL of the MCP gateway. Substitutes `{{mcpProxyBaseURL}}` for
            the proxied MCP server URL in the snippets.
          schema:
            type: string
      responses:
        '200':
          description: Generated code snippets in different languages and formats.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeSnippetResponseDtoV2'
      security:
        - jwt: []
components:
  schemas:
    CodeSnippetResponseDtoV2:
      type: object
      properties:
        snippets:
          type: array
          items:
            $ref: '#/components/schemas/CodeSnippetIntegrationDetailsV2'
      required:
        - snippets
      title: CodeSnippetResponseDtoV2
      x-fern-type-name: CodeSnippetResponseDtoV2
    CodeSnippetIntegrationDetailsV2:
      type: object
      properties:
        code:
          type: string
          description: The code snippet content.
        language:
          type: string
          description: The programming language for syntax highlighting.
        icon:
          type: string
          description: Link to the icon for the integration.
        labelName:
          type: string
          description: The label for the integration.
        ctaConfig:
          description: Optional CTA configuration for the snippet.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/CtaConfigV2'
      required:
        - code
        - language
        - icon
        - labelName
      title: CodeSnippetIntegrationDetailsV2
      x-fern-type-name: CodeSnippetIntegrationDetailsV2
    CtaConfigV2:
      type: object
      properties:
        type:
          type: string
          description: 'Type of CTA: link for external URLs.'
        endpoint:
          type: string
          description: URL or protocol link (e.g., cursor://...).
        text:
          type: string
          description: Button label text.
        icon:
          type: string
          description: Optional icon name.
          nullable: true
      required:
        - type
        - endpoint
        - text
      title: CtaConfigV2
      x-fern-type-name: CtaConfigV2
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````