---
title: "Get generated Python code for the MCP Server"
method: GET
path: "/v1/mcp-cp/{controlPlaneId}/mcp-servers/{mcpServerId}/code"
tags: ["MCP Servers"]
---

# Get generated Python code for the MCP Server

`GET /v1/mcp-cp/{controlPlaneId}/mcp-servers/{mcpServerId}/code`

**Pre-release Endpoint**
This endpoint is currently in beta and is subject to change.

Generates MCP server Python code from the OpenAPI specifications associated with the MCP server.

## Response `200`

Generated Python code for the MCP server

- MCPServerCodeResponse
  - `code` string, required — Generated Python code for the MCP server implementation

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/kong/apis/konnect-api-go-sdk.md) · [All operations](https://skmtc.net/kong/apis/konnect-api-go-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api-go-sdk/versions/f920f418f552/schema)
