mcp-management
Manage Model Context Protocol (MCP) servers - discover, analyze, and execute tools/prompts/resources from configured MCP servers. Use when working with MCP integrations, need to discover available MCP capabilities, filter MCP tools for specific tasks, execute MCP tools programmat
Install
npx skills add https://github.com/VoDaiLocz/kilo-kit-mcp/tree/main/skills/operations/mcp-management
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vodailocz-kilo-kit-mcp@llmmart
git clone https://github.com/VoDaiLocz/kilo-kit-mcp.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole vodailocz/kilo-kit-mcp collection as a plugin from our marketplace. Git is the plain clone.
README
MCP Management Skill
Intelligent management and execution of Model Context Protocol (MCP) servers.
Overview
This skill enables Claude to discover, analyze, and execute MCP server capabilities without polluting the main context window. Perfect for context-efficient MCP integration using subagent-based architecture.
Features
- Multi-Server Management: Connect to multiple MCP servers from single config
- Intelligent Tool Discovery: Analyze which tools are relevant for specific tasks
- Progressive Disclosure: Load only necessary tool definitions
- Execution Engine: Call MCP tools with proper parameter handling
- Context Efficiency: Delegate MCP operations to
mcp-managersubagent
Quick Start
1. Install Dependencies
cd .claude/skills/mcp-management/scripts
npm install
2. Configure MCP Servers
Create .claude/.mcp.json:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"]
}
}
}
See .claude/.mcp.json.example for more examples.
3. Test Connection
cd .claude/skills/mcp-management/scripts
npx ts-node cli.ts list-tools
Usage Patterns
Pattern 1: Discover Available Tools
npx ts-node scripts/cli.ts list-tools
npx ts-node scripts/cli.ts list-prompts
npx ts-node scripts/cli.ts list-resources
Pattern 2: LLM-Driven Tool Selection
The LLM reads assets/tools.json and intelligently selects tools. No separate analysis command needed - the LLM's understanding of context and intent is superior to keyword matching.
Pattern 3: Execute MCP Tools
npx ts-node scripts/cli.ts call-tool memory add '{"key":"name","value":"Alice"}'
Pattern 4: Use with Subagent
In main Claude conversation:
User: "I need to search the web and save results"
Main Agent: [Spawns mcp-manager subagent]
mcp-manager: Discovers brave-search + memory tools, reports back
Main Agent: Uses recommended tools for implementation
Architecture
Main Agent (Claude)
↓ (delegates MCP tasks)
mcp-manager Subagent
↓ (uses skill)
mcp-management Skill
↓ (connects via)
MCP Servers (memory, filesystem, etc.)
Benefits:
- Main agent context stays clean
- MCP discovery happens in isolated subagent context
- Only relevant tool definitions loaded when needed
- Reduced token usage
File Structure
mcp-management/
├── SKILL.md # Skill definition
├── README.md # This file
├── scripts/
│ ├── mcp-client.ts # Core MCP client manager
│ ├── analyze-tools.ts # Intelligent tool selection
│ ├── cli.ts # Command-line interface
│ ├── package.json # Dependencies
│ ├── tsconfig.json # TypeScript config
│ └── .env.example # Environment template
└── references/
├── mcp-protocol.md # MCP protocol reference
└── configuration.md # Config guide
Scripts Reference
mcp-client.ts
Core client manager class:
- Load config from
.claude/.mcp.json - Connect to multiple MCP servers
- List/execute tools, prompts, resources
- Lifecycle management
cli.ts
Command-line interface:
list-tools- Show all tools and save to assets/tools.jsonlist-prompts- Show all promptslist-resources- Show all resourcescall-tool <server> <tool> <json>- Execute tool
Note: Tool analysis is performed by the LLM reading assets/tools.json, which provides better context understanding than algorithmic matching.
Configuration
Environment Variables
Scripts check for variables in this order:
process.env(runtime).claude/skills/mcp-management/.env.claude/skills/.env.claude/.env
MCP Config Format
{
"mcpServers": {
"server-name": {
"command": "executable", // Required
"args": ["arg1", "arg2"], // Required
"env": { // Optional
"VAR": "value",
"API_KEY": "${ENV_VAR}" // Reference env vars
}
}
}
}
Common MCP Servers
Install with npx:
@modelcontextprotocol/server-memory- Key-value storage@modelcontextprotocol/server-filesystem- File operations@modelcontextprotocol/server-brave-search- Web search@modelcontextprotocol/server-puppeteer- Browser automation@modelcontextprotocol/server-fetch- HTTP requests
Integration with mcp-manager Agent
The mcp-manager agent (.claude/agents/mcp-manager.md) uses this skill to:
- Discover: Connect to MCP servers, list capabilities
- Analyze: Filter relevant tools for tasks
- Execute: Call MCP tools on behalf of main agent
- Report: Send concise results back to main agent
This architecture keeps main context clean and enables efficient MCP integration.
Troubleshooting
"Config not found"
Ensure .claude/.mcp.json exists and is valid JSON.
"Server connection failed"
Check:
- Server command is installed (
npxpackages installed?) - Server args are correct
- Environment variables are set
"Tool not found"
List available tools first:
npx ts-node scripts/cli.ts list-tools
Resources
License
MIT
Skill manifest
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:
- Discovering MCP Capabilities: Need to list available tools/prompts/resources from configured servers
- Task-Based Tool Selection: Analyzing which MCP tools are relevant for a specific task
- Executing MCP Tools: Calling MCP tools programmatically with proper parameter handling
- MCP Integration: Building or debugging MCP client implementations
- 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:
mkdir -p .gemini && ln -sf .claude/.mcp.json .gemini/settings.json
See references/configuration.md and references/gemini-cli-integration.md.
2. Capability Discovery
npx tsx scripts/cli.ts list-tools # Saves to assets/tools.json
npx tsx scripts/cli.ts list-prompts
npx 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)
gemini -y -m gemini-2.5-flash -p "Take a screenshot of https://example.com"
Secondary: Direct Scripts
npx tsx scripts/cli.ts call-tool memory create_entities '{"entities":[...]}'
Fallback: mcp-manager Subagent
See references/gemini-cli-integration.md for complete examples.
Implementation Patterns
Pattern 1: Gemini CLI Auto-Execution (Primary)
Use Gemini CLI for automatic tool discovery and execution. See references/gemini-cli-integration.md for complete guide.
Quick Example:
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.
Scripts Reference
scripts/mcp-client.ts
Core MCP client manager class. Handles:
- Config loading from
.claude/.mcp.json - Connecting to multiple MCP servers
- Listing tools/prompts/resources across all servers
- Executing tools with proper error handling
- Connection lifecycle management
scripts/cli.ts
Command-line interface for MCP operations. Commands:
list-tools- Display all tools and save toassets/tools.jsonlist-prompts- Display all promptslist-resources- Display all resourcescall-tool <server> <tool> <json>- Execute a tool
Note: list-tools persists complete tool catalog to assets/tools.json with full schemas for fast reference, offline browsing, and version control.
Quick Start
Method 1: Gemini CLI (recommended)
npm install -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
cd .claude/skills/mcp-management/scripts && npm install
npx tsx cli.ts list-tools # Saves to assets/tools.json
npx tsx cli.ts call-tool memory create_entities '{"entities":[...]}'
Method 3: mcp-manager Subagent
See references/gemini-cli-integration.md for complete guide.
Technical Details
See references/mcp-protocol.md for:
- JSON-RPC protocol details
- Message types and formats
- Error codes and handling
- Transport mechanisms (stdio, HTTP+SSE)
- Best practices
Integration Strategy
Execution Priority
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
- Check:
Direct CLI Scripts (Secondary): Manual tool specification
- Use when: Need specific tool/server control
- Execute:
npx tsx scripts/cli.ts call-tool <server> <tool> <args>
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
geminicommand 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.
Files (kilo-kit-mcp)
-
assets
-
tools.json 82.5 KB
Loading…
-
-
references
-
configuration.md 1.7 KB
Loading… -
gemini-cli-integration.md 4.2 KB
Loading… -
mcp-protocol.md 2.2 KB
Loading…
-
-
scripts
-
dist
-
analyze-tools.js 2.5 KB
Loading… -
cli.js 4.5 KB
Loading… -
mcp-client.js 4.2 KB
Loading…
-
-
.env.example 281 B · in bundle
-
.gitignore 801 B · in bundle
-
cli.ts 4.2 KB
Loading… -
mcp-client.ts 4.7 KB
Loading… -
package.json 411 B
Loading… -
tsconfig.json 323 B
Loading…
-
-
README.md 5.6 KB
# MCP Management Skill Intelligent management and execution of Model Context Protocol (MCP) servers. ## Overview This skill enables Claude to discover, analyze, and execute MCP server capabilities without polluting the main context window. Perfect for context-efficient MCP integration using subagent-based architecture. ## Features - **Multi-Server Management**: Connect to multiple MCP servers from single config - **Intelligent Tool Discovery**: Analyze which tools are relevant for specific tasks - **Progressive Disclosure**: Load only necessary tool definitions - **Execution Engine**: Call MCP tools with proper parameter handling - **Context Efficiency**: Delegate MCP operations to `mcp-manager` subagent ## Quick Start ### 1. Install Dependencies ```bash cd .claude/skills/mcp-management/scripts npm install ``` ### 2. Configure MCP Servers Create `.claude/.mcp.json`: ```json { "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] }, "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"] } } } ``` See `.claude/.mcp.json.example` for more examples. ### 3. Test Connection ```bash cd .claude/skills/mcp-management/scripts npx ts-node cli.ts list-tools ``` ## Usage Patterns ### Pattern 1: Discover Available Tools ```bash npx ts-node scripts/cli.ts list-tools npx ts-node scripts/cli.ts list-prompts npx ts-node scripts/cli.ts list-resources ``` ### Pattern 2: LLM-Driven Tool Selection The LLM reads `assets/tools.json` and intelligently selects tools. No separate analysis command needed - the LLM's understanding of context and intent is superior to keyword matching. ### Pattern 3: Execute MCP Tools ```bash npx ts-node scripts/cli.ts call-tool memory add '{"key":"name","value":"Alice"}' ``` ### Pattern 4: Use with Subagent In main Claude conversation: ``` User: "I need to search the web and save results" Main Agent: [Spawns mcp-manager subagent] mcp-manager: Discovers brave-search + memory tools, reports back Main Agent: Uses recommended tools for implementation ``` ## Architecture ``` Main Agent (Claude) ↓ (delegates MCP tasks) mcp-manager Subagent ↓ (uses skill) mcp-management Skill ↓ (connects via) MCP Servers (memory, filesystem, etc.) ``` **Benefits**: - Main agent context stays clean - MCP discovery happens in isolated subagent context - Only relevant tool definitions loaded when needed - Reduced token usage ## File Structure ``` mcp-management/ ├── SKILL.md # Skill definition ├── README.md # This file ├── scripts/ │ ├── mcp-client.ts # Core MCP client manager │ ├── analyze-tools.ts # Intelligent tool selection │ ├── cli.ts # Command-line interface │ ├── package.json # Dependencies │ ├── tsconfig.json # TypeScript config │ └── .env.example # Environment template └── references/ ├── mcp-protocol.md # MCP protocol reference └── configuration.md # Config guide ``` ## Scripts Reference ### mcp-client.ts Core client manager class: - Load config from `.claude/.mcp.json` - Connect to multiple MCP servers - List/execute tools, prompts, resources - Lifecycle management ### cli.ts Command-line interface: - `list-tools` - Show all tools and save to assets/tools.json - `list-prompts` - Show all prompts - `list-resources` - Show all resources - `call-tool <server> <tool> <json>` - Execute tool **Note**: Tool analysis is performed by the LLM reading `assets/tools.json`, which provides better context understanding than algorithmic matching. ## Configuration ### Environment Variables Scripts check for variables in this order: 1. `process.env` (runtime) 2. `.claude/skills/mcp-management/.env` 3. `.claude/skills/.env` 4. `.claude/.env` ### MCP Config Format ```json { "mcpServers": { "server-name": { "command": "executable", // Required "args": ["arg1", "arg2"], // Required "env": { // Optional "VAR": "value", "API_KEY": "${ENV_VAR}" // Reference env vars } } } } ``` ## Common MCP Servers Install with `npx`: - `@modelcontextprotocol/server-memory` - Key-value storage - `@modelcontextprotocol/server-filesystem` - File operations - `@modelcontextprotocol/server-brave-search` - Web search - `@modelcontextprotocol/server-puppeteer` - Browser automation - `@modelcontextprotocol/server-fetch` - HTTP requests ## Integration with mcp-manager Agent The `mcp-manager` agent (`.claude/agents/mcp-manager.md`) uses this skill to: 1. **Discover**: Connect to MCP servers, list capabilities 2. **Analyze**: Filter relevant tools for tasks 3. **Execute**: Call MCP tools on behalf of main agent 4. **Report**: Send concise results back to main agent This architecture keeps main context clean and enables efficient MCP integration. ## Troubleshooting ### "Config not found" Ensure `.claude/.mcp.json` exists and is valid JSON. ### "Server connection failed" Check: - Server command is installed (`npx` packages installed?) - Server args are correct - Environment variables are set ### "Tool not found" List available tools first: ```bash npx ts-node scripts/cli.ts list-tools ``` ## Resources - [MCP Specification](https://modelcontextprotocol.io/specification/latest) - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) - [Official MCP Servers](https://github.com/modelcontextprotocol/servers) - [Skill References](./references/) ## License MIT -
SKILL.md 6.3 KB
--- name: mcp-management description: Manage Model Context Protocol (MCP) servers - discover, analyze, and execute tools/prompts/resources from configured MCP servers. Use when working with MCP integrations, need to discover available MCP capabilities, filter MCP tools for specific tasks, execute MCP tools programmatically, access MCP prompts/resources, or implement MCP client functionality. Supports intelligent tool selection, multi-server management, and context-efficient capability discovery. --- # 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 ``` See [references/configuration.md](references/configuration.md) and [references/gemini-cli-integration.md](references/gemini-cli-integration.md). ### 2. Capability Discovery ```bash npx tsx scripts/cli.ts list-tools # Saves to assets/tools.json npx tsx scripts/cli.ts list-prompts npx 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 npx tsx scripts/cli.ts call-tool memory create_entities '{"entities":[...]}' ``` **Fallback: mcp-manager Subagent** See [references/gemini-cli-integration.md](references/gemini-cli-integration.md) for complete examples. ## Implementation Patterns ### Pattern 1: Gemini CLI Auto-Execution (Primary) Use Gemini CLI for automatic tool discovery and execution. See [references/gemini-cli-integration.md](references/gemini-cli-integration.md) for complete guide. **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. ## Scripts Reference ### scripts/mcp-client.ts Core MCP client manager class. Handles: - Config loading from `.claude/.mcp.json` - Connecting to multiple MCP servers - Listing tools/prompts/resources across all servers - Executing tools with proper error handling - Connection lifecycle management ### scripts/cli.ts Command-line interface for MCP operations. Commands: - `list-tools` - Display all tools and save to `assets/tools.json` - `list-prompts` - Display all prompts - `list-resources` - Display all resources - `call-tool <server> <tool> <json>` - Execute a tool **Note**: `list-tools` persists complete tool catalog to `assets/tools.json` with full schemas for fast reference, offline browsing, and version control. ## Quick Start **Method 1: Gemini CLI** (recommended) ```bash npm install -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 && npm install npx tsx cli.ts list-tools # Saves to assets/tools.json npx tsx cli.ts call-tool memory create_entities '{"entities":[...]}' ``` **Method 3: mcp-manager Subagent** See [references/gemini-cli-integration.md](references/gemini-cli-integration.md) for complete guide. ## Technical Details See [references/mcp-protocol.md](references/mcp-protocol.md) for: - JSON-RPC protocol details - Message types and formats - Error codes and handling - Transport mechanisms (stdio, HTTP+SSE) - Best practices ## 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: `npx 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.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.