mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 15:04:13 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05ccc5ce4 | ||
|
|
41e5ba9012 | ||
|
|
e6f32c8321 | ||
|
|
ada5bc42eb | ||
|
|
d6d3ddd4a7 |
8
.github/workflows/claude.yml
vendored
8
.github/workflows/claude.yml
vendored
@@ -31,9 +31,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Claude Code
|
- name: Run Claude Code
|
||||||
id: claude
|
id: claude
|
||||||
uses: anthropics/claude-code-action@beta
|
uses: anthropics/claude-code-action@v1
|
||||||
with:
|
with:
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
allowed_tools: "Bash(bun install),Bash(bun test:*),Bash(bun run format),Bash(bun typecheck)"
|
claude_args: |
|
||||||
custom_instructions: "You have also been granted tools for editing files and running bun commands (install, run, test, typecheck) for testing your changes: bun install, bun test, bun run format, bun typecheck."
|
--allowedTools "Bash(bun install),Bash(bun test:*),Bash(bun run format),Bash(bun typecheck)"
|
||||||
model: "claude-opus-4-1-20250805"
|
--model "claude-opus-4-1-20250805"
|
||||||
|
|||||||
9
.github/workflows/issue-triage.yml
vendored
9
.github/workflows/issue-triage.yml
vendored
@@ -97,11 +97,12 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Run Claude Code for Issue Triage
|
- name: Run Claude Code for Issue Triage
|
||||||
uses: anthropics/claude-code-base-action@beta
|
uses: anthropics/claude-code-base-action@v1
|
||||||
with:
|
with:
|
||||||
prompt_file: /tmp/claude-prompts/triage-prompt.txt
|
prompt: $(cat /tmp/claude-prompts/triage-prompt.txt)
|
||||||
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
|
|
||||||
mcp_config: /tmp/mcp-config/mcp-servers.json
|
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
claude_args: |
|
||||||
|
--allowedTools Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues
|
||||||
|
--mcp-config /tmp/mcp-config/mcp-servers.json
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
@@ -80,38 +80,7 @@ jobs:
|
|||||||
gh release create "$next_version" \
|
gh release create "$next_version" \
|
||||||
--title "$next_version" \
|
--title "$next_version" \
|
||||||
--generate-notes \
|
--generate-notes \
|
||||||
--latest=false # We want to keep beta as the latest
|
--latest=false # keep v1 as latest
|
||||||
|
|
||||||
update-beta-tag:
|
|
||||||
needs: create-release
|
|
||||||
if: ${{ !inputs.dry_run }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment: production
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Update beta tag
|
|
||||||
run: |
|
|
||||||
# Get the latest version tag
|
|
||||||
VERSION=$(git tag -l 'v[0-9]*' | sort -V | tail -1)
|
|
||||||
|
|
||||||
# Update the beta tag to point to this release
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git tag -fa beta -m "Update beta tag to ${VERSION}"
|
|
||||||
git push origin beta --force
|
|
||||||
|
|
||||||
- name: Update beta release to be latest
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
# Update beta release to be marked as latest
|
|
||||||
gh release edit beta --latest
|
|
||||||
|
|
||||||
update-major-tag:
|
update-major-tag:
|
||||||
needs: create-release
|
needs: create-release
|
||||||
|
|||||||
@@ -61,10 +61,6 @@ inputs:
|
|||||||
description: "Additional arguments to pass directly to Claude CLI"
|
description: "Additional arguments to pass directly to Claude CLI"
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
mcp_config:
|
|
||||||
description: "Additional MCP configuration (JSON string) that merges with built-in GitHub MCP servers"
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
additional_permissions:
|
additional_permissions:
|
||||||
description: "Additional GitHub permissions to request (e.g., 'actions: read')"
|
description: "Additional GitHub permissions to request (e.g., 'actions: read')"
|
||||||
required: false
|
required: false
|
||||||
@@ -146,7 +142,6 @@ runs:
|
|||||||
USE_COMMIT_SIGNING: ${{ inputs.use_commit_signing }}
|
USE_COMMIT_SIGNING: ${{ inputs.use_commit_signing }}
|
||||||
ADDITIONAL_PERMISSIONS: ${{ inputs.additional_permissions }}
|
ADDITIONAL_PERMISSIONS: ${{ inputs.additional_permissions }}
|
||||||
CLAUDE_ARGS: ${{ inputs.claude_args }}
|
CLAUDE_ARGS: ${{ inputs.claude_args }}
|
||||||
MCP_CONFIG: ${{ inputs.mcp_config }}
|
|
||||||
ALL_INPUTS: ${{ toJson(inputs) }}
|
ALL_INPUTS: ${{ toJson(inputs) }}
|
||||||
|
|
||||||
- name: Install Base Action Dependencies
|
- name: Install Base Action Dependencies
|
||||||
@@ -162,7 +157,7 @@ runs:
|
|||||||
# Install Claude Code if no custom executable is provided
|
# Install Claude Code if no custom executable is provided
|
||||||
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
||||||
echo "Installing Claude Code..."
|
echo "Installing Claude Code..."
|
||||||
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.90
|
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.92
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
||||||
echo "Installing Claude Code..."
|
echo "Installing Claude Code..."
|
||||||
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.90
|
curl -fsSL https://claude.ai/install.sh | bash -s 1.0.92
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
||||||
# Add the directory containing the custom executable to PATH
|
# Add the directory containing the custom executable to PATH
|
||||||
|
|||||||
@@ -103,5 +103,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
prompt_file: /tmp/claude-prompts/triage-prompt.txt
|
prompt_file: /tmp/claude-prompts/triage-prompt.txt
|
||||||
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
|
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
|
||||||
mcp_config: /tmp/mcp-config/mcp-servers.json
|
claude_args: |
|
||||||
|
--mcp-config /tmp/mcp-config/mcp-servers.json
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|||||||
@@ -2,51 +2,47 @@
|
|||||||
|
|
||||||
## Using Custom MCP Configuration
|
## Using Custom MCP Configuration
|
||||||
|
|
||||||
The `mcp_config` input allows you to add custom MCP (Model Context Protocol) servers to extend Claude's capabilities. These servers merge with the built-in GitHub MCP servers.
|
You can add custom MCP (Model Context Protocol) servers to extend Claude's capabilities using the `--mcp-config` flag in `claude_args`. These servers merge with the built-in GitHub MCP servers.
|
||||||
|
|
||||||
### Basic Example: Adding a Sequential Thinking Server
|
### Basic Example: Adding a Sequential Thinking Server
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: anthropics/claude-code-action@beta
|
- uses: anthropics/claude-code-action@v1
|
||||||
with:
|
with:
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
mcp_config: |
|
claude_args: |
|
||||||
{
|
--mcp-config '{"mcpServers": {"sequential-thinking": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]}}}'
|
||||||
"mcpServers": {
|
--allowedTools mcp__sequential-thinking__sequentialthinking
|
||||||
"sequential-thinking": {
|
|
||||||
"command": "npx",
|
|
||||||
"args": [
|
|
||||||
"-y",
|
|
||||||
"@modelcontextprotocol/server-sequential-thinking"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
allowed_tools: "mcp__sequential-thinking__sequentialthinking" # Important: Each MCP tool from your server must be listed here, comma-separated
|
|
||||||
# ... other inputs
|
# ... other inputs
|
||||||
```
|
```
|
||||||
|
|
||||||
### Passing Secrets to MCP Servers
|
### Passing Secrets to MCP Servers
|
||||||
|
|
||||||
For MCP servers that require sensitive information like API keys or tokens, use GitHub Secrets in the environment variables:
|
For MCP servers that require sensitive information like API keys or tokens, you can create a configuration file with GitHub Secrets:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: anthropics/claude-code-action@beta
|
- name: Create MCP Config
|
||||||
with:
|
run: |
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
cat > /tmp/mcp-config.json << 'EOF'
|
||||||
mcp_config: |
|
{
|
||||||
{
|
"mcpServers": {
|
||||||
"mcpServers": {
|
"custom-api-server": {
|
||||||
"custom-api-server": {
|
"command": "npx",
|
||||||
"command": "npx",
|
"args": ["-y", "@example/api-server"],
|
||||||
"args": ["-y", "@example/api-server"],
|
"env": {
|
||||||
"env": {
|
"API_KEY": "${{ secrets.CUSTOM_API_KEY }}",
|
||||||
"API_KEY": "${{ secrets.CUSTOM_API_KEY }}",
|
"BASE_URL": "https://api.example.com"
|
||||||
"BASE_URL": "https://api.example.com"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
claude_args: |
|
||||||
|
--mcp-config /tmp/mcp-config.json
|
||||||
# ... other inputs
|
# ... other inputs
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -55,25 +51,31 @@ For MCP servers that require sensitive information like API keys or tokens, use
|
|||||||
For Python-based MCP servers managed with `uv`, you need to specify the directory containing your server:
|
For Python-based MCP servers managed with `uv`, you need to specify the directory containing your server:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: anthropics/claude-code-action@beta
|
- name: Create MCP Config for Python Server
|
||||||
with:
|
run: |
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
cat > /tmp/mcp-config.json << 'EOF'
|
||||||
mcp_config: |
|
{
|
||||||
{
|
"mcpServers": {
|
||||||
"mcpServers": {
|
"my-python-server": {
|
||||||
"my-python-server": {
|
"type": "stdio",
|
||||||
"type": "stdio",
|
"command": "uv",
|
||||||
"command": "uv",
|
"args": [
|
||||||
"args": [
|
"--directory",
|
||||||
"--directory",
|
"${{ github.workspace }}/path/to/server/",
|
||||||
"${{ github.workspace }}/path/to/server/",
|
"run",
|
||||||
"run",
|
"server_file.py"
|
||||||
"server_file.py"
|
]
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
allowed_tools: "my-python-server__<tool_name>" # Replace <tool_name> with your server's tool names
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
claude_args: |
|
||||||
|
--mcp-config /tmp/mcp-config.json
|
||||||
|
--allowedTools my-python-server__<tool_name> # Replace <tool_name> with your server's tool names
|
||||||
# ... other inputs
|
# ... other inputs
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -84,10 +86,26 @@ For example, if your Python MCP server is at `mcp_servers/weather.py`, you would
|
|||||||
["--directory", "${{ github.workspace }}/mcp_servers/", "run", "weather.py"]
|
["--directory", "${{ github.workspace }}/mcp_servers/", "run", "weather.py"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Multiple MCP Servers
|
||||||
|
|
||||||
|
You can add multiple MCP servers by using multiple `--mcp-config` flags:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
claude_args: |
|
||||||
|
--mcp-config /tmp/config1.json
|
||||||
|
--mcp-config /tmp/config2.json
|
||||||
|
--mcp-config '{"mcpServers": {"inline-server": {"command": "npx", "args": ["@example/server"]}}}'
|
||||||
|
# ... other inputs
|
||||||
|
```
|
||||||
|
|
||||||
**Important**:
|
**Important**:
|
||||||
|
|
||||||
- Always use GitHub Secrets (`${{ secrets.SECRET_NAME }}`) for sensitive values like API keys, tokens, or passwords. Never hardcode secrets directly in the workflow file.
|
- Always use GitHub Secrets (`${{ secrets.SECRET_NAME }}`) for sensitive values like API keys, tokens, or passwords. Never hardcode secrets directly in the workflow file.
|
||||||
- Your custom servers will override any built-in servers with the same name.
|
- Your custom servers will override any built-in servers with the same name.
|
||||||
|
- The `claude_args` supports multiple `--mcp-config` flags that will be merged together.
|
||||||
|
|
||||||
## Additional Permissions for CI/CD Integration
|
## Additional Permissions for CI/CD Integration
|
||||||
|
|
||||||
@@ -322,5 +340,6 @@ Many individual input parameters have been consolidated into `claude_args` or `s
|
|||||||
| `model` | Use `claude_args: "--model claude-4-0-sonnet-20250805"` |
|
| `model` | Use `claude_args: "--model claude-4-0-sonnet-20250805"` |
|
||||||
| `claude_env` | Use `settings` with `"env"` object |
|
| `claude_env` | Use `settings` with `"env"` object |
|
||||||
| `custom_instructions` | Use `claude_args: "--system-prompt 'Your instructions'"` |
|
| `custom_instructions` | Use `claude_args: "--system-prompt 'Your instructions'"` |
|
||||||
|
| `mcp_config` | Use `claude_args: "--mcp-config '{...}'"` |
|
||||||
| `direct_prompt` | Use `prompt` input instead |
|
| `direct_prompt` | Use `prompt` input instead |
|
||||||
| `override_prompt` | Use `prompt` with GitHub context variables |
|
| `override_prompt` | Use `prompt` with GitHub context variables |
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ The following inputs have been deprecated and replaced:
|
|||||||
| `allowed_tools` | `claude_args: --allowedTools` | Use CLI format |
|
| `allowed_tools` | `claude_args: --allowedTools` | Use CLI format |
|
||||||
| `disallowed_tools` | `claude_args: --disallowedTools` | Use CLI format |
|
| `disallowed_tools` | `claude_args: --disallowedTools` | Use CLI format |
|
||||||
| `claude_env` | `settings` with env object | Use settings JSON |
|
| `claude_env` | `settings` with env object | Use settings JSON |
|
||||||
|
| `mcp_config` | `claude_args: --mcp-config` | Pass MCP config via CLI arguments |
|
||||||
|
|
||||||
## Migration Examples
|
## Migration Examples
|
||||||
|
|
||||||
@@ -156,17 +157,19 @@ claude_args: |
|
|||||||
--allowedTools Edit,Read,Write,Bash
|
--allowedTools Edit,Read,Write,Bash
|
||||||
--disallowedTools WebSearch
|
--disallowedTools WebSearch
|
||||||
--system-prompt "You are a senior engineer focused on code quality"
|
--system-prompt "You are a senior engineer focused on code quality"
|
||||||
|
--mcp-config '{"mcpServers": {"custom": {"command": "npx", "args": ["-y", "@example/server"]}}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Common claude_args Options
|
### Common claude_args Options
|
||||||
|
|
||||||
| Option | Description | Example |
|
| Option | Description | Example |
|
||||||
| ------------------- | ------------------------ | ------------------------------------- |
|
| ------------------- | ------------------------ | -------------------------------------- |
|
||||||
| `--max-turns` | Limit conversation turns | `--max-turns 10` |
|
| `--max-turns` | Limit conversation turns | `--max-turns 10` |
|
||||||
| `--model` | Specify Claude model | `--model claude-4-0-sonnet-20250805` |
|
| `--model` | Specify Claude model | `--model claude-4-0-sonnet-20250805` |
|
||||||
| `--allowedTools` | Enable specific tools | `--allowedTools Edit,Read,Write` |
|
| `--allowedTools` | Enable specific tools | `--allowedTools Edit,Read,Write` |
|
||||||
| `--disallowedTools` | Disable specific tools | `--disallowedTools WebSearch` |
|
| `--disallowedTools` | Disable specific tools | `--disallowedTools WebSearch` |
|
||||||
| `--system-prompt` | Add system instructions | `--system-prompt "Focus on security"` |
|
| `--system-prompt` | Add system instructions | `--system-prompt "Focus on security"` |
|
||||||
|
| `--mcp-config` | Add MCP server config | `--mcp-config '{"mcpServers": {...}}'` |
|
||||||
|
|
||||||
## Provider-Specific Updates
|
## Provider-Specific Updates
|
||||||
|
|
||||||
@@ -190,6 +193,44 @@ claude_args: |
|
|||||||
--model claude-4-0-sonnet@20250805
|
--model claude-4-0-sonnet@20250805
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## MCP Configuration Migration
|
||||||
|
|
||||||
|
### Adding Custom MCP Servers
|
||||||
|
|
||||||
|
**Before (v0.x):**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: anthropics/claude-code-action@beta
|
||||||
|
with:
|
||||||
|
mcp_config: |
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"custom-server": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["-y", "@example/server"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**After (v1.0):**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_args: |
|
||||||
|
--mcp-config '{"mcpServers": {"custom-server": {"command": "npx", "args": ["-y", "@example/server"]}}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also pass MCP configuration from a file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_args: |
|
||||||
|
--mcp-config /path/to/mcp-config.json
|
||||||
|
```
|
||||||
|
|
||||||
## Step-by-Step Migration Checklist
|
## Step-by-Step Migration Checklist
|
||||||
|
|
||||||
- [ ] Update action version from `@beta` to `@v1`
|
- [ ] Update action version from `@beta` to `@v1`
|
||||||
@@ -202,6 +243,7 @@ claude_args: |
|
|||||||
- [ ] Convert `allowed_tools` to `claude_args` with `--allowedTools`
|
- [ ] Convert `allowed_tools` to `claude_args` with `--allowedTools`
|
||||||
- [ ] Convert `disallowed_tools` to `claude_args` with `--disallowedTools`
|
- [ ] Convert `disallowed_tools` to `claude_args` with `--disallowedTools`
|
||||||
- [ ] Move `claude_env` to `settings` JSON format
|
- [ ] Move `claude_env` to `settings` JSON format
|
||||||
|
- [ ] Move `mcp_config` to `claude_args` with `--mcp-config`
|
||||||
- [ ] Test workflow in a non-production environment
|
- [ ] Test workflow in a non-production environment
|
||||||
|
|
||||||
## Getting Help
|
## Getting Help
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ export function collectActionInputsPresence(): void {
|
|||||||
custom_instructions: "",
|
custom_instructions: "",
|
||||||
direct_prompt: "",
|
direct_prompt: "",
|
||||||
override_prompt: "",
|
override_prompt: "",
|
||||||
mcp_config: "",
|
|
||||||
additional_permissions: "",
|
additional_permissions: "",
|
||||||
claude_env: "",
|
claude_env: "",
|
||||||
settings: "",
|
settings: "",
|
||||||
|
|||||||
@@ -119,13 +119,6 @@ export const agentMode: Mode = {
|
|||||||
claudeArgs = `--mcp-config '${escapedOurConfig}'`;
|
claudeArgs = `--mcp-config '${escapedOurConfig}'`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add user's MCP_CONFIG env var as separate --mcp-config
|
|
||||||
const userMcpConfig = process.env.MCP_CONFIG;
|
|
||||||
if (userMcpConfig?.trim()) {
|
|
||||||
const escapedUserConfig = userMcpConfig.replace(/'/g, "'\\''");
|
|
||||||
claudeArgs = `${claudeArgs} --mcp-config '${escapedUserConfig}'`.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Append user's claude_args (which may have more --mcp-config flags)
|
// Append user's claude_args (which may have more --mcp-config flags)
|
||||||
claudeArgs = `${claudeArgs} ${userClaudeArgs}`.trim();
|
claudeArgs = `${claudeArgs} ${userClaudeArgs}`.trim();
|
||||||
|
|
||||||
|
|||||||
@@ -155,13 +155,6 @@ export const tagMode: Mode = {
|
|||||||
const escapedOurConfig = ourMcpConfig.replace(/'/g, "'\\''");
|
const escapedOurConfig = ourMcpConfig.replace(/'/g, "'\\''");
|
||||||
claudeArgs = `--mcp-config '${escapedOurConfig}'`;
|
claudeArgs = `--mcp-config '${escapedOurConfig}'`;
|
||||||
|
|
||||||
// Add user's MCP_CONFIG env var as separate --mcp-config
|
|
||||||
const userMcpConfig = process.env.MCP_CONFIG;
|
|
||||||
if (userMcpConfig?.trim()) {
|
|
||||||
const escapedUserConfig = userMcpConfig.replace(/'/g, "'\\''");
|
|
||||||
claudeArgs = `${claudeArgs} --mcp-config '${escapedUserConfig}'`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add required tools for tag mode
|
// Add required tools for tag mode
|
||||||
claudeArgs += ` --allowedTools "${tagModeTools.join(",")}"`;
|
claudeArgs += ` --allowedTools "${tagModeTools.join(",")}"`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user