mcp-management
Manage MCP servers - discover, analyze, execute tools/prompts/resources. Use for MCP integrations, capability discovery, tool filtering, programmatic execution, or encountering context bloat, server configuration, tool execution errors.
What this skill does
# MCP Management
Skill for managing and interacting with Model Context Protocol (MCP) servers.
## Overview
MCP is an open protocol enabling AI agents to connect to external tools and data sources. This skill provides scripts and utilities to discover, analyze, and execute MCP capabilities from configured servers without polluting the main context window.
**Key Benefits**:
- Progressive disclosure of MCP capabilities (load only what's needed)
- Intelligent tool/prompt/resource selection based on task requirements
- Multi-server management from single config file
- Context-efficient: subagents handle MCP discovery and execution
- Persistent tool catalog: automatically saves discovered tools to JSON for fast reference
## When to Use This Skill
Use this skill when:
1. **Discovering MCP Capabilities**: Need to list available tools/prompts/resources from configured servers
2. **Task-Based Tool Selection**: Analyzing which MCP tools are relevant for a specific task
3. **Executing MCP Tools**: Calling MCP tools programmatically with proper parameter handling
4. **MCP Integration**: Building or debugging MCP client implementations
5. **Context Management**: Avoiding context pollution by delegating MCP operations to subagents
## Core Capabilities
### 1. Configuration Management
MCP servers configured in `.claude/.mcp.json`.
**Gemini CLI Integration** (recommended): Create symlink to `.gemini/settings.json`:
```bash
mkdir -p .gemini && ln -sf .claude/.mcp.json .gemini/settings.json
```
### 2. Capability Discovery
```bash
# Preferred: Using bun (faster)
bunx tsx scripts/cli.ts list-tools # Saves to assets/tools.json
bunx tsx scripts/cli.ts list-prompts
bunx tsx scripts/cli.ts list-resources
# Alternative: Using bunx
bunx tsx scripts/cli.ts list-tools
bunx tsx scripts/cli.ts list-prompts
bunx tsx scripts/cli.ts list-resources
```
Aggregates capabilities from multiple servers with server identification.
### 3. Intelligent Tool Analysis
LLM analyzes `assets/tools.json` directly - better than keyword matching algorithms.
### 4. Tool Execution
**Primary: Gemini CLI** (if available)
```bash
gemini -y -m gemini-2.5-flash -p "Take a screenshot of https://example.com"
```
**Secondary: Direct Scripts**
```bash
# Preferred: Using bun
bunx tsx scripts/cli.ts call-tool memory create_entities '{"entities":[...]}'
# Alternative: Using bunx
bunx tsx scripts/cli.ts call-tool memory create_entities '{"entities":[...]}'
```
**Fallback: mcp-manager Subagent**
## Implementation Patterns
### Pattern 1: Gemini CLI Auto-Execution (Primary)
Use Gemini CLI for automatic tool discovery and execution.
**Quick Example**:
```bash
gemini -y -m gemini-2.5-flash -p "Take a screenshot of https://example.com"
```
**Benefits**: Automatic tool discovery, natural language execution, faster than subagent orchestration.
### Pattern 2: Subagent-Based Execution (Fallback)
Use `mcp-manager` agent when Gemini CLI unavailable. Subagent discovers tools, selects relevant ones, executes tasks, reports back.
**Benefit**: Main context stays clean, only relevant tool definitions loaded when needed.
### Pattern 3: LLM-Driven Tool Selection
LLM reads `assets/tools.json`, intelligently selects relevant tools using context understanding, synonyms, and intent recognition.
### Pattern 4: Multi-Server Orchestration
Coordinate tools across multiple servers. Each tool knows its source server for proper routing.
## Quick Start
**Method 1: Gemini CLI** (recommended)
```bash
bun install -g gemini-cli # or: bun add -g gemini-cli
mkdir -p .gemini && ln -sf .claude/.mcp.json .gemini/settings.json
gemini -y -m gemini-2.5-flash -p "Take a screenshot of https://example.com"
```
**Method 2: Scripts**
```bash
cd .claude/skills/mcp-management/scripts
bun install # or: bun install
bunx tsx cli.ts list-tools # Saves to assets/tools.json
bunx tsx cli.ts call-tool memory create_entities '{"entities":[...]}'
```
**Method 3: mcp-manager Subagent**
Dispatch subagent to handle MCP operations, keeping main context clean.
## Secure Installation
When installing MCP server packages, follow supply chain security best practices:
- **Block post-install scripts** — `npm config set ignore-scripts true` (or Bun: disabled by default)
- **Cooldown period** — Wait 7 days for new package versions to be vetted by the community
- **Audit before installing** — Run `socket package score npm <pkg>` or use `socket npm install <pkg>` to check packages
Load the `dependency-upgrade` skill for full security configuration including Socket CLI integration, cooldown setup, lockfile validation, and CI enforcement.
## Integration Strategy
### Execution Priority
1. **Gemini CLI** (Primary): Fast, automatic, intelligent tool selection
- Check: `command -v gemini`
- Execute: `gemini -y -m gemini-2.5-flash -p "<task>"`
- Best for: All tasks when available
2. **Direct CLI Scripts** (Secondary): Manual tool specification
- Use when: Need specific tool/server control
- Execute: `bunx tsx scripts/cli.ts call-tool <server> <tool> <args>`
3. **mcp-manager Subagent** (Fallback): Context-efficient delegation
- Use when: Gemini unavailable or failed
- Keeps main context clean
### Integration with Agents
The `mcp-manager` agent uses this skill to:
- Check Gemini CLI availability first
- Execute via `gemini` command if available
- Fallback to direct script execution
- Discover MCP capabilities without loading into main context
- Report results back to main agent
This keeps main agent context clean and enables efficient MCP integration.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.