Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33c54ea

Browse files
committed
Refactor AI Bridge documentation
Revised AI Bridge documentation to improve clarity, organization, and detail. Updated instructions for base URL configuration, authentication, and using AI Bridge with Coder Tasks. Streamlined sections on tool injection and added known issues. Updated provider configuration instructions for OpenAI, Anthropic, and Amazon Bedrock. Enhanced diagram and troubleshooting guidance.
1 parentde024cb commit33c54ea

File tree

6 files changed

+53
-60
lines changed

6 files changed

+53
-60
lines changed

‎docs/ai-coder/ai-bridge/client-config.md‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Once AI Bridge is enabled on the server, your users need to configure their AI coding tools to use it. This section explains how users should configure their clients to connect to AI Bridge.
44

5-
###Base URLs
5+
##Base URLs
66

77
The exact configuration method varies by client — some use environment variables, others use configuration files or UI settings:
88

@@ -11,14 +11,19 @@ The exact configuration method varies by client — some use environment variabl
1111

1212
Replace`coder.example.com` with your actual Coder deployment URL.
1313

14-
###Authentication
14+
##Authentication
1515

1616
Instead of distributing provider-specific API keys (OpenAI/Anthropic keys) to users, they authenticate to AI Bridge using their**Coder session token** or**API key**:
1717

1818
-**OpenAI clients**: Users set`OPENAI_API_KEY` to their Coder session token or API key
1919
-**Anthropic clients**: Users set`ANTHROPIC_API_KEY` to their Coder session token or API key
2020

21-
####Coder Templates Pre-configuration
21+
##Using AI Bridge with Coder Tasks
22+
23+
[Coder Tasks](../tasks.md) provides a framework for using agents like Claude Code to complete background development operations. To route those agents through AI Bridge:
24+
25+
- Enable AI Bridge at the control plane and configure the upstream provider keys.
26+
- Inject the AI Bridge base URLs and API keys into the Task environment (for example by setting`OPENAI_BASE_URL` and`OPENAI_API_KEY`).
2227

2328
Template admins can pre-configure authentication in templates using[`data.coder_workspace_owner.me.session_token`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner#session_token-1) to automatically configure the workspace owner's credentials.
2429

@@ -42,24 +47,26 @@ resource "coder_agent" "dev" {
4247
module "claude-code" {
4348
count = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0
4449
source = "dev.registry.coder.com/coder/claude-code/coder"
45-
version = ">= 3.2.0"
50+
version = ">= 3.4.0"
4651
agent_id = coder_agent.dev.id
4752
workdir = "/home/coder/project"
48-
order = 999
4953
claude_api_key = data.coder_workspace_owner.me.session_token # To Enable AI Bridge integration
5054
ai_prompt = data.coder_parameter.ai_prompt.value
5155
... # other claude-code configuration
5256
}
53-
5457
```
5558

56-
The same approach can be applied to pre-configure additional AI coding assistants by updating the base URL and API key settings.
59+
This setup keeps agent execution within Coder while applying the same auditing and MCP policies as IDE clients.
60+
61+
###Using AI Bridge without Tasks
62+
63+
AI Bridge also works with IDE-native assistants inside workspaces. Configure the IDE extension or desktop client to point at the AI Bridge endpoints and rely on the workspace's environment variables for authentication. This is the fastest path to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Tasks.
5764

58-
####Generic API key generation
65+
###Generic API key generation
5966

6067
Users can generate a Coder API key using either the CLI or the web UI. Follow the instructions at[Sessions and API tokens](../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself) to generate a Coder API key.
6168

62-
###Tested clients
69+
##Tested clients
6370

6471
The table below shows tested AI clients and their compatibility with AI Bridge. Click each client name for vendor-specific configuration instructions. Report issues or share compatibility updates in the[aibridge](https://github.com/coder/aibridge) issue tracker.
6572

@@ -86,7 +93,7 @@ Legend: ✅ works, ⚠️ limited support, ❌ not supported, ❓ not yet verifi
8693
>[!NOTE]
8794
>Click the respective client title to view the vendor-specific instructions for configuring the client.
8895
89-
####Compatibility overview
96+
###Compatibility overview
9097

9198
Most AI coding assistants that support custom base URLs can work with AI Bridge. Client-specific requirements vary:
9299

‎docs/ai-coder/ai-bridge/index.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
![AI bridge diagram](../../images/aibridge/aibridge_diagram.png)
44

5-
Bridge is a smart proxy for AI. It acts as a man-in-the-middle between your users' coding agents / IDEs
5+
AIBridge is a smart proxy for AI. It acts as a man-in-the-middle between your users' coding agents / IDEs
66
and providers like OpenAI and Anthropic. By intercepting all the AI traffic between these clients and
7-
the upstream APIs, Bridge can record user prompts, token usage, and tool invocations.
7+
the upstream APIs,AIBridge can record user prompts, token usage, and tool invocations.
88

9-
Bridge solves 3 key problems:
9+
AIBridge solves 3 key problems:
1010

1111
1.**Centralized authn/z management**: no more issuing & managing API tokens for OpenAI/Anthropic usage.
1212
Users use their Coder session or API tokens to authenticate with`coderd` (Coder control plane), and
@@ -28,4 +28,9 @@ If you are an administrator or devops leader looking to:
2828
- Investigate opportunities for AI automation
2929
- Uncover the high-leverage use cases from experienced engineers
3030

31-
We advise trying Bridge as self-hosted proxy to monitor LLM usage agnostically across AI powered IDEs like Cursor and headless agents like Claude Code.
31+
We advise trying AI Bridge as self-hosted proxy to monitor LLM usage agnostically across AI powered IDEs like Cursor and headless agents like Claude Code.
32+
33+
##Known Issues / Limitations
34+
35+
- GPT-5 Codex currently does not work with AI Bridge due to missing`v1/responses` endpoint:https://github.com/coder/aibridge/issues/16
36+
- Claude Code web searches do not report correctly:https://github.com/coder/aibridge/issues/11

‎docs/ai-coder/ai-bridge/mcp.md‎

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) is a mechanism for connecting AI applications to external systems.
44

5-
Bridge can connect to MCP servers and inject tools automatically, enabling you to centrally manage the list of tools you wish to grant your users.
5+
AIBridge can connect to MCP servers and inject tools automatically, enabling you to centrally manage the list of tools you wish to grant your users.
66

77
>[!NOTE]
8-
>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).
8+
>Only MCP servers which support OAuth2 Authorization are supported currently.
99
>
1010
>[_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.
1111
12-
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 Bridge to connect to it, retrieve its tools and inject them into requests automatically - all while using each individual user's access token.
12+
AIBridge 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.
1313

1414
For example, GitHub has a[remote MCP server](https://github.com/github/github-mcp-server?tab=readme-ov-file#remote-github-mcp-server) and we can use it as follows.
1515

1616
```bash
1717
CODER_EXTERNAL_AUTH_0_TYPE=github
1818
CODER_EXTERNAL_AUTH_0_CLIENT_ID=...
1919
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=...
20-
# Tell Bridge where it can find this service's remote MCP server.
20+
# TellAIBridge where it can find this service's remote MCP server.
2121
CODER_EXTERNAL_AUTH_0_MCP_URL=https://api.githubcopilot.com/mcp/
2222
```
2323

24-
See the diagram in[Implementation Details](../reference#implementation-details) for more information.
24+
See the diagram in[Implementation Details](../reference.md#implementation-details) for more information.
2525

2626
You can also control which tools are injected by using an allow and/or a deny regular expression on the tool names:
2727

28-
```bash
28+
```env
2929
CODER_EXTERNAL_AUTH_0_MCP_TOOL_ALLOW_REGEX=(.+_gist.*)
3030
CODER_EXTERNAL_AUTH_0_MCP_TOOL_DENY_REGEX=(create_gist)
3131
```
@@ -45,27 +45,13 @@ In the above example, if you prompted your AI model with "list your available gi
4545
>1.`bmcp_github_update_gist`
4646
>2.`bmcp_github_list_gists`
4747
48-
Bridge marks automatically injected tools with a prefix`bmcp_` ("bridged MCP"). It also namespaces all tool names by the ID of their associated External Auth application (in this case`github`).
49-
50-
##Using AI Bridge with Coder Tasks
51-
52-
[Coder Tasks](../../workspaces/tasks.md) provides a framework for using agents like Claude Code to complete background development operations. To route those agents through Bridge:
53-
54-
- Enable Bridge at the control plane and configure the upstream provider keys.
55-
- Inject the AI Bridge base URLs and API keys into the Task environment (for example by setting`OPENAI_BASE_URL` and`OPENAI_API_KEY`).
56-
- Template authors can bake these variables into Task definitions so that new runs automatically use Bridge.
57-
58-
This setup keeps agent execution within Coder while applying the same auditing and MCP policies as IDE clients.
59-
60-
##Using AI Bridge without Tasks
61-
62-
Bridge also works with IDE-native assistants inside workspaces. Configure the IDE extension or desktop client to point at the Bridge endpoints and rely on the workspace's environment variables for authentication. This is the fastest path to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Tasks.
48+
AI Bridge marks automatically injected tools with a prefix`bmcp_` ("bridged MCP"). It also namespaces all tool names by the ID of their associated External Auth application (in this case`github`).
6349

6450
##Tool Injection
6551

66-
If a model decides to invoke a tool and it has a`bmcp_` suffix and Bridge has a connection with the related MCP server, it will invoke the tool. The tool result will be passed back to the upstream AI provider, and this will loop until the model has all of its required data. These inner loops are not relayed back to the client; all it seems is the result of this loop. See[Implementation Details](../reference#implementation-details).
52+
If a model decides to invoke a tool and it has a`bmcp_` suffix andAIBridge has a connection with the related MCP server, it will invoke the tool. The tool result will be passed back to the upstream AI provider, and this will loop until the model has all of its required data. These inner loops are not relayed back to the client; all it seems is the result of this loop. See[Implementation Details](./reference.md#implementation-details).
6753

68-
In contrast, tools which are defined by the client (i.e. the[`Bash` tool](https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude) defined by_Claude Code_) cannot be invoked by Bridge, and the tool call from the model will be relayed to the client, after which it will invoke the tool.
54+
In contrast, tools which are defined by the client (i.e. the[`Bash` tool](https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude) defined by_Claude Code_) cannot be invoked byAIBridge, and the tool call from the model will be relayed to the client, after which it will invoke the tool.
6955

7056
If you have the`oauth2` and`mcp-server-http` experiments enabled, Coder's own[internal MCP tools](../mcp-server.md) will be injected automatically.
7157

‎docs/ai-coder/ai-bridge/monitoring.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Monitoring
22

3-
Bridge records the last`user` prompt, token usage, and every tool invocation for each intercepted request. Each capture is tied to a single "interception" that maps back to the authenticated Coder identity, making it easy to attribute spend and behaviour.
3+
AIBridge records the last`user` prompt, token usage, and every tool invocation for each intercepted request. Each capture is tied to a single "interception" that maps back to the authenticated Coder identity, making it easy to attribute spend and behaviour.
44

55
![User Prompt logging](../../images/aibridge/grafana_user_prompts_logging.png)
66

‎docs/ai-coder/ai-bridge/reference.md‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
`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`.
66

77
<details>
8-
<summary>See a diagram of how Bridge interception works</summary>
8+
<summary>See a diagram of howAIBridge interception works</summary>
99

1010
```mermaid
1111
@@ -60,20 +60,15 @@ sequenceDiagram
6060
deactivate Client
6161
```
6262

63-
![AI Bridge implementation details](../../images/aibridge/aibridge-implementation-details.png)
64-
6563
</details>
6664

67-
##Known Issues / Limitations
68-
69-
- GPT-5 Codex currently does not work with Bridge due to missing`v1/responses` endpoint:https://github.com/coder/aibridge/issues/16
70-
- Claude Code web searches do not report correctly:https://github.com/coder/aibridge/issues/11
65+
![AI Bridge implementation details](../../images/aibridge/aibridge-implementation-details.png)
7166

7267
##Supported APIs
7368

7469
API support is broken down into two categories:
7570

76-
-**Intercepted**: requests are intercepted, audited, and augmented - full Bridge functionality
71+
-**Intercepted**: requests are intercepted, audited, and augmented - fullAIBridge functionality
7772
-**Passthrough**: requests are proxied directly to the upstream, no auditing or augmentation takes place
7873

7974
Where relevant, both streaming and non-streaming requests are supported.
@@ -101,4 +96,4 @@ Where relevant, both streaming and non-streaming requests are supported.
10196

10297
##Troubleshooting
10398

104-
To report a bug, file a feature request, or view a list of known issues, please visit our[GitHub repository for Bridge](https://github.com/coder/aibridge). If you encounter issues with Bridge during early access, please reach out to us via[Discord](https://discord.gg/coder).
99+
To report a bug, file a feature request, or view a list of known issues, please visit our[GitHub repository forAIBridge](https://github.com/coder/aibridge). If you encounter issues with AI Bridge during early access, please reach out to us via[Discord](https://discord.gg/coder).

‎docs/ai-coder/ai-bridge/setup.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#Setup
22

3-
Bridge runs inside the Coder control plane, requiring no separate compute to deploy or scale. Once enabled,`coderd`hosts thebridge in-memory and brokers traffic to your configured AI providers on behalf of authenticated users.
3+
AIBridge runs inside the Coder control plane, requiring no separate compute to deploy or scale. Once enabled,`coderd`runs the`aibridged` in-memory and brokers traffic to your configured AI providers on behalf of authenticated users.
44

55
**Required**:
66

77
1. A**premium** licensed Coder deployment
88
1. Feature must be[enabled](#activation) using the server flag
99
1. One or more[provider](#configure-providers) API key(s) must be configured
1010

11-
###Activation
11+
##Activation
1212

1313
You will need to enable AI Bridge explicitly:
1414

@@ -18,41 +18,41 @@ CODER_AIBRIDGE_ENABLED=true coder server
1818
coder server --aibridge-enabled=true
1919
```
2020

21-
###Configure providers
21+
##Configure providers
2222

23-
Bridge proxies requests to upstream LLM APIs. Configure at least one provider before exposing Bridge to end users.
23+
AIBridge proxies requests to upstream LLM APIs. Configure at least one provider before exposing AI Bridge to end users.
2424

25-
####OpenAI
25+
###OpenAI
2626

27-
Set the following when routing OpenAI-compatible traffic through Bridge:
27+
Set the following when routing OpenAI-compatible traffic throughAIBridge:
2828

2929
-`CODER_AIBRIDGE_OPENAI_KEY` or`--aibridge-openai-key`
3030
-`CODER_AIBRIDGE_OPENAI_BASE_URL` or`--aibridge-openai-base-url`
3131

3232
The default base URL (`https://api.openai.com/v1/`) works for the native OpenAI service. Point the base URL at your preferred OpenAI-compatible endpoint (for example, a hosted proxy or LiteLLM deployment) when needed.
3333

34-
####Anthropic
34+
###Anthropic
3535

36-
Set the following when routing Anthropic-compatible traffic through Bridge:
36+
Set the following when routing Anthropic-compatible traffic throughAIBridge:
3737

3838
-`CODER_AIBRIDGE_ANTHROPIC_KEY` or`--aibridge-anthropic-key`
3939
-`CODER_AIBRIDGE_ANTHROPIC_BASE_URL` or`--aibridge-anthropic-base-url`
4040

4141
The default base URL (`https://api.anthropic.com/`) targets Anthropic's public API. Override it for Anthropic-compatible brokers.
4242

43-
#####Amazon Bedrock
43+
####Amazon Bedrock
4444

45-
Set the following when routing Amazon Bedrock traffic through Bridge:
45+
Set the following when routing Amazon Bedrock traffic throughAIBridge:
4646

4747
-`CODER_AIBRIDGE_BEDROCK_REGION` or`--aibridge-bedrock-region`
4848
-`CODER_AIBRIDGE_BEDROCK_ACCESS_KEY` or`--aibridge-bedrock-access-key`
4949
-`CODER_AIBRIDGE_BEDROCK_ACCESS_KEY_SECRET` or`--aibridge-bedrock-access-key-secret`
5050
-`CODER_AIBRIDGE_BEDROCK_MODEL` or`--aibridge-bedrock-model`
5151
-`CODER_AIBRIDGE_BEDROCK_SMALL_FAST_MODEL` or`--aibridge-bedrock-small-fast-model`
5252

53-
####Additional providers and Model Proxies
53+
###Additional providers and Model Proxies
5454

55-
Bridge can relay traffic to other OpenAI- or Anthropic-compatible services or model proxies like LiteLLM by pointing the base URL variables above at the provider you operate. Share feedback or follow along in the[`aibridge`](https://github.com/coder/aibridge) issue tracker as we expand support for additional providers.
55+
AIBridge can relay traffic to other OpenAI- or Anthropic-compatible services or model proxies like LiteLLM by pointing the base URL variables above at the provider you operate. Share feedback or follow along in the[`aibridge`](https://github.com/coder/aibridge) issue tracker as we expand support for additional providers.
5656

5757
>[!NOTE]
58-
>See the[Supported APIs](../reference#supported-apis) section below for precise endpoint coverage and interception behavior.
58+
>See the[Supported APIs](./reference.md#supported-apis) section below for precise endpoint coverage and interception behavior.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp