@@ -14,7 +14,6 @@ import (
14
14
"cdr.dev/slog"
15
15
16
16
"github.com/coder/aibridge"
17
- "github.com/coder/aibridge/mcp"
18
17
)
19
18
20
19
const (
@@ -24,7 +23,7 @@ const (
24
23
// Pooler describes a pool of [*aibridge.RequestBridge] instances from which instances can be retrieved.
25
24
// One [*aibridge.RequestBridge] instance is created per given key.
26
25
type Pooler interface {
27
- Acquire (ctx context.Context ,req Request ,clientFn ClientFunc , mcpBootstrapper MCPProxyBuilder ) (http.Handler ,error )
26
+ Acquire (ctx context.Context ,req Request ,clientFn ClientFunc ) (http.Handler ,error )
28
27
Shutdown (ctx context.Context )error
29
28
}
30
29
@@ -103,7 +102,7 @@ func NewCachedBridgePool(options PoolOptions, providers []aibridge.Provider, log
103
102
//
104
103
// Each returned [*aibridge.RequestBridge] is safe for concurrent use.
105
104
// Each [*aibridge.RequestBridge] is stateful because it has MCP clients which maintain sessions to the configured MCP server.
106
- func (p * CachedBridgePool )Acquire (ctx context.Context ,req Request ,clientFn ClientFunc , mcpProxyFactory MCPProxyBuilder ) (http.Handler ,error ) {
105
+ func (p * CachedBridgePool )Acquire (ctx context.Context ,req Request ,clientFn ClientFunc ) (http.Handler ,error ) {
107
106
if err := ctx .Err ();err != nil {
108
107
return nil ,xerrors .Errorf ("acquire: %w" ,err )
109
108
}
@@ -142,25 +141,7 @@ func (p *CachedBridgePool) Acquire(ctx context.Context, req Request, clientFn Cl
142
141
// Creating an *aibridge.RequestBridge may take some time, so gate all subsequent callers behind the initial request and return the resulting value.
143
142
// TODO: track startup time since it adds latency to first request (histogram count will also help us see how often this occurs).
144
143
instance ,err ,_ := p .singleflight .Do (req .InitiatorID .String (),func () (* aibridge.RequestBridge ,error ) {
145
- var (
146
- mcpServers mcp.ServerProxier
147
- err error
148
- )
149
-
150
- mcpServers ,err = mcpProxyFactory .Build (ctx ,req )
151
- if err != nil {
152
- p .logger .Warn (ctx ,"failed to create MCP server proxiers" ,slog .Error (err ))
153
- // Don't fail here; MCP server injection can gracefully degrade.
154
- }
155
-
156
- if mcpServers != nil {
157
- // This will block while connections are established with upstream MCP server(s), and tools are listed.
158
- if err := mcpServers .Init (ctx );err != nil {
159
- p .logger .Warn (ctx ,"failed to initialize MCP server proxier(s)" ,slog .Error (err ))
160
- }
161
- }
162
-
163
- bridge ,err := aibridge .NewRequestBridge (ctx ,p .providers ,p .logger ,recorder ,mcpServers )
144
+ bridge ,err := aibridge .NewRequestBridge (ctx ,p .providers ,p .logger ,recorder ,nil )
164
145
if err != nil {
165
146
return nil ,xerrors .Errorf ("create new request bridge: %w" ,err )
166
147
}