MCP Gateway
ApiMcp bundle proxy

Handle Bundle Mcp Request

Handle MCP JSON-RPC requests for bundles. This endpoint exposes bundles via the MCP protocol. Bundles act as transparent tool aggregators that always list all their enabled tools directly. For search/execute mode with semantic search, use the unified gateway endpoint (/mcp/gateway) which respects user's gateway_settings. The bundle_key serves as authentication - only valid keys can access bundles. Session Management: - If Mcp-Session-Id header is provided, uses existing session - Otherwise, creates a new session (anonymous if no user_id) - Returns session ID in Mcp-Session-Id response header Args: bundle_key: The bundle's unique sharing key (auth). request: The JSON-RPC request body. http_response: FastAPI response object for setting headers. session: Database session (injected). server_repo: Server repository (injected). mcp_client: MCP client service (injected). audit_logger: Audit logger (injected). embeddings: Embeddings service (injected). cred_service: Credential resolution service (injected). session_service: Session service (injected). user_id: Optional authenticated user's ID. x_mcp_session_id: Optional session ID from request header. Returns: JSONResponse with the JSON-RPC response and Mcp-Session-Id header. Raises: HTTPException: 404 if bundle not found, 500 if processing fails.

POST
/mcp/bundle/{bundle_key}

Authorization

User API Key
AuthorizationBearer <token>

User API key (mgw_usr_live_* or mgw_usr_test_*)

In: header

Path Parameters

bundle_key*string
Length1 <= length <= 255

Header Parameters

Mcp-Session-Id?|
X-MCP-Session-ID?|
access_token?|

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[key: string]?any

Response Body

application/json

application/json

curl -X POST "https://loading/mcp/bundle/string" \  -H "Content-Type: application/json" \  -d '{}'
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}