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

fix(cli): modifyexp mcp configure to also read claude API key from CLAUDE_API_KEY env#17229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 3 commits intomainfromcj/exp-mcp-configure-api-key-arg
Apr 3, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletionscli/exp_mcp.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -110,12 +110,14 @@ func (*RootCmd) mcpConfigureClaudeDesktop() *serpent.Command {

func (*RootCmd) mcpConfigureClaudeCode() *serpent.Command {
var (
apiKey string
claudeAPIKey string
claudeConfigPath string
claudeMDPath string
systemPrompt string
appStatusSlug string
testBinaryName string

deprecatedCoderMCPClaudeAPIKey string
)
cmd := &serpent.Command{
Use: "claude-code <project-directory>",
Expand All@@ -140,6 +142,14 @@ func (*RootCmd) mcpConfigureClaudeCode() *serpent.Command {
} else {
configureClaudeEnv["CODER_AGENT_TOKEN"] = agentToken
}
if claudeAPIKey == "" {
if deprecatedCoderMCPClaudeAPIKey == "" {
cliui.Warnf(inv.Stderr, "CLAUDE_API_KEY is not set.")
} else {
cliui.Warnf(inv.Stderr, "CODER_MCP_CLAUDE_API_KEY is deprecated, use CLAUDE_API_KEY instead")
claudeAPIKey = deprecatedCoderMCPClaudeAPIKey
}
}
if appStatusSlug != "" {
configureClaudeEnv["CODER_MCP_APP_STATUS_SLUG"] = appStatusSlug
}
Expand All@@ -151,7 +161,7 @@ func (*RootCmd) mcpConfigureClaudeCode() *serpent.Command {
if err := configureClaude(fs, ClaudeConfig{
// TODO: will this always be stable?
AllowedTools: []string{`mcp__coder__coder_report_task`},
APIKey:apiKey,
APIKey:claudeAPIKey,
ConfigPath: claudeConfigPath,
ProjectDirectory: projectDirectory,
MCPServers: map[string]ClaudeConfigMCP{
Expand DownExpand Up@@ -191,11 +201,18 @@ func (*RootCmd) mcpConfigureClaudeCode() *serpent.Command {
Default: filepath.Join(os.Getenv("HOME"), ".claude", "CLAUDE.md"),
},
{
Name: "api-key",
Description: "The API key to use for the Claude Code server.",
Env: "CODER_MCP_CLAUDE_API_KEY",
Name: "claude-api-key",
Description: "The API key to use for the Claude Code server. This is also read from CLAUDE_API_KEY.",
Env: "CLAUDE_API_KEY",
Flag: "claude-api-key",
Value: serpent.StringOf(&apiKey),
Value: serpent.StringOf(&claudeAPIKey),
},
{
Name: "mcp-claude-api-key",
Description: "Hidden alias for CLAUDE_API_KEY. This will be removed in a future version.",
Env: "CODER_MCP_CLAUDE_API_KEY",
Value: serpent.StringOf(&deprecatedCoderMCPClaudeAPIKey),
Hidden: true,
},
{
Name: "system-prompt",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp