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

Commit27d2343

Browse files
authored
fix(cli): exp mcp: remove unnecessary cli flag (#17190)
1 parent037dbc8 commit27d2343

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

‎cli/exp_mcp.go‎

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"path/filepath"
99

1010
"github.com/mark3labs/mcp-go/server"
11-
"golang.org/x/xerrors"
1211

1312
"cdr.dev/slog"
1413
"cdr.dev/slog/sloggers/sloghuman"
@@ -195,16 +194,15 @@ func (*RootCmd) mcpConfigureCursor() *serpent.Command {
195194

196195
func (r*RootCmd)mcpServer()*serpent.Command {
197196
var (
198-
client=new(codersdk.Client)
199-
instructionsstring
200-
allowedTools []string
201-
appStatusSlugstring
202-
mcpServerAgentbool
197+
client=new(codersdk.Client)
198+
instructionsstring
199+
allowedTools []string
200+
appStatusSlugstring
203201
)
204202
return&serpent.Command{
205203
Use:"server",
206204
Handler:func(inv*serpent.Invocation)error {
207-
returnmcpServerHandler(inv,client,instructions,allowedTools,appStatusSlug,mcpServerAgent)
205+
returnmcpServerHandler(inv,client,instructions,allowedTools,appStatusSlug)
208206
},
209207
Short:"Start the Coder MCP server.",
210208
Middleware:serpent.Chain(
@@ -233,18 +231,11 @@ func (r *RootCmd) mcpServer() *serpent.Command {
233231
Value:serpent.StringOf(&appStatusSlug),
234232
Default:"",
235233
},
236-
{
237-
Flag:"agent",
238-
Env:"CODER_MCP_SERVER_AGENT",
239-
Description:"Start the MCP server in agent mode, with a different set of tools.",
240-
Value:serpent.BoolOf(&mcpServerAgent),
241-
},
242234
},
243235
}
244236
}
245237

246-
//nolint:revive // control coupling
247-
funcmcpServerHandler(inv*serpent.Invocation,client*codersdk.Client,instructionsstring,allowedTools []string,appStatusSlugstring,mcpServerAgentbool)error {
238+
funcmcpServerHandler(inv*serpent.Invocation,client*codersdk.Client,instructionsstring,allowedTools []string,appStatusSlugstring)error {
248239
ctx,cancel:=context.WithCancel(inv.Context())
249240
defercancel()
250241

@@ -290,13 +281,15 @@ func mcpServerHandler(inv *serpent.Invocation, client *codersdk.Client, instruct
290281
AgentClient:agentsdk.New(client.URL),
291282
}
292283

293-
ifmcpServerAgent {
294-
// Get the workspace agent token from the environment.
295-
agentToken,ok:=os.LookupEnv("CODER_AGENT_TOKEN")
296-
if!ok||agentToken=="" {
297-
returnxerrors.New("CODER_AGENT_TOKEN is not set")
298-
}
284+
// Get the workspace agent token from the environment.
285+
agentToken,ok:=os.LookupEnv("CODER_AGENT_TOKEN")
286+
ifok&&agentToken!="" {
299287
toolDeps.AgentClient.SetSessionToken(agentToken)
288+
}else {
289+
cliui.Warnf(inv.Stderr,"CODER_AGENT_TOKEN is not set, task reporting will not be available")
290+
}
291+
ifappStatusSlug=="" {
292+
cliui.Warnf(inv.Stderr,"CODER_MCP_APP_STATUS_SLUG is not set, task reporting will not be available.")
300293
}
301294

302295
// Register tools based on the allowlist (if specified)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp