agentleFS
luiseimanluiseiman/dotforge/skills/mcp-add/SKILL.md

mcp-add

Skill8 starsChanged 7 months agoMITView on GitHub

Install an MCP server template from dotforge into a project or global Claude Code config with a single command.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 9 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify the server template exists: $DOTFORGE_DIR/mcp/<server>/

    line 18
  2. Distinctive:

    If directory not found:

    line 19
  3. Very specific:

    If target doesn't exist and not --global: warn "No settings.json found.

    line 30
  4. Very specific:

    If target doesn't exist and --global: create ~/.claude/settings.json with {"permissions": {"allow": [], "deny": []}, "mcpServers": {}}.

    line 31
  5. Distinctive:

    Read all three template files:

    line 35
  6. Very specific:

    Read the target settings.json.

    line 53
  7. Distinctive:

    Check if the server is already configured:

    line 55
  8. Distinctive:

    If all permissions are already present, show "Permissions: no changes (already configured)".

    line 98
  9. Distinctive:

    If no new denies to add, omit that line.

    line 99
  10. Distinctive:

    Only proceed if user confirms (Y, y, Enter, or "yes").

    line 103
  11. Very specific:

    Read target settings.json as JSON.

    line 107
  12. Very specific:

    If mcpServers key doesn't exist in settings, create it.

    line 109
  13. Distinctive:

    Never remove or reorder existing entries

    line 115
  14. Very specific:

    If settings.permissions doesn't exist, create it with {"allow": [], "deny": []}.

    line 121
  15. Very specific:

    Write the modified settings.json with 2-space indentation.

    line 125
  16. Very specific:

    If the file already exists: overwrite — it's a managed template file.

    line 135
  17. Distinctive:

    Create the destination directory if it doesn't exist.

    line 138
  18. Distinctive:

    Add: "Installed globally — active in all projects."

    line 156
  19. Very specific:

    Add: "Installed in the current project.

    line 159

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MCP Add

Install a dotforge MCP server template into the current project's or global Claude Code configuration.

Input parsing

From $ARGUMENTS (format: mcp add <server> [--global]):

  • Extract <server>: the word after mcp add — one of github, postgres, supabase, redis, slack
  • Detect --global flag: if present, target ~/.claude/settings.json; otherwise target .claude/settings.json

Step 0: Validate

  1. Verify the server template exists: $DOTFORGE_DIR/mcp/<server>/
    • If directory not found:
      ✗ Unknown server '{{server}}'.
      Available: github, postgres, supabase, redis, slack
      Usage: /forge mcp add <server> [--global]
      Stop.
  2. Determine target settings path:
    • --global → ~/.claude/settings.json
    • default → .claude/settings.json
    • If target doesn't exist and not --global: warn "No settings.json found. Run /forge bootstrap first, or use --global to install globally." Stop.
    • If target doesn't exist and --global: create ~/.claude/settings.json with {"permissions": {"allow": [], "deny": []}, "mcpServers": {}}.

Step 1: Load template files

Read all three template files:

  • $DOTFORGE_DIR/mcp/<server>/config.json
  • $DOTFORGE_DIR/mcp/<server>/permissions.json
  • $DOTFORGE_DIR/mcp/<server>/rules.md

From config.json:

  • Server key: the non-metadata top-level key (e.g., "github", "postgres")
  • Server config block: the value of that key (the object with type, command, args, env)
  • Install note: the _install string — contains required env vars and instructions
  • Ignore all keys starting with _ (metadata)

From permissions.json:

  • allow: the allow array value (or [] if absent)
  • deny: the deny array value (or [] if absent)
  • Ignore all keys starting with _

Step 2: Check for existing configuration

Read the target settings.json.

Check if the server is already configured:

  • Present if mcpServers.<server> key exists in settings, OR
  • Present if any of the server's allow entries appear in permissions.allow

If already configured:

⚠  {{server}} MCP is already configured in {{target}}.

   Options:
   [u] Update — replace mcpServers.{{server}}, add missing permissions (does not remove existing ones)
   [q] Quit — make no changes

What would you like to do? [u/Q]
  • u → continue with update flow (Step 3)
  • Q or anything else → stop

Step 3: Show preview

══════════════════════════════════════════
  MCP Add: {{SERVER}} → {{target path}}
══════════════════════════════════════════

mcpServers.{{server}}:
{{pretty-print the server config block, replacing env var values like "${GITHUB_TOKEN}"
with the literal placeholder strings — do not expand env vars}}

New permissions:
  allow (+{{N}} new): {{list entries not already in target settings}}
  deny  (+{{N}} new): {{list entries not already in target settings}}
  (Existing permissions are not modified)

Rules:
  $DOTFORGE_DIR/mcp/{{server}}/rules.md
  → {{rules destination}}

Required environment variables:
  {{_install text from config.json}}

Proceed? [Y/n]

If all permissions are already present, show "Permissions: no changes (already configured)". If no new denies to add, omit that line.

Step 4: Apply changes

Only proceed if user confirms (Y, y, Enter, or "yes").

4a. Merge mcpServers

Read target settings.json as JSON. Set settings["mcpServers"]["{{server}}"] = the server config block. If mcpServers key doesn't exist in settings, create it.

4b. Merge permissions

Allow list:

  • For each entry in template allow[]: add to settings.permissions.allow only if not already present
  • Never remove or reorder existing entries

Deny list:

  • For each entry in template deny[]: add to settings.permissions.deny only if not already present
  • Never remove or reorder existing entries

If settings.permissions doesn't exist, create it with {"allow": [], "deny": []}.

4c. Write settings.json

Write the modified settings.json with 2-space indentation. Preserve all other existing keys (hooks, autoMemoryEnabled, env, etc.) exactly as they were.

4d. Copy rules.md

Determine rules destination:

  • Project mode: .claude/rules/mcp-{{server}}.md
  • Global mode: ~/.claude/rules/mcp-{{server}}.md

Copy $DOTFORGE_DIR/mcp/{{server}}/rules.md to the destination. If the file already exists: overwrite — it's a managed template file. Any project-specific customizations should live in a separate rule file, not in mcp-{{server}}.md.

Create the destination directory if it doesn't exist.

Step 5: Confirm result

✓ {{SERVER}} MCP configured

  Updated files:
    {{target settings.json}} — mcpServers.{{server}} added
    {{rules destination}} — behavior rules copied
    {{"+N permissions" if any were added, else "permissions: no changes"}}

  Next step:
    {{_install text from config.json}}
    Restart Claude Code to activate the MCP server.

If global install: Add: "Installed globally — active in all projects."

If project-only install: Add: "Installed in the current project. For global use: /forge mcp add {{server}} --global"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.