|
| 1 | +--- |
| 2 | +title: Gateway Client Configuration API |
| 3 | +description: Developer guide for the Gateway Client Configuration endpoint that provides pre-formatted configuration files for MCP clients to connect to the DeployStack Gateway |
| 4 | +--- |
| 5 | + |
| 6 | +# Gateway Client Configuration API |
| 7 | + |
| 8 | +The Gateway Client Configuration API provides pre-formatted configuration files for various MCP clients to connect to the local DeployStack Gateway. This eliminates manual configuration steps and reduces setup errors for developers. |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +The endpoint generates client-specific JSON configurations that users can directly use in their MCP clients (Claude Desktop, Cline, VSCode, Cursor, Windsurf) to connect to their local DeployStack Gateway running on `http://localhost:9095/sse`. |
| 13 | + |
| 14 | +## API Endpoint |
| 15 | + |
| 16 | +**Route:** `GET /api/gateway/config/:client` |
| 17 | + |
| 18 | +**Parameters:** |
| 19 | +- `:client` - The MCP client type (required) |
| 20 | + - Supported values: `claude-desktop`, `cline`, `vscode`, `cursor`, `windsurf` |
| 21 | + |
| 22 | +**Authentication:** Dual authentication support |
| 23 | +- Cookie-based authentication (web users) |
| 24 | +- OAuth2 Bearer token authentication (CLI users) |
| 25 | + |
| 26 | +**Required Permission:** `gateway.config:read` |
| 27 | +**Required OAuth2 Scope:** `gateway:config:read` |
| 28 | + |
| 29 | +## Client Configurations |
| 30 | + |
| 31 | +The endpoint supports multiple MCP client types, each with its own optimized configuration format. All configurations use the DeployStack Gateway's SSE endpoint: `http://localhost:9095/sse` |
| 32 | + |
| 33 | +**Supported Clients:** |
| 34 | +- `claude-desktop` - Claude Desktop application |
| 35 | +- `cline` - Cline VS Code extension |
| 36 | +- `vscode` - VS Code MCP extension |
| 37 | +- `cursor` - Cursor IDE |
| 38 | +- `windsurf` - Windsurf AI IDE |
| 39 | + |
| 40 | +**Configuration Source:** For the current client configuration formats and JSON structures, see the `generateClientConfig()` function in: |
| 41 | + |
| 42 | +```bash |
| 43 | +services/backend/src/routes/gateway/config/get-client-config.ts |
| 44 | +``` |
| 45 | + |
| 46 | +## Permission System |
| 47 | + |
| 48 | +### Role Assignments |
| 49 | + |
| 50 | +The `gateway.config:read` permission is assigned to: |
| 51 | +- **global_admin** - Basic access to get gateway configs they need |
| 52 | +- **global_user** - Basic access to get gateway configs they need |
| 53 | + |
| 54 | +### OAuth2 Scope |
| 55 | + |
| 56 | +The `gateway:config:read` OAuth2 scope: |
| 57 | +- **Purpose:** Enables CLI tools and OAuth2 clients to fetch gateway configurations |
| 58 | +- **Description:** "Generate client-specific gateway configuration files" |
| 59 | +- **Gateway Integration:** Automatically requested during gateway OAuth login |
| 60 | + |
| 61 | +## Future Enhancements |
| 62 | + |
| 63 | +### Additional Client Types |
| 64 | +- **Zed Editor** - Growing popularity in developer community |
| 65 | +- **Neovim** - Popular among command-line developers |
| 66 | +- **Custom Clients** - Generic JSON format for custom integrations |
| 67 | + |
| 68 | +### Configuration Customization |
| 69 | +- **Environment Variables** - Support for different gateway URLs |
| 70 | +- **TLS/SSL Support** - When gateway supports secure connections |
| 71 | +- **Authentication Tokens** - If gateway adds authentication in future |
| 72 | + |
| 73 | +## Related Documentation |
| 74 | + |
| 75 | +- [Backend API Security](/development/backend/api-security) - Security patterns and authorization |
| 76 | +- [Backend OAuth2 Server](/development/backend/oauth2-server) - OAuth2 implementation details |
| 77 | +- [Gateway OAuth Implementation](/development/gateway/oauth) - Gateway OAuth client |
| 78 | +- [Gateway SSE Transport](/development/gateway/sse-transport) - Gateway SSE architecture |
0 commit comments