---
title: "Generate MCP URL with custom parameters"
method: POST
path: "/api/v3.1/mcp/servers/generate"
tags: ["MCP", "Servers", "URL Generation"]
---

# Generate MCP URL with custom parameters

`POST /api/v3.1/mcp/servers/generate`

Generates a Model Control Protocol (MCP) URL for an existing server with custom query parameters. The URL includes user-specific parameters and configuration flags that control the behavior of the MCP connection.

## Request body

- object — Request parameters for generating an MCP URL
  - `mcp_server_id` string, required — Unique identifier of the MCP server to generate URL for
  - `managed_auth_by_composio` boolean — Flag indicating if Composio manages authentication
  - `user_ids` string[] — List of user identifiers for whom the URL is generated
  - `connected_account_ids` string[] — List of connected account identifiers

## Response `200`

Successfully generated MCP URL. Returns the complete URL with all specified query parameters.

- object — Response containing the generated MCP URLs
  - `mcp_url` string, required — Base MCP URL without any query parameters
  - `connected_account_urls` string[], required — List of URLs generated for each connected account ID
  - `user_ids_url` string[], required — List of URLs generated for each user ID

## Other responses

- `400` — Bad request. The request body may be invalid or missing required parameters.
- `401` — Unauthorized. Authentication is required or the provided credentials are invalid.
- `403` — Forbidden. The authenticated user does not have permission to access this MCP server.
- `404` — MCP server not found. No server with the specified ID exists or it has been deleted.
- `500` — Internal server error. An unexpected error occurred while processing the request.

---

[API](https://skmtc.net/composiohq/apis/composio-platform-api-v3-1.md) · [All operations](https://skmtc.net/composiohq/apis/composio-platform-api-v3-1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/composiohq/composio-platform-api-v3-1/versions/4239836857f8/schema)
