chore!: allow coder MCP tools to not be injected (#20713)

Currently, when AI Bridge is enabled AND the `oauth2` and
`mcp-server-http` experiments are enabled we inject Coder's MCP tools
into all intercepted AI Bridge requests.

This PR introduces a config to control this behaviour.

**NOTE:** this is a backwards-incompatible change; previously these
tools would be injected automatically, now this setting will need to be
explicitly enabled.

---------

Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
Danny Kopping
2025-11-12 11:23:01 +02:00
committed by GitHub
parent f543a87b78
commit 04f809f2d0
13 changed files with 96 additions and 29 deletions
+1
View File
@@ -175,6 +175,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"small_fast_model": "string"
},
"enabled": true,
"inject_coder_mcp_tools": true,
"openai": {
"base_url": "string",
"key": "string"
+11 -6
View File
@@ -389,6 +389,7 @@
"small_fast_model": "string"
},
"enabled": true,
"inject_coder_mcp_tools": true,
"openai": {
"base_url": "string",
"key": "string"
@@ -398,12 +399,13 @@
### Properties
| Name | Type | Required | Restrictions | Description |
|-------------|----------------------------------------------------------------------|----------|--------------|-------------|
| `anthropic` | [codersdk.AIBridgeAnthropicConfig](#codersdkaibridgeanthropicconfig) | false | | |
| `bedrock` | [codersdk.AIBridgeBedrockConfig](#codersdkaibridgebedrockconfig) | false | | |
| `enabled` | boolean | false | | |
| `openai` | [codersdk.AIBridgeOpenAIConfig](#codersdkaibridgeopenaiconfig) | false | | |
| Name | Type | Required | Restrictions | Description |
|--------------------------|----------------------------------------------------------------------|----------|--------------|-------------|
| `anthropic` | [codersdk.AIBridgeAnthropicConfig](#codersdkaibridgeanthropicconfig) | false | | |
| `bedrock` | [codersdk.AIBridgeBedrockConfig](#codersdkaibridgebedrockconfig) | false | | |
| `enabled` | boolean | false | | |
| `inject_coder_mcp_tools` | boolean | false | | |
| `openai` | [codersdk.AIBridgeOpenAIConfig](#codersdkaibridgeopenaiconfig) | false | | |
## codersdk.AIBridgeInterception
@@ -695,6 +697,7 @@
"small_fast_model": "string"
},
"enabled": true,
"inject_coder_mcp_tools": true,
"openai": {
"base_url": "string",
"key": "string"
@@ -2851,6 +2854,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"small_fast_model": "string"
},
"enabled": true,
"inject_coder_mcp_tools": true,
"openai": {
"base_url": "string",
"key": "string"
@@ -3365,6 +3369,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"small_fast_model": "string"
},
"enabled": true,
"inject_coder_mcp_tools": true,
"openai": {
"base_url": "string",
"key": "string"
+11
View File
@@ -1752,3 +1752,14 @@ The model to use when making requests to the AWS Bedrock API.
| Default | <code>global.anthropic.claude-haiku-4-5-20251001-v1:0</code> |
The small fast model to use when making requests to the AWS Bedrock API. Claude Code uses Haiku-class models to perform background tasks. See https://docs.claude.com/en/docs/claude-code/settings#environment-variables.
### --aibridge-inject-coder-mcp-tools
| | |
|-------------|-----------------------------------------------------|
| Type | <code>bool</code> |
| Environment | <code>$CODER_AIBRIDGE_INJECT_CODER_MCP_TOOLS</code> |
| YAML | <code>aibridge.inject_coder_mcp_tools</code> |
| Default | <code>false</code> |
Whether to inject Coder's MCP tools into intercepted AI Bridge requests (requires the "oauth2" and "mcp-server-http" experiments to be enabled).