# Create Custom MCP Server Create a new custom MCP server configuration. Allows you to configure your own MCP servers with custom authentication and tool settings. Credentials are encrypted before storage. #### Request Body **`name`** string required Human-readable name for the MCP configuration. **`server_url`** string required HTTPS URL to the MCP server. **`transport_type`** string required Transport protocol for MCP communication. Values: `sse`, `streamable_http`. **`auth_type`** string required Authentication method. Values: `none`, `api_key`, `bearer_token`, `oauth`. **`organization_id`** string required Organization ID (org_ prefixed string) this configuration belongs to. **`credentials`** object optional Authentication credentials (encrypted at rest). Structure depends on auth_type. **`tool_configuration`** object optional Tool configuration: `{enabled: bool, allowed_tools: [str]}`. ## Returns Created MCP configuration with generated ID (mcp_xxx). Request ```bash curl -X POST "https://api.aitronos.com/v1/mcp-configurations" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Production GitHub", "server_url": "https://mcp.github.example.com", "transport_type": "sse", "auth_type": "bearer_token", "organization_id": "org_xyz789", "credentials": { "type": "bearer", "token": "ghp_YOUR_TOKEN_HERE" }, "tool_configuration": { "enabled": true, "allowed_tools": ["search_code", "create_issue"] } }' ``` ```python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/mcp-configurations", headers={ "X-API-Key": api_key, "Content-Type": "application/json" }, json={ "name": "Production GitHub", "server_url": "https://mcp.github.example.com", "transport_type": "sse", "auth_type": "bearer_token", "organization_id": "org_xyz789", "credentials": { "type": "bearer", "token": os.environ.get("GITHUB_TOKEN") }, "tool_configuration": { "enabled": True, "allowed_tools": ["search_code", "create_issue"] } } ) response.raise_for_status() mcp = response.json() print(f"Created MCP: {mcp['id']}") ``` ```javascript const response = await fetch( "https://api.aitronos.com/v1/mcp-configurations", { method: "POST", headers: { "X-API-Key": process.env.FREDDY_API_KEY, "Content-Type": "application/json" }, body: JSON.stringify({ name: "Production GitHub", server_url: "https://mcp.github.example.com", transport_type: "sse", auth_type: "bearer_token", organization_id: "org_xyz789", credentials: { type: "bearer", token: process.env.GITHUB_TOKEN }, tool_configuration: { enabled: true, allowed_tools: ["search_code", "create_issue"] } }) } ); if (!response.ok) { throw new Error("Request failed"); } const mcp = await response.json(); console.log(`Created MCP: ${mcp.id}`); ``` 201 Created ```json { "id": "mcp_1234567890abcdef1234567890abcdef", "name": "Production GitHub", "type": "custom", "organization_id": "org_xyz789", "userId": "usr_abc123def456", "server_url": "https://mcp.github.example.com", "transportType": "sse", "authType": "bearer_token", "isActive": true, "connectionStatus": "disconnected", "lastConnectedAt": null, "errorMessage": null, "created_at": "2025-11-13T10:00:00Z", "updated_at": "2025-11-13T10:00:00Z" } ``` 400 Bad Request ```json { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "Invalid request parameters", "system_message": "Validation failed", "type": "validation_error", "status": 400, "trace_id": "req_xyz789", "timestamp": "2025-11-13T10:30:00Z" } } ```