Skip to main content
skill CX Codex

mcp-management — Claude Code skill: what it does, how to install

Manages Model Context Protocol servers, catalogues tools into JSON, and executes operations via Gemini CLI or Bun scripts without bloating the context.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add secondsky/claude-skills --skill mcp-management -a claude-code
Open on GitHub

What mcp-management does

The skill reads server configurations from .claude/.mcp.json to inspect, analyze, and execute Model Context Protocol capabilities across multiple endpoints. Instead of dumping full tool definitions into the conversation window, it writes discovery data to assets/tools.json and loads only relevant definitions when a task demands them.

Under the hood, TypeScript scripts in scripts/cli.ts discover tools, prompts, and resources. Execution prioritizes gemini -y -m gemini-2.5-flash whenever Gemini CLI is available in the environment. If the CLI is missing, the workflow falls back to direct script calls via bunx tsx or delegates work to the mcp-manager subagent.

Direct execution depends on Bun or Node.js to run scripts/cli.ts, so missing local runtimes will halt manual tool invocation.

What it helps with

  • catalogue tools and resources from multiple MCP servers into a persistent JSON file
  • run MCP operations without cluttering the primary agent context window
  • route tool calls through Gemini CLI or a fallback subagent
  • symlink .claude/.mcp.json configuration for Gemini CLI usage

Example prompts for the agent

  • List all available MCP tools using the cli.ts script
  • Call tool create_entities on the memory server with the given arguments
  • Run the screenshot task through Gemini CLI using configured MCP servers

How to install mcp-management

1Skills CLI (Vercel)

npx skills add secondsky/claude-skills --skill mcp-management -a claude-code

2Manually: put the files in place

~/.claude/skills/mcp-management/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mcp-management/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about mcp-management

How to install mcp-management in Claude Code?

Run npx skills add secondsky/claude-skills --skill mcp-management -a claude-code. Server definitions are read from .claude/.mcp.json.

What does mcp-management do?

It coordinates MCP servers, exports their schemas to assets/tools.json, and triggers tools programmatically. Execution routes through Gemini CLI, Bun scripts, or the mcp-manager subagent.

What runtimes are required to execute tools directly?

Direct script calls require Bun or Node.js to run bunx tsx scripts/cli.ts. Automated natural language execution relies on an installed gemini-cli binary.

Source text

SKILL.md · MIT
---
name: mcp-management
description: 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.
metadata:
  keywords: "MCP, Model Context Protocol, MCP servers, tool discovery, MCP integration, capability discovery, tool filtering, MCP tools, MCP prompts, MCP resources, progressive disclosure, multi-server management, tool catalog, mcp client, mcp execution, server configuration, context-efficient"
license: MIT
---

# 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.

© secondsky · MIT · secondsky/claude-skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set89

tailwind-v4-shadcn Sets up Tailwind CSS v4 with shadcn/ui, Vite, and React. Solves broken CSS variables, theme switching errors, and v4 migration pitfalls. CX Codex +1 8,100installs code-review A skill that sets rules for code review: how to take feedback, when to call the code-reviewer subagent, and how to avoid claiming success without proof. CX Codex +1 530installs aceternity-ui This skill gives your agent the Aceternity UI playbook: 100+ animated React components for Next.js with Tailwind. Useful for hero sections, parallax and 3D effects. CX Codex +1 1,500installs vitest-testing A skill that teaches your agent to write unit and integration tests with Vitest in TypeScript and JavaScript projects. Handy when you need config, mocks and coverage set up fast. CX Codex +1 1,200installs motion A skill that feeds your agent the Motion (Framer Motion) docs for React: drag-and-drop, scroll effects, layout transitions. Useful when the agent guesses at props. CX Codex +1 1,100installs playwright A Playwright skill for browser automation and end-to-end testing. It finds your running dev server and writes the test script for the task. CX Codex +1 1,000installs api-testing A skill that gets your agent writing HTTP API tests: Supertest for TypeScript, httpx and pytest for Python. Covers REST, GraphQL and error handling. CX Codex +1 890installs rest-api-design This skill hands your agent a set of REST conventions: resource names, HTTP methods, status codes and JSON response shape. Useful when you start a new API or want existing endpoints to match. CX Codex +1 586installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor