一键导入
atlassian-multi-instance
How the Atlassian instance is configured across macOS and cloudbox. Use when adding, removing, or debugging Atlassian instance profiles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How the Atlassian instance is configured across macOS and cloudbox. Use when adding, removing, or debugging Atlassian instance profiles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use on any NixOS host (devbox on Hetzner, cloudbox on GCP) when SSH connection fails, host key mismatch, NixOS issues, CPU/IO contention (high load), or verifying the host is properly configured
Launch headless opencode sessions from CLI. Use when you need to start a new opencode session in the background to work on a task in parallel, or when spawning work on a specific directory.
How to apply configuration changes to NixOS hosts (devbox, cloudbox). Use when you need to rebuild the system, apply home-manager changes, or recover from issues.
Use when setting up or rotating PagerDuty MCP auth for OpenCode on macOS Keychain or cloudbox sops, or when debugging missing PagerDuty tools.
Use when setting up or rotating Rollbar MCP auth for OpenCode on macOS Keychain or cloudbox sops, when triaging a Rollbar error paged via PagerDuty, or when debugging missing Rollbar tools.
Documents the OpenCode agent set — what each does, when to use it, and why the others were cut. Use when questioning agent choices or considering adding/removing agents.
基于 SOC 职业分类
| name | atlassian-multi-instance |
| description | How the Atlassian instance is configured across macOS and cloudbox. Use when adding, removing, or debugging Atlassian instance profiles. |
A single Atlassian instance (default) is configured across macOS and cloudbox. Credentials are stored under generic key names so org-identifying info stays out of version control. The setup is written so a second instance can be added later without restructuring (see "Adding a Second Instance").
Credentials (Keychain / sops)
|
v
Shell startup loads ATLASSIAN_* (site/email/cloud-id/api-token)
|
v
nvim (FetchJiraTicket/FetchConfluencePage) uses ATLASSIAN_* env vars
MCP server (separate path):
atlassian --> wrapper reads site from Keychain/sops --> --resource https://{site}/ :3334
| Profile | macOS Keychain service | cloudbox sops key |
|---|---|---|
| default | atlassian-site | atlassian_site |
| default | atlassian-email | atlassian_email |
| default | atlassian-cloud-id | atlassian_cloud_id |
| default | atlassian-api-token | atlassian_api_token |
| File | What it does |
|---|---|
users/dev/home.darwin.nix | Loads default credentials from Keychain |
users/dev/home.cloudbox.nix | Loads default credentials from sops |
users/dev/opencode-config.nix | mkAtlassianMcp helper, one MCP server entry |
hosts/cloudbox/configuration.nix | sops.secrets declarations for the 4 Atlassian keys |
secrets/cloudbox.yaml | Encrypted secret values |
scripts/update-ssh-config.sh | SSH tunnel for port 3334 (MCP OAuth callback) |
If a second Atlassian account is needed again, add a generic profile name (e.g. alt) and wire it in parallel to default:
alt) -- keep it genericatlassian-alt-{site,email,cloud-id,api-token}atlassian_alt_{site,email,cloud_id,api_token}hosts/cloudbox/configuration.nixhome.darwin.nix and home.cloudbox.nix, plus a switch-atlassian
bash function that swaps ATLASSIAN_SITE/EMAIL/CLOUD_ID/API_TOKEN between profiles
(stash the default values into ATLASSIAN_DEFAULT_* at load time for round-tripping)assets/opencode/plugins/shell-env.tsmkAtlassianMcp call in opencode-config.nix with a new port (e.g. 3335)scripts/update-ssh-config.shThe mkAtlassianMcp helper in opencode-config.nix generates writeShellApplication wrappers that read the site URL at runtime:
atlassian-mcp = mkAtlassianMcp {
name = "atlassian-mcp";
port = 3334;
keychainService = "atlassian-site";
sopsSecret = "atlassian_site";
};
This keeps org-identifying URLs out of the generated opencode.managed.json. The wrapper uses --resource to isolate the OAuth session, so additional instances can run simultaneously if added.
Arg ordering matters: mcp-remote parses positional args as <url> [port] [flags...]. The callback port MUST come before --resource:
# Correct: port as args[1]
npx -y mcp-remote@0.1.38 https://mcp.atlassian.com/v1/mcp/authv2 3334 --resource "https://${SITE}/"
# Wrong: --resource as args[1], port is never parsed
npx -y mcp-remote https://mcp.atlassian.com/v1/mcp/authv2 --resource "https://${SITE}/" 3334
mcp-remote stores OAuth tokens in ~/.mcp-auth/mcp-remote-${version}/. Cache is keyed by a hash of the server URL + resource + headers.
Version-scoped invalidation: When mcp-remote upgrades (e.g., 0.1.37 → 0.1.38), the cache directory name changes and all cached tokens are lost. Pin the version in the wrapper (mcp-remote@0.1.38) to prevent npx -y from auto-upgrading.
If toggling an MCP on in OpenCode shows "Failed":
~/.config/opencode/opencode.json under mcp.<name>.command)cat /run/secrets/atlassian_site (Linux) or Keychain lookup (macOS)ls ~/.mcp-auth/mcp-remote-*/ -- look for *_tokens.jsonlocalhost:3334/oauth/callback?code=... tunnels back to the server.When tokens expire or cache is invalidated:
# 1. Ensure SSH tunnel is active (port 3334 forwarded)
# 2. Clean stale cache
rm -rf ~/.mcp-auth/mcp-remote-*
# 3. Run wrapper manually (find path from opencode.json mcp.<name>.command)
timeout 120 /nix/store/...-atlassian-mcp/bin/atlassian-mcp 2>&1
# 4. Copy the authorization URL, open in local browser
# 5. Complete consent -- callback goes through SSH tunnel
# 6. Tokens are cached; toggle MCP on in OpenCode