ychampion/cskill-agents/agent-specific-mcp-server-initialization

Claude Code and agent skill by ychampion/cskill-agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Connect each agent’s frontmatter MCP servers safely and tear them down without leaking clients, while honoring plugin-only guards.

Install

npx vskill@latest install ychampion/cskill-agents/agent-specific-mcp-server-initialization

SKILL.md

SKILL: Agent-Specific MCP Server Initialization

Domain: mcp-initialization Trigger: Load this skill when an agent defines extra MCP servers in its frontmatter and those clients must be joined to the parent session. Source Pattern: Distilled from reviewed subagent orchestration, isolation, and lifecycle implementations.

Core Method

Iterate the servers declared by the child agent, resolve named references from shared MCP configuration, and treat inline declarations as new agent-owned connections. Merge the resulting clients and tools into the inherited parent context, but keep track of which connections were created specifically for that child agent. When the agent ends, tear down only those agent-owned connections while leaving inherited shared clients intact. If no extra servers are declared, return the parent context unchanged.

Key Rules

  • Short-circuit when the agent declares no extra MCP servers and return the inherited clients unchanged.
  • For string specs, reuse memoized MCP configs; for inline objects, mark the resulting clients as newly created so their cleanup runs after the agent ends.
  • Always return the merged client list plus the fetched tools, and expose a cleanup closure that only targets the newly created clients.
  • Guard the loop with logging for missing configs so failures degrade gracefully instead of throwing.

Example Application

When implementing a custom agent that needs access to an inline MCP server, plug into this skill to merge the new server with the parent clients, reuse any shared configs, and ensure only the inline connection runs its cleanup path.

Anti-Patterns (What NOT to do)

  • Don’t rebuild the entire MCP client list from scratch every turn; reuse the inherited parent clients and append the new ones instead.
  • Don’t forget to clean up inline MCP servers; leaking them leaves dangling connections and stale credentials.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
36
Repository forks
7
7-day trend score
18

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ychampion/cskill-agents/agent-specific-mcp-server-initialization/badge)](https://verified-skill.com/skills/ychampion/cskill-agents/agent-specific-mcp-server-initialization)

Something wrong with this skill or its page? Tell us.