From agent-flow
Generates .mcp.json and .claude/settings.json to configure MCP servers, tokens, and tool permissions for agent-flow pipeline. Supports CLI flags for tracker type, instance URL, and source control remote.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-flow:setup-mcp [--update] [--tracker-type <type>] [--tracker-instance <url>] [--sc-remote <owner/repo>][--update] [--tracker-type <type>] [--tracker-instance <url>] [--sc-remote <owner/repo>]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up the developer environment for agent-flow pipeline. Generates `.mcp.json` (MCP server configuration) and `.claude/settings.json` (tool permissions).
Set up the developer environment for agent-flow pipeline. Generates .mcp.json (MCP server configuration) and .claude/settings.json (tool permissions).
This command is the counterpart to /agent-flow:onboard:
Input: $ARGUMENTS = (none) | --update | --tracker-type <type> | --tracker-instance <url> | --sc-remote <owner/repo> (flags may be combined)
This command writes to the CURRENT WORKING DIRECTORY:
.mcp.json — MCP server configuration.claude/settings.json — tool auto-approval (optional).gitignore — adds .mcp.json if not presentParse $ARGUMENTS for optional CLI flags:
--tracker-type <type> → cli_tracker_type--tracker-instance <url> → cli_tracker_instance--sc-remote <owner/repo> → cli_sc_remoteIf ANY of these flags is provided:
--tracker-type (if provided) against the lookup table in ../../core/mcp-detection.md Process step 1. Valid values: youtrack, github, jira, linear, gitea, redmine. If invalid → error: "Invalid tracker type '{value}'. Valid types: youtrack, github, jira, linear, gitea, redmine."Type = cli_tracker_type (if not provided, infer from cli_sc_remote hostname: github.com → github; otherwise → error: "--tracker-type is required when CLAUDE.md is not available.")
Instance = cli_tracker_instance (if not provided, derive default:
Path note:
trackers.mdlives in the plugin installation directory. Resolve via Glob before reading defaults.
Resolve {trackers_md_path}: Glob .claude/plugins/**/docs/reference/trackers.md (prefer path containing .claude/plugins/ or agent-flow/); fallback **/docs/reference/trackers.md; last resort docs/reference/trackers.md. If not found → use hardcoded defaults per tracker type.
Read the Instance & Project Defaults table from {trackers_md_path} for the given type.)
Remote = cli_sc_remote (if not provided, skip SC server — tracker-only setup)
If NO flags provided: proceed to Step 1 as normal.
Composability with --update: The 3 new flags compose with --update. Example: --update --tracker-type gitea updates an existing .mcp.json with a new/changed tracker type. The --update flag controls Step 2 behavior (preserve existing servers); the new flags control Step 1 behavior (value source).
If Step 0 provided CLI overrides → skip this step entirely (values already set).
Read Automation Config from CLAUDE.md. Extract:
If no Automation Config found → error: "No Automation Config found. Run /agent-flow:onboard first."
If .mcp.json.example exists in CWD (typically generated by /agent-flow:scaffold):
Parse the file to extract pre-fill values:
../../core/mcp-detection.md lookup table (e.g., @vitalyostanin/youtrack-mcp → youtrack, gitea-mcp → gitea)YOUTRACK_URL, GITEA_HOST, REDMINE_URL)If parsing succeeds:
Detected .mcp.json.example from previous /scaffold run. Pre-filling: Tracker={type}, Instance={url}, Remote={remote} (omit fields that were not detected)If .mcp.json.example does not exist or parsing fails:
.mcp.json exists in CWD:
--update → parse existing config, preserve non-agent-flow servers.mcp.json does NOT exist → fresh modeBefore determining MCP servers, verify required tooling is available:
Node.js / npx check: npx is only needed for the YouTrack community fallback path (@vitalyostanin/youtrack-mcp@latest) — specifically when the user explicitly selects the legacy on-prem route for YouTrack Server <2026.1. For all other tracker types (github, jira, linear — HTTP transport; redmine — uvx; gitea — binary), npx is NOT required.
If the user later selects the YouTrack legacy fallback in Step 3 and npx is not found:
"npx not found. Node.js is required for the YouTrack community fallback (vitalyostanin). Install Node.js from https://nodejs.org/ and retry, or use the default HTTP transport if your YouTrack is 2026.1+." → STOP that fallback path.Do NOT perform an upfront npx check for all tracker types — it is not needed by default.
For each required MCP server, follow ../../core/mcp-detection.md Process step 1 to determine the expected package name and tool prefix for the declared tracker type.
If Step 1b pre-filled tracker type from .mcp.json.example: use the pre-filled value as default (user can override).
Transport, endpoint, and credential information per tracker type:
| Tracker Type | Transport | Endpoint / Invocation | Credentials |
|---|---|---|---|
| youtrack | HTTP | https://<INSTANCE>.youtrack.cloud/mcp | Bearer header YOUTRACK_TOKEN (env var) |
| github | HTTP | https://api.githubcopilot.com/mcp/ | Bearer header GITHUB_PERSONAL_ACCESS_TOKEN (env var) |
| jira | HTTP | https://mcp.atlassian.com/v1/mcp | OAuth via Claude Code (no env vars required in template; Cloud only) |
| linear | HTTP | https://mcp.linear.app/mcp | OAuth via Claude Code (no env vars required in template) |
| gitea | stdio (binary) | gitea-mcp binary | GITEA_ACCESS_TOKEN env var, GITEA_HOST env var |
| redmine | stdio (uvx) | uvx --from mcp-redmine==2026.01.13.152335 mcp-redmine | REDMINE_URL env var, REDMINE_API_KEY env var (requires Python 3.10+ and uv toolchain) |
YouTrack fallback for Server <2026.1 (on-prem legacy): If the user explicitly indicates their YouTrack is an on-prem instance older than version 2026.1, offer the community fallback:
npx -y @vitalyostanin/youtrack-mcp@latest (stdio transport) with YOUTRACK_URL and YOUTRACK_TOKEN environment variables."For YouTrack Server <2026.1, use community fallback: npx -y @vitalyostanin/youtrack-mcp@latest with YOUTRACK_URL + YOUTRACK_TOKEN env vars. For YouTrack Cloud or Server 2026.1+, the default HTTP transport is recommended."Redmine uvx prereq (lazy check): When redmine is selected, verify uv is installed (which uv or where uv on Windows). If not found, display: "uv not found. Install the uv toolchain (Python 3.10+ required) from https://docs.astral.sh/uv/getting-started/installation/ and retry." → STOP redmine setup.
Shared server detection: Compare tracker Type hostname with Source Control Remote hostname.
gitea-mcp instance (shared)Determine which servers to configure:
For each required MCP server, offer two options:
Your tracker is {Type}. You need a {token_name} token.
See docs/guides/tokens.md for how to create one.
(a) Paste token now — I'll add it to .mcp.json directly
(b) Skip — I'll generate .mcp.json with a placeholder (<YOUR_*>).
You can edit .mcp.json manually later with your token.
If user pastes a token → use it in Step 6.
If user skips → keep <YOUR_*> placeholder in generated .mcp.json.
For extra env vars (Instance URL, email):
If shared server detected: "Your tracker ({Type}) and source control ({Remote}) use the same MCP server. One configuration covers both."
If separate SC server needed:
Your source control is on {hostname}. You need a {sc_token_name} token.
(a) Paste token now
(b) Skip — edit .mcp.json manually later
Detect platform via Bash:
uname -s # Linux, Darwin, MINGW*/MSYS* (Windows)
uname -m # x86_64, arm64, aarch64
Based on result, determine the asset name (pinned to v1.1.0):
| Platform | uname -s | uname -m | Binary name | Asset name |
|---|---|---|---|---|
| macOS ARM | Darwin | arm64 | gitea-mcp | gitea-mcp_1.1.0_Darwin_arm64.tar.gz |
| macOS x86_64 | Darwin | x86_64 | gitea-mcp | gitea-mcp_1.1.0_Darwin_x86_64.tar.gz |
| Linux ARM64 | Linux | arm64 / aarch64 | gitea-mcp | gitea-mcp_1.1.0_Linux_arm64.tar.gz |
| Linux i386 | Linux | i386 / i686 | gitea-mcp | gitea-mcp_1.1.0_Linux_i386.tar.gz |
| Linux x86_64 | Linux | x86_64 | gitea-mcp | gitea-mcp_1.1.0_Linux_x86_64.tar.gz |
| Windows ARM64 | MINGW*/MSYS* | arm64 | gitea-mcp.exe | gitea-mcp_1.1.0_Windows_arm64.zip |
| Windows i386 | MINGW*/MSYS* | i386 / i686 | gitea-mcp.exe | gitea-mcp_1.1.0_Windows_i386.zip |
| Windows x86_64 | MINGW*/MSYS* | x86_64 | gitea-mcp.exe | gitea-mcp_1.1.0_Windows_x86_64.zip |
Version is pinned to v1.1.0. Download base URL: https://gitea.com/gitea/gitea-mcp/releases/download/v1.1.0/{asset_name}
Auto-download (default behavior):
test -f ~/.claude/bin/{binary_name}. If exists → reuse, skip download. Display: "gitea-mcp already installed at ~/.claude/bin/{binary_name}"mkdir -p ~/.claude/bincurl -sfL -o ~/.claude/bin/{asset_name} "https://gitea.com/gitea/gitea-mcp/releases/download/v1.1.0/{asset_name}"
Note: The -f (--fail) flag causes curl to exit non-zero on HTTP errors (e.g. 404) instead of saving the error page as a file.tar xf ~/.claude/bin/{asset_name} -C ~/.claude/bin/ gitea-mcpExpand-Archive -Path ~/.claude/bin/{asset_name} -DestinationPath ~/.claude/bin/ -Force or unzip -o ~/.claude/bin/{asset_name} gitea-mcp.exe -d ~/.claude/bin/FILESIZE=$(wc -c < ~/.claude/bin/{binary_name} 2>/dev/null || echo 0)
If FILESIZE < 102400 (100 KB) → remove the file (rm -f ~/.claude/bin/{binary_name}), treat download as failed.
Valid gitea-mcp binaries are several MiB; anything under 100 KB is corrupt or an error page.chmod +x ~/.claude/bin/{binary_name}~/.claude/bin/{binary_name} exists and passed size validation:
"Downloaded gitea-mcp v1.1.0 to ~/.claude/bin/{binary_name}"MINGW*/MSYS*):
a. PowerShell fallback (try first): curl via Bash is unreliable on Windows — use PowerShell's Invoke-WebRequest which does not have this limitation:
$binDir = "$env:USERPROFILE\.claude\bin"
New-Item -ItemType Directory -Force -Path $binDir | Out-Null
Invoke-WebRequest -Uri "https://gitea.com/gitea/gitea-mcp/releases/download/v1.1.0/{asset_name}" -OutFile "$binDir\{asset_name}" -UseBasicParsing
Expand-Archive -Path "$binDir\{asset_name}" -DestinationPath $binDir -Force
$env:USERPROFILE\.claude\bin\gitea-mcp.exe"Downloaded gitea-mcp v1.1.0 via PowerShell to {path}" → SuccessInvoke-WebRequest or Expand-Archive fails → continue to Go install fallback
b. Go install fallback: Check if Go is available: command -v goGOBIN=~/.claude/bin go install gitea.com/gitea/gitea-mcp@latest
~/.claude/bin/gitea-mcp.exe exists after install → Display: "Built gitea-mcp from source via go install to ~/.claude/bin/gitea-mcp.exe" → Successgo install fails → Display the error, then fall back to manual path collectioncommand -v wget
wget -q --show-progress -O ~/.claude/bin/{asset_name} "https://gitea.com/gitea/gitea-mcp/releases/download/v1.1.0/{asset_name}"
tar xf ~/.claude/bin/{asset_name} -C ~/.claude/bin/ gitea-mcp
chmod +x ~/.claude/bin/gitea-mcp
~/.claude/bin/{binary_name}"Downloaded gitea-mcp v1.1.0 via wget to ~/.claude/bin/{binary_name}" → SuccessThe binary path for .mcp.json: resolve ~/.claude/bin/{binary_name} to its absolute path.
Manual path collection (fallback only — if auto-download fails):
Display: "Auto-download failed. Download gitea-mcp manually from: https://gitea.com/gitea/gitea-mcp/releases"
"Enter the path to your gitea-mcp binary:"
Path validation (MANDATORY):
test -f "{path}" to verify the file exists."File not found at {path}. Please check the path and try again." → re-ask for the path. Max 3 attempts, then STOP with error: "gitea-mcp binary not found. Download it from https://gitea.com/gitea/gitea-mcp/releases and re-run /agent-flow:setup-mcp."test -x "{path}"). If not → run chmod +x "{path}" and inform user.Redmine uses the mcp-redmine Python package via uvx — no local clone or --prefix path required.
Invocation:
uvx --from mcp-redmine==2026.01.13.152335 mcp-redmine
Prerequisites: Python 3.10+ and the uv toolchain. Install from: https://docs.astral.sh/uv/getting-started/installation/
Lazy prereq check (at this point only — NOT upfront in Step 2b):
Run which uv (or where uv on Windows). If uv is not found → display:
"uv not found. Install the uv toolchain (Python 3.10+ required) from https://docs.astral.sh/uv/getting-started/installation/ and retry." → STOP redmine setup.
Environment variables required:
REDMINE_URL — full URL of your Redmine instance (e.g., https://redmine.example.com)REDMINE_API_KEY — your Redmine API keyNo path collection is needed — uvx handles the package download and execution automatically.
Load the appropriate template from examples/mcp-configs/{type}.json.
<YOUR_*> if skipped).mcp.json (preserve unrelated servers)Write .mcp.json to CWD.
Post-write placeholder validation (MANDATORY): After writing .mcp.json, scan every "command" field in the generated JSON:
command value contains <path-to-binary> or any args value contains <PATH_TO_ → the path collection in Step 5 was incomplete.
"ERROR: .mcp.json contains unresolved placeholder in server '{server_name}'. Returning to path collection.".mcp.json.command and args values are placeholder-free → proceed.If .mcp.json not in .gitignore:
.mcp.json to .gitignoreCreate .mcp.json.example (same structure, all tokens replaced with <YOUR_*>).
For each configured MCP server with non-placeholder tokens:
Pre-flight: binary/command existence check (for stdio servers — gitea binary, redmine uvx, YouTrack fallback npx):
command field from the server entry in .mcp.json.command -v "{command}" (or where "{command}" on Windows) to verify the command exists in PATH."[FAIL] {server_name}: command '{command}' not found. Re-run /agent-flow:setup-mcp to fix the setup." Skip connectivity check for this server.Connectivity check: Follow ../../core/mcp-detection.md (with check_write: false):
mcp_available: true → "[OK] {server_name} connected successfully"mcp_available: false → "[FAIL] {server_name}: {error}. Check your token and URL." (If error_type is "tls", append: " Try adding NODE_OPTIONS: --use-system-ca to the env block in .mcp.json.")If any placeholder tokens remain:
"[SKIP] {server_name}: token not configured. Add it to .mcp.json later.""Would you like to configure permanent tool permissions? This prevents permission prompts when resuming sessions."
Offer 4 levels:
[1] Full pipeline (recommended) — all tools needed for fix/implement/scaffold
[2] Read-only — analysis commands only (analyze-bug, status, dashboard)
[3] Minimal — basic tools, approve MCP per-call
[4] Custom — choose specific tools
Generate .claude/settings.json based on choice:
Full pipeline:
{
"permissions": {
"allow": [
"Read", "Write", "Edit", "Glob", "Grep", "Bash",
"mcp__{tracker_prefix}__*", "mcp__{sc_prefix}__*"
]
}
}
Where {tracker_prefix} and {sc_prefix} are specific to the configured servers (e.g., youtrack, gitea, github). Use specific prefixes, NOT wildcard mcp__*.
Read-only:
{
"permissions": {
"allow": [
"Read", "Glob", "Grep",
"mcp__{tracker_prefix}__*"
]
}
}
Minimal:
{
"permissions": {
"allow": ["Read", "Glob", "Grep"]
}
}
Custom: Let user select from list of tools.
If .claude/settings.json already exists:
Developer environment configured successfully.
.mcp.json — MCP server configuration ({N} servers)
.mcp.json.example — template for team sharing (no secrets)
.claude/settings.json — tool permissions ({level})
Next steps:
1. Run /agent-flow:check-setup to verify everything works
2. If you skipped tokens, add them to .mcp.json before running the pipeline
Tip: You can re-run /agent-flow:setup-mcp --update anytime to update your setup.
npx claudepluginhub asysta-act/agent-flow --plugin agent-flowValidates agent-flow pipeline configuration including automation config, MCP server connectivity, and auth tokens. Reports what works, what's missing, and what failed.
Integrates Claude Code with Harness MCP server for managing CD pipelines, Git repositories, pull requests, connectors, executions, and Jira synchronization. Useful for AI-powered DevOps workflows.
Configures MCP servers in GitHub Actions workflows with tool permissions, environment variables, and multi-server setups using Node.js, Python/uvx examples. Use for MCP integration in CI/CD.