You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,6 @@ you may specify the base URL(s) above to the appropriate API endpoint.
61
61
62
62
---
63
63
64
-
65
64
>[!NOTE]
66
65
>See[Supported APIs](#supported-apis) section below for a comprehensive list.
67
66
@@ -73,9 +72,11 @@ AI Bridge collects:
73
72
- All token usage
74
73
- All tool invocations
75
74
75
+
All of these records are associated to an "interception" record, which maps 1:1 with requests received from clients but may involve several interactions with upstream providers.
76
+
76
77
##Implementation Details
77
78
78
-
`coderd` runs an in-memory instance ofhttps://github.com/coder/aibridge. In future releases we will support running external instances for higher throughput and complete memory isolation from`coderd`.
79
+
`coderd` runs an in-memory instance of`aibridged`, whose logic is mostly contained inhttps://github.com/coder/aibridge. In future releases we will support running external instances for higher throughput and complete memory isolation from`coderd`.
79
80
80
81
<details>
81
82
<summary>See a diagram of how AI Bridge interception works</summary>
@@ -143,6 +144,7 @@ AI Bridge can connect to MCP servers and inject tools automatically, enabling yo
143
144
144
145
>[!NOTE]
145
146
>Only MCP servers which support OAuth2 Authorization are supported currently. In future releases we will support[optional authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#protocol-requirements).
147
+
>
146
148
>[_Streamable HTTP_](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) is the only supported transport currently. In future releases we will support the (now deprecated)[_Server-Sent Events_](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#backwards-compatibility) transport.
147
149
148
150
AI Bridge makes use of[External Auth](../admin/external-auth/index.md) applications, as they define OAuth2 connections to upstream services. If your External Auth application hosts a remote MCP server, you can configure AI Bridge to connect to it, retrieve its tools and inject them into requests automatically - all while using each individual user's access token.
@@ -193,9 +195,16 @@ If you have the `oauth2` and `mcp-server-http` experiments enabled, Coder's own
193
195
194
196
##Troubleshooting
195
197
196
-
- Too many tools
197
-
- Coder MCP tools not being listed
198
-
- External Auth tools not being injected
198
+
-**Too many tools**: should you receive an error like`Invalid 'tools': array too long. Expected an array with maximum length 128, but got an array with length 132 instead`, you can reduce the number by filtering out tools using the allow/deny patterns documented in the[MCP](#mcp) section.
199
+
200
+
-**Coder MCP tools not being injected**: in order for Coder MCP tools to be injected, the internal MCP server needs to be active. Follow the instructions in the[MCP Server](mcp-server.md) page to enable it.
201
+
202
+
-**External Auth tools not being injected**: this is generally due to the requesting user not being authenticated against the External Auth app; when this is the case, no attempt is made to connect to the MCP server.
203
+
204
+
##Known Issues / Limitations
205
+
206
+
- Codex CLI currently does not work with AI Bridge due to a JSON marshaling issue:https://github.com/coder/aibridge/issues/19
207
+
- Claude Code web searches do not report correctly:https://github.com/coder/aibridge/issues/11
199
208
200
209
##Supported APIs
201
210
@@ -204,7 +213,7 @@ API support is broken down into two categories:
204
213
-**Intercepted**: requests are intercepted, audited, and augmented - full AI Bridge functionality
205
214
-**Passthrough**: requests are proxied directly to the upstream, no auditing or augmentation takes place
206
215
207
-
Where relevant, both streaming ando
216
+
Where relevant, both streaming andnon-streaming requests are supported.