Claude Cursor opencode Skill

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

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download vodailocz-kilo-kit-mcp-skills_operations_mcp-management-0448e6c.zip · 26 KB
Part of vodailocz/kilo-kit-mcp — 142 skills

Install

skills CLI npx skills add https://github.com/VoDaiLocz/kilo-kit-mcp/tree/main/skills/operations/mcp-management
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vodailocz-kilo-kit-mcp@llmmart
Git 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-manager subagent

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

{
  "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:

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:

  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:

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 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)

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

  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.

Files (kilo-kit-mcp)
  • assets
    • tools.json 82.5 KB
      [
        {
          "serverName": "memory",
          "name": "create_entities",
          "description": "Create multiple new entities in the knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {
              "entities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "The name of the entity"
                    },
                    "entityType": {
                      "type": "string",
                      "description": "The type of the entity"
                    },
                    "observations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of observation contents associated with the entity"
                    }
                  },
                  "required": [
                    "name",
                    "entityType",
                    "observations"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "entities"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "create_relations",
          "description": "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice",
          "inputSchema": {
            "type": "object",
            "properties": {
              "relations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "description": "The name of the entity where the relation starts"
                    },
                    "to": {
                      "type": "string",
                      "description": "The name of the entity where the relation ends"
                    },
                    "relationType": {
                      "type": "string",
                      "description": "The type of the relation"
                    }
                  },
                  "required": [
                    "from",
                    "to",
                    "relationType"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "relations"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "add_observations",
          "description": "Add new observations to existing entities in the knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {
              "observations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entityName": {
                      "type": "string",
                      "description": "The name of the entity to add the observations to"
                    },
                    "contents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of observation contents to add"
                    }
                  },
                  "required": [
                    "entityName",
                    "contents"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "observations"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "delete_entities",
          "description": "Delete multiple entities and their associated relations from the knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {
              "entityNames": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "An array of entity names to delete"
              }
            },
            "required": [
              "entityNames"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "delete_observations",
          "description": "Delete specific observations from entities in the knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {
              "deletions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entityName": {
                      "type": "string",
                      "description": "The name of the entity containing the observations"
                    },
                    "observations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "An array of observations to delete"
                    }
                  },
                  "required": [
                    "entityName",
                    "observations"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "deletions"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "delete_relations",
          "description": "Delete multiple relations from the knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {
              "relations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "description": "The name of the entity where the relation starts"
                    },
                    "to": {
                      "type": "string",
                      "description": "The name of the entity where the relation ends"
                    },
                    "relationType": {
                      "type": "string",
                      "description": "The type of the relation"
                    }
                  },
                  "required": [
                    "from",
                    "to",
                    "relationType"
                  ],
                  "additionalProperties": false
                },
                "description": "An array of relations to delete"
              }
            },
            "required": [
              "relations"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "read_graph",
          "description": "Read the entire knowledge graph",
          "inputSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "search_nodes",
          "description": "Search for nodes in the knowledge graph based on a query",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "The search query to match against entity names, types, and observation content"
              }
            },
            "required": [
              "query"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "memory",
          "name": "open_nodes",
          "description": "Open specific nodes in the knowledge graph by their names",
          "inputSchema": {
            "type": "object",
            "properties": {
              "names": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "An array of entity names to retrieve"
              }
            },
            "required": [
              "names"
            ],
            "additionalProperties": false
          }
        },
        {
          "serverName": "human-mcp",
          "name": "eyes_analyze",
          "description": "Understand images, videos, and GIFs with AI vision",
          "inputSchema": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "description": "File path, URL, or image to analyze"
              },
              "focus": {
                "type": "string",
                "description": "What to focus on in the analysis"
              },
              "detail": {
                "type": "string",
                "enum": [
                  "quick",
                  "detailed"
                ],
                "default": "detailed",
                "description": "Analysis depth"
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "eyes_compare",
          "description": "Find differences between images",
          "inputSchema": {
            "type": "object",
            "properties": {
              "image1": {
                "type": "string",
                "description": "First image path or URL"
              },
              "image2": {
                "type": "string",
                "description": "Second image path or URL"
              },
              "focus": {
                "type": "string",
                "enum": [
                  "differences",
                  "similarities",
                  "layout",
                  "content"
                ],
                "default": "differences",
                "description": "What to compare"
              }
            },
            "required": [
              "image1",
              "image2"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "eyes_read_document",
          "description": "Extract text and data from documents",
          "inputSchema": {
            "type": "object",
            "properties": {
              "document": {
                "type": "string",
                "description": "Document path or URL"
              },
              "pages": {
                "type": "string",
                "default": "all",
                "description": "Page range (e.g., '1-5' or 'all')"
              },
              "extract": {
                "type": "string",
                "enum": [
                  "text",
                  "tables",
                  "both"
                ],
                "default": "both",
                "description": "What to extract"
              }
            },
            "required": [
              "document"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "eyes_summarize_document",
          "description": "Create summaries from documents",
          "inputSchema": {
            "type": "object",
            "properties": {
              "document": {
                "type": "string",
                "description": "Document path or URL"
              },
              "length": {
                "type": "string",
                "enum": [
                  "brief",
                  "medium",
                  "detailed"
                ],
                "default": "medium",
                "description": "Summary length"
              },
              "focus": {
                "type": "string",
                "description": "Specific topics to focus on"
              }
            },
            "required": [
              "document"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_gen_image",
          "description": "Generate images from text descriptions using Gemini Imagen API",
          "inputSchema": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "Text description of the image to generate"
              },
              "model": {
                "type": "string",
                "enum": [
                  "gemini-2.5-flash-image-preview"
                ],
                "default": "gemini-2.5-flash-image-preview",
                "description": "Image generation model"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for the generated image"
              },
              "negative_prompt": {
                "type": "string",
                "description": "Text describing what should NOT be in the image"
              },
              "style": {
                "type": "string",
                "enum": [
                  "photorealistic",
                  "artistic",
                  "cartoon",
                  "sketch",
                  "digital_art"
                ],
                "description": "Style of the generated image"
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "1:1",
                  "16:9",
                  "9:16",
                  "4:3",
                  "3:4"
                ],
                "default": "1:1",
                "description": "Aspect ratio of the generated image"
              },
              "seed": {
                "type": "number",
                "description": "Random seed for reproducible generation"
              }
            },
            "required": [
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_gen_video",
          "description": "Generate videos from text descriptions using Gemini Veo 3.0 API",
          "inputSchema": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "Text description of the video to generate"
              },
              "model": {
                "type": "string",
                "enum": [
                  "veo-3.0-generate-001"
                ],
                "default": "veo-3.0-generate-001",
                "description": "Video generation model"
              },
              "duration": {
                "type": "string",
                "enum": [
                  "4s",
                  "8s",
                  "12s"
                ],
                "default": "4s",
                "description": "Duration of the generated video"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "mp4",
                  "webm"
                ],
                "default": "mp4",
                "description": "Output format for the generated video"
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "1:1",
                  "16:9",
                  "9:16",
                  "4:3",
                  "3:4"
                ],
                "default": "16:9",
                "description": "Aspect ratio of the generated video"
              },
              "fps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60,
                "default": 24,
                "description": "Frames per second"
              },
              "image_input": {
                "type": "string",
                "description": "Base64 encoded image or image URL to use as starting frame"
              },
              "style": {
                "type": "string",
                "enum": [
                  "realistic",
                  "cinematic",
                  "artistic",
                  "cartoon",
                  "animation"
                ],
                "description": "Style of the generated video"
              },
              "camera_movement": {
                "type": "string",
                "enum": [
                  "static",
                  "pan_left",
                  "pan_right",
                  "zoom_in",
                  "zoom_out",
                  "dolly_forward",
                  "dolly_backward"
                ],
                "description": "Camera movement type"
              },
              "seed": {
                "type": "number",
                "description": "Random seed for reproducible generation"
              }
            },
            "required": [
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_image_to_video",
          "description": "Generate videos from images and text descriptions using Gemini Imagen + Veo 3.0 APIs",
          "inputSchema": {
            "type": "object",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "Text description of the video animation"
              },
              "image_input": {
                "type": "string",
                "description": "Base64 encoded image or image URL to use as starting frame"
              },
              "model": {
                "type": "string",
                "enum": [
                  "veo-3.0-generate-001"
                ],
                "default": "veo-3.0-generate-001",
                "description": "Video generation model"
              },
              "duration": {
                "type": "string",
                "enum": [
                  "4s",
                  "8s",
                  "12s"
                ],
                "default": "4s",
                "description": "Duration of the generated video"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "mp4",
                  "webm"
                ],
                "default": "mp4",
                "description": "Output format for the generated video"
              },
              "aspect_ratio": {
                "type": "string",
                "enum": [
                  "1:1",
                  "16:9",
                  "9:16",
                  "4:3",
                  "3:4"
                ],
                "default": "16:9",
                "description": "Aspect ratio of the generated video"
              },
              "fps": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60,
                "default": 24,
                "description": "Frames per second"
              },
              "style": {
                "type": "string",
                "enum": [
                  "realistic",
                  "cinematic",
                  "artistic",
                  "cartoon",
                  "animation"
                ],
                "description": "Style of the generated video"
              },
              "camera_movement": {
                "type": "string",
                "enum": [
                  "static",
                  "pan_left",
                  "pan_right",
                  "zoom_in",
                  "zoom_out",
                  "dolly_forward",
                  "dolly_backward"
                ],
                "description": "Camera movement type"
              },
              "seed": {
                "type": "number",
                "description": "Random seed for reproducible generation"
              }
            },
            "required": [
              "prompt",
              "image_input"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_edit_image",
          "description": "Edit images using AI with text-based instructions for inpainting, outpainting, style transfer, object manipulation, and composition. No masks required - just describe what you want to change.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "operation": {
                "type": "string",
                "enum": [
                  "inpaint",
                  "outpaint",
                  "style_transfer",
                  "object_manipulation",
                  "multi_image_compose"
                ],
                "description": "Type of image editing operation to perform"
              },
              "input_image": {
                "type": "string",
                "description": "Base64 encoded image or file path to the input image"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "description": "Text description of the desired edit"
              },
              "mask_image": {
                "type": "string",
                "description": "Base64 encoded mask image for inpainting (white = edit area, black = keep)"
              },
              "mask_prompt": {
                "type": "string",
                "description": "Text description of the area to mask for editing"
              },
              "expand_direction": {
                "type": "string",
                "enum": [
                  "all",
                  "left",
                  "right",
                  "top",
                  "bottom",
                  "horizontal",
                  "vertical"
                ],
                "description": "Direction to expand the image"
              },
              "expansion_ratio": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 3,
                "default": 1.5,
                "description": "How much to expand the image (1.0 = no expansion)"
              },
              "style_image": {
                "type": "string",
                "description": "Base64 encoded reference image for style transfer"
              },
              "style_strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.7,
                "description": "Strength of style application"
              },
              "target_object": {
                "type": "string",
                "description": "Description of the object to manipulate"
              },
              "manipulation_type": {
                "type": "string",
                "enum": [
                  "move",
                  "resize",
                  "remove",
                  "replace",
                  "duplicate"
                ],
                "description": "Type of object manipulation"
              },
              "target_position": {
                "type": "string",
                "description": "New position for the object (e.g., 'center', 'top-left')"
              },
              "secondary_images": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Array of base64 encoded images for composition"
              },
              "composition_layout": {
                "type": "string",
                "enum": [
                  "blend",
                  "collage",
                  "overlay",
                  "side_by_side"
                ],
                "description": "How to combine multiple images"
              },
              "blend_mode": {
                "type": "string",
                "enum": [
                  "normal",
                  "multiply",
                  "screen",
                  "overlay",
                  "soft_light"
                ],
                "description": "Blending mode for image composition"
              },
              "negative_prompt": {
                "type": "string",
                "description": "What to avoid in the edited image"
              },
              "strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.8,
                "description": "Strength of the editing effect"
              },
              "guidance_scale": {
                "type": "number",
                "minimum": 1,
                "maximum": 20,
                "default": 7.5,
                "description": "How closely to follow the prompt"
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "description": "Random seed for reproducible results"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for the edited image"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "draft",
                  "standard",
                  "high"
                ],
                "default": "standard",
                "description": "Quality level of the editing"
              }
            },
            "required": [
              "operation",
              "input_image",
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_inpaint_image",
          "description": "Add or modify specific areas of an image using natural language descriptions. No mask required - just describe what to change and where.",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Base64 encoded image or file path to the input image"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "description": "Text description of what to add or change in the image"
              },
              "mask_image": {
                "type": "string",
                "description": "(Optional) Base64 encoded mask image - not used by Gemini but kept for compatibility"
              },
              "mask_prompt": {
                "type": "string",
                "description": "Text description of WHERE in the image to make changes (e.g., 'the empty space beside the cat', 'the top-left corner')"
              },
              "negative_prompt": {
                "type": "string",
                "description": "What to avoid in the edited area"
              },
              "strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.8,
                "description": "Strength of the editing effect"
              },
              "guidance_scale": {
                "type": "number",
                "minimum": 1,
                "maximum": 20,
                "default": 7.5,
                "description": "How closely to follow the prompt"
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "description": "Random seed for reproducible results"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "draft",
                  "standard",
                  "high"
                ],
                "default": "standard",
                "description": "Quality level"
              }
            },
            "required": [
              "input_image",
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_outpaint_image",
          "description": "Expand an image beyond its original borders in specified directions",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Base64 encoded image or file path to the input image"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "description": "Text description of what to add in the expanded areas"
              },
              "expand_direction": {
                "type": "string",
                "enum": [
                  "all",
                  "left",
                  "right",
                  "top",
                  "bottom",
                  "horizontal",
                  "vertical"
                ],
                "default": "all",
                "description": "Direction to expand the image"
              },
              "expansion_ratio": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 3,
                "default": 1.5,
                "description": "How much to expand the image (1.0 = no expansion)"
              },
              "negative_prompt": {
                "type": "string",
                "description": "What to avoid in the expanded areas"
              },
              "strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.8,
                "description": "Strength of the editing effect"
              },
              "guidance_scale": {
                "type": "number",
                "minimum": 1,
                "maximum": 20,
                "default": 7.5,
                "description": "How closely to follow the prompt"
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "description": "Random seed for reproducible results"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "draft",
                  "standard",
                  "high"
                ],
                "default": "standard",
                "description": "Quality level"
              }
            },
            "required": [
              "input_image",
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_style_transfer_image",
          "description": "Transfer the style from one image to another using AI",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Base64 encoded image or file path to the input image"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "description": "Text description of the desired style"
              },
              "style_image": {
                "type": "string",
                "description": "Base64 encoded reference image for style transfer"
              },
              "style_strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.7,
                "description": "Strength of style application"
              },
              "negative_prompt": {
                "type": "string",
                "description": "What style elements to avoid"
              },
              "guidance_scale": {
                "type": "number",
                "minimum": 1,
                "maximum": 20,
                "default": 7.5,
                "description": "How closely to follow the prompt"
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "description": "Random seed for reproducible results"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "draft",
                  "standard",
                  "high"
                ],
                "default": "standard",
                "description": "Quality level"
              }
            },
            "required": [
              "input_image",
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "gemini_compose_images",
          "description": "Combine multiple images into a single composition using AI",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Base64 encoded primary image"
              },
              "secondary_images": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Array of base64 encoded secondary images to compose"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "description": "Text description of how to compose the images"
              },
              "composition_layout": {
                "type": "string",
                "enum": [
                  "blend",
                  "collage",
                  "overlay",
                  "side_by_side"
                ],
                "default": "blend",
                "description": "How to combine the images"
              },
              "blend_mode": {
                "type": "string",
                "enum": [
                  "normal",
                  "multiply",
                  "screen",
                  "overlay",
                  "soft_light"
                ],
                "default": "normal",
                "description": "Blending mode for image composition"
              },
              "negative_prompt": {
                "type": "string",
                "description": "What to avoid in the composition"
              },
              "strength": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 1,
                "default": 0.8,
                "description": "Strength of the composition effect"
              },
              "guidance_scale": {
                "type": "number",
                "minimum": 1,
                "maximum": 20,
                "default": 7.5,
                "description": "How closely to follow the prompt"
              },
              "seed": {
                "type": "integer",
                "minimum": 0,
                "description": "Random seed for reproducible results"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "draft",
                  "standard",
                  "high"
                ],
                "default": "standard",
                "description": "Quality level"
              }
            },
            "required": [
              "input_image",
              "secondary_images",
              "prompt"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "jimp_crop_image",
          "description": "Crop an image using Jimp with various modes (manual, center, aspect ratio, etc.)",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Input image - supports file paths, URLs, or base64 data URIs"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "manual",
                  "center",
                  "top_left",
                  "top_right",
                  "bottom_left",
                  "bottom_right",
                  "aspect_ratio"
                ],
                "default": "manual",
                "description": "Crop mode"
              },
              "x": {
                "type": "integer",
                "minimum": 0,
                "description": "X coordinate for crop start (manual mode)"
              },
              "y": {
                "type": "integer",
                "minimum": 0,
                "description": "Y coordinate for crop start (manual mode)"
              },
              "width": {
                "type": "integer",
                "minimum": 1,
                "description": "Width of crop region"
              },
              "height": {
                "type": "integer",
                "minimum": 1,
                "description": "Height of crop region"
              },
              "aspect_ratio": {
                "type": "string",
                "description": "Aspect ratio (e.g., '16:9', '4:3')"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "bmp"
                ],
                "default": "png",
                "description": "Output image format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100)"
              }
            },
            "required": [
              "input_image"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "jimp_resize_image",
          "description": "Resize an image using Jimp with various algorithms and options",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Input image - supports file paths, URLs, or base64 data URIs"
              },
              "width": {
                "type": "integer",
                "minimum": 1,
                "description": "Target width in pixels"
              },
              "height": {
                "type": "integer",
                "minimum": 1,
                "description": "Target height in pixels"
              },
              "scale": {
                "type": "number",
                "minimum": 0.01,
                "maximum": 10,
                "description": "Scale factor (e.g., 0.5 for 50%, 2.0 for 200%)"
              },
              "maintain_aspect_ratio": {
                "type": "boolean",
                "default": true,
                "description": "Maintain aspect ratio when resizing"
              },
              "algorithm": {
                "type": "string",
                "enum": [
                  "nearestNeighbor",
                  "bilinear",
                  "bicubic",
                  "hermite",
                  "bezier"
                ],
                "default": "bilinear",
                "description": "Resize algorithm"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "bmp"
                ],
                "default": "png",
                "description": "Output image format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100)"
              }
            },
            "required": [
              "input_image"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "jimp_rotate_image",
          "description": "Rotate an image using Jimp by any angle",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Input image - supports file paths, URLs, or base64 data URIs"
              },
              "angle": {
                "type": "number",
                "description": "Rotation angle in degrees (positive = clockwise, negative = counter-clockwise)"
              },
              "background_color": {
                "type": "string",
                "description": "Background color for areas outside the rotated image (CSS color format, e.g., '#ffffff', 'white')"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "bmp"
                ],
                "default": "png",
                "description": "Output image format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100)"
              }
            },
            "required": [
              "input_image",
              "angle"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "jimp_mask_image",
          "description": "Apply a grayscale alpha mask to an image using Jimp (black pixels = transparent, white pixels = opaque)",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Input image to apply mask to - supports file paths, URLs, or base64 data URIs"
              },
              "mask_image": {
                "type": "string",
                "description": "Grayscale mask image (black = transparent, white = opaque) - supports file paths, URLs, or base64 data URIs"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "bmp"
                ],
                "default": "png",
                "description": "Output image format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100)"
              }
            },
            "required": [
              "input_image",
              "mask_image"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "rmbg_remove_background",
          "description": "Remove background from an image using AI-powered background removal",
          "inputSchema": {
            "type": "object",
            "properties": {
              "input_image": {
                "type": "string",
                "description": "Input image - supports file paths, URLs, or base64 data URIs"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "fast",
                  "balanced",
                  "high"
                ],
                "default": "balanced",
                "description": "Processing quality (fast = quick but less accurate, high = slower but more accurate)"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg"
                ],
                "default": "png",
                "description": "Output image format (PNG preserves transparency, JPEG requires background color)"
              },
              "background_color": {
                "type": "string",
                "description": "Background color for JPEG output (CSS color format, e.g., '#ffffff', 'white')"
              },
              "jpeg_quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 85,
                "description": "JPEG quality (0-100)"
              }
            },
            "required": [
              "input_image"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "playwright_screenshot_fullpage",
          "description": "Capture full page screenshot including scrollable content using Playwright",
          "inputSchema": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "URL of the webpage to capture"
              },
              "format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg"
                ],
                "default": "png",
                "description": "Screenshot format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100), only applicable for jpeg format"
              },
              "timeout": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 120000,
                "default": 30000,
                "description": "Navigation timeout in milliseconds"
              },
              "wait_until": {
                "type": "string",
                "enum": [
                  "load",
                  "domcontentloaded",
                  "networkidle"
                ],
                "default": "networkidle",
                "description": "When to consider navigation successful"
              },
              "viewport": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "minimum": 320,
                    "maximum": 3840,
                    "default": 1920
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 240,
                    "maximum": 2160,
                    "default": 1080
                  }
                },
                "additionalProperties": false,
                "description": "Viewport dimensions"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "playwright_screenshot_viewport",
          "description": "Capture viewport screenshot (visible area only) using Playwright",
          "inputSchema": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "URL of the webpage to capture"
              },
              "format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg"
                ],
                "default": "png",
                "description": "Screenshot format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100), only applicable for jpeg format"
              },
              "timeout": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 120000,
                "default": 30000,
                "description": "Navigation timeout in milliseconds"
              },
              "wait_until": {
                "type": "string",
                "enum": [
                  "load",
                  "domcontentloaded",
                  "networkidle"
                ],
                "default": "networkidle",
                "description": "When to consider navigation successful"
              },
              "viewport": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "minimum": 320,
                    "maximum": 3840,
                    "default": 1920
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 240,
                    "maximum": 2160,
                    "default": 1080
                  }
                },
                "additionalProperties": false,
                "description": "Viewport dimensions"
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "playwright_screenshot_element",
          "description": "Capture screenshot of specific element using Playwright",
          "inputSchema": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri",
                "description": "URL of the webpage to capture"
              },
              "selector": {
                "type": "string",
                "minLength": 1,
                "description": "CSS selector, text content, or role of the element to capture"
              },
              "selector_type": {
                "type": "string",
                "enum": [
                  "css",
                  "text",
                  "role"
                ],
                "default": "css",
                "description": "Type of selector (css, text, or role)"
              },
              "format": {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg"
                ],
                "default": "png",
                "description": "Screenshot format"
              },
              "quality": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "description": "JPEG quality (0-100), only applicable for jpeg format"
              },
              "timeout": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 120000,
                "default": 30000,
                "description": "Navigation and element wait timeout in milliseconds"
              },
              "wait_until": {
                "type": "string",
                "enum": [
                  "load",
                  "domcontentloaded",
                  "networkidle"
                ],
                "default": "networkidle",
                "description": "When to consider navigation successful"
              },
              "viewport": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "minimum": 320,
                    "maximum": 3840,
                    "default": 1920
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 240,
                    "maximum": 2160,
                    "default": 1080
                  }
                },
                "additionalProperties": false,
                "description": "Viewport dimensions"
              },
              "wait_for_selector": {
                "type": "boolean",
                "default": true,
                "description": "Wait for the selector to be visible before capturing"
              }
            },
            "required": [
              "url",
              "selector"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "mouth_speak",
          "description": "Generate speech from text using Gemini Speech Generation API with voice customization",
          "inputSchema": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32000,
                "description": "Text to convert to speech (max 32k tokens)"
              },
              "voice": {
                "type": "string",
                "enum": [
                  "Astrid",
                  "Charon",
                  "Fenrir",
                  "Kore",
                  "Odin",
                  "Puck",
                  "Sage",
                  "Vox",
                  "Zephyr",
                  "Aoede",
                  "Apollo",
                  "Elektra",
                  "Iris",
                  "Nemesis",
                  "Perseus",
                  "Selene",
                  "Thalia",
                  "Argus",
                  "Ares",
                  "Demeter",
                  "Dione",
                  "Echo",
                  "Eros",
                  "Hephaestus",
                  "Hermes",
                  "Hyperion",
                  "Iapetus",
                  "Kronos",
                  "Leto",
                  "Maia",
                  "Mnemosyne"
                ],
                "default": "Zephyr",
                "description": "Voice to use for speech generation"
              },
              "model": {
                "type": "string",
                "enum": [
                  "gemini-2.5-flash-preview-tts",
                  "gemini-2.5-pro-preview-tts"
                ],
                "default": "gemini-2.5-flash-preview-tts",
                "description": "Speech generation model"
              },
              "language": {
                "type": "string",
                "enum": [
                  "ar-EG",
                  "de-DE",
                  "en-US",
                  "es-US",
                  "fr-FR",
                  "hi-IN",
                  "id-ID",
                  "it-IT",
                  "ja-JP",
                  "ko-KR",
                  "pt-BR",
                  "ru-RU",
                  "nl-NL",
                  "pl-PL",
                  "th-TH",
                  "tr-TR",
                  "vi-VN",
                  "ro-RO",
                  "uk-UA",
                  "bn-BD",
                  "en-IN",
                  "mr-IN",
                  "ta-IN",
                  "te-IN"
                ],
                "default": "en-US",
                "description": "Language for speech generation"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "wav",
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for generated audio"
              },
              "style_prompt": {
                "type": "string",
                "description": "Natural language prompt to control speaking style"
              }
            },
            "required": [
              "text"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "mouth_narrate",
          "description": "Generate narration for long-form content with chapter breaks and style control",
          "inputSchema": {
            "type": "object",
            "properties": {
              "content": {
                "type": "string",
                "minLength": 1,
                "description": "Long-form content to narrate"
              },
              "voice": {
                "type": "string",
                "enum": [
                  "Astrid",
                  "Charon",
                  "Fenrir",
                  "Kore",
                  "Odin",
                  "Puck",
                  "Sage",
                  "Vox",
                  "Zephyr",
                  "Aoede",
                  "Apollo",
                  "Elektra",
                  "Iris",
                  "Nemesis",
                  "Perseus",
                  "Selene",
                  "Thalia",
                  "Argus",
                  "Ares",
                  "Demeter",
                  "Dione",
                  "Echo",
                  "Eros",
                  "Hephaestus",
                  "Hermes",
                  "Hyperion",
                  "Iapetus",
                  "Kronos",
                  "Leto",
                  "Maia",
                  "Mnemosyne"
                ],
                "default": "Sage",
                "description": "Voice to use for narration"
              },
              "model": {
                "type": "string",
                "enum": [
                  "gemini-2.5-flash-preview-tts",
                  "gemini-2.5-pro-preview-tts"
                ],
                "default": "gemini-2.5-pro-preview-tts",
                "description": "Speech generation model"
              },
              "language": {
                "type": "string",
                "enum": [
                  "ar-EG",
                  "de-DE",
                  "en-US",
                  "es-US",
                  "fr-FR",
                  "hi-IN",
                  "id-ID",
                  "it-IT",
                  "ja-JP",
                  "ko-KR",
                  "pt-BR",
                  "ru-RU",
                  "nl-NL",
                  "pl-PL",
                  "th-TH",
                  "tr-TR",
                  "vi-VN",
                  "ro-RO",
                  "uk-UA",
                  "bn-BD",
                  "en-IN",
                  "mr-IN",
                  "ta-IN",
                  "te-IN"
                ],
                "default": "en-US",
                "description": "Language for narration"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "wav",
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for generated audio"
              },
              "narration_style": {
                "type": "string",
                "enum": [
                  "professional",
                  "casual",
                  "educational",
                  "storytelling"
                ],
                "default": "professional",
                "description": "Narration style"
              },
              "chapter_breaks": {
                "type": "boolean",
                "default": false,
                "description": "Add pauses between chapters/sections"
              },
              "max_chunk_size": {
                "type": "number",
                "default": 8000,
                "description": "Maximum characters per audio chunk"
              }
            },
            "required": [
              "content"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "mouth_explain",
          "description": "Generate spoken explanations of code with technical analysis",
          "inputSchema": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "description": "Code to explain"
              },
              "language": {
                "type": "string",
                "enum": [
                  "ar-EG",
                  "de-DE",
                  "en-US",
                  "es-US",
                  "fr-FR",
                  "hi-IN",
                  "id-ID",
                  "it-IT",
                  "ja-JP",
                  "ko-KR",
                  "pt-BR",
                  "ru-RU",
                  "nl-NL",
                  "pl-PL",
                  "th-TH",
                  "tr-TR",
                  "vi-VN",
                  "ro-RO",
                  "uk-UA",
                  "bn-BD",
                  "en-IN",
                  "mr-IN",
                  "ta-IN",
                  "te-IN"
                ],
                "default": "en-US",
                "description": "Language for explanation"
              },
              "programming_language": {
                "type": "string",
                "description": "Programming language of the code"
              },
              "voice": {
                "type": "string",
                "enum": [
                  "Astrid",
                  "Charon",
                  "Fenrir",
                  "Kore",
                  "Odin",
                  "Puck",
                  "Sage",
                  "Vox",
                  "Zephyr",
                  "Aoede",
                  "Apollo",
                  "Elektra",
                  "Iris",
                  "Nemesis",
                  "Perseus",
                  "Selene",
                  "Thalia",
                  "Argus",
                  "Ares",
                  "Demeter",
                  "Dione",
                  "Echo",
                  "Eros",
                  "Hephaestus",
                  "Hermes",
                  "Hyperion",
                  "Iapetus",
                  "Kronos",
                  "Leto",
                  "Maia",
                  "Mnemosyne"
                ],
                "default": "Apollo",
                "description": "Voice to use for explanation"
              },
              "model": {
                "type": "string",
                "enum": [
                  "gemini-2.5-flash-preview-tts",
                  "gemini-2.5-pro-preview-tts"
                ],
                "default": "gemini-2.5-pro-preview-tts",
                "description": "Speech generation model"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "wav",
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for generated audio"
              },
              "explanation_level": {
                "type": "string",
                "enum": [
                  "beginner",
                  "intermediate",
                  "advanced"
                ],
                "default": "intermediate",
                "description": "Technical level of explanation"
              },
              "include_examples": {
                "type": "boolean",
                "default": true,
                "description": "Include examples in explanation"
              }
            },
            "required": [
              "code"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "mouth_customize",
          "description": "Test different voices and styles to find the best fit for your content",
          "inputSchema": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "description": "Sample text to test voice customization"
              },
              "voice": {
                "type": "string",
                "enum": [
                  "Astrid",
                  "Charon",
                  "Fenrir",
                  "Kore",
                  "Odin",
                  "Puck",
                  "Sage",
                  "Vox",
                  "Zephyr",
                  "Aoede",
                  "Apollo",
                  "Elektra",
                  "Iris",
                  "Nemesis",
                  "Perseus",
                  "Selene",
                  "Thalia",
                  "Argus",
                  "Ares",
                  "Demeter",
                  "Dione",
                  "Echo",
                  "Eros",
                  "Hephaestus",
                  "Hermes",
                  "Hyperion",
                  "Iapetus",
                  "Kronos",
                  "Leto",
                  "Maia",
                  "Mnemosyne"
                ],
                "description": "Base voice to customize"
              },
              "model": {
                "type": "string",
                "enum": [
                  "gemini-2.5-flash-preview-tts",
                  "gemini-2.5-pro-preview-tts"
                ],
                "default": "gemini-2.5-flash-preview-tts",
                "description": "Speech generation model"
              },
              "language": {
                "type": "string",
                "enum": [
                  "ar-EG",
                  "de-DE",
                  "en-US",
                  "es-US",
                  "fr-FR",
                  "hi-IN",
                  "id-ID",
                  "it-IT",
                  "ja-JP",
                  "ko-KR",
                  "pt-BR",
                  "ru-RU",
                  "nl-NL",
                  "pl-PL",
                  "th-TH",
                  "tr-TR",
                  "vi-VN",
                  "ro-RO",
                  "uk-UA",
                  "bn-BD",
                  "en-IN",
                  "mr-IN",
                  "ta-IN",
                  "te-IN"
                ],
                "default": "en-US",
                "description": "Language for speech generation"
              },
              "output_format": {
                "type": "string",
                "enum": [
                  "wav",
                  "base64",
                  "url"
                ],
                "default": "base64",
                "description": "Output format for generated audio"
              },
              "style_variations": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Array of different style prompts to test"
              },
              "compare_voices": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Astrid",
                    "Charon",
                    "Fenrir",
                    "Kore",
                    "Odin",
                    "Puck",
                    "Sage",
                    "Vox",
                    "Zephyr",
                    "Aoede",
                    "Apollo",
                    "Elektra",
                    "Iris",
                    "Nemesis",
                    "Perseus",
                    "Selene",
                    "Thalia",
                    "Argus",
                    "Ares",
                    "Demeter",
                    "Dione",
                    "Echo",
                    "Eros",
                    "Hephaestus",
                    "Hermes",
                    "Hyperion",
                    "Iapetus",
                    "Kronos",
                    "Leto",
                    "Maia",
                    "Mnemosyne"
                  ]
                },
                "description": "Additional voices to compare with the main voice"
              }
            },
            "required": [
              "text",
              "voice"
            ],
            "additionalProperties": false,
            "$schema": "http://json-schema.org/draft-07/schema#"
          }
        },
        {
          "serverName": "human-mcp",
          "name": "mcp__reasoning__sequentialthinking",
          "description": "Advanced sequential thinking for complex problems with thought revision and branching",
          "inputSchema": {
            "type": "object",
            "properties": {
              "thought": {
                "type": "string",
                "description": "Your current thinking step"
              },
              "nextThoughtNeeded": {
                "type": "boolean",
                "description": "Whether another thought step is needed"
              },
              "thoughtNumber": {
                "type": "integer",
                "minimum": 1,
                "description": "Current thought number"
              },
              "totalThoughts": {
                "type": "integer",
                "minimum": 1,
                "description": "Estimated total thoughts needed"
              },
              "sessionId": {
                "type": "string",
                "description": "Thinking session ID (auto-generated if not provided)"
              },
              "problem": {
                "type": "string",
                "description": "The problem to think through (required for new sessions)"
              },
              "isRevision": {
                "type": "boolean",
                "default": false,
                "description": "Whether this revises previous thinking"
              },
              "revisesThought": {
                "type": "integer",
                "minimum": 1,
                "description": "Which thought is being reconsidered"
              },
              "branchId": {
                "type": "string",
                "description": "Branch ident
  • references
    • configuration.md 1.7 KB
      # MCP Configuration Guide
      
      ## Configuration File Structure
      
      MCP servers are configured in `.claude/.mcp.json`:
      
      ```json
      {
        "mcpServers": {
          "server-name": {
            "command": "executable",
            "args": ["arg1", "arg2"],
            "env": {
              "API_KEY": "value"
            }
          }
        }
      }
      ```
      
      ## Common Server Configurations
      
      ### Memory Server
      
      Store and retrieve key-value data:
      
      ```json
      {
        "memory": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-memory"]
        }
      }
      ```
      
      ### Filesystem Server
      
      File operations with restricted access:
      
      ```json
      {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "/allowed/path"
          ]
        }
      }
      ```
      
      ### Brave Search Server
      
      Web search capabilities:
      
      ```json
      {
        "brave-search": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-brave-search"],
          "env": {
            "BRAVE_API_KEY": "${BRAVE_API_KEY}"
          }
        }
      }
      ```
      
      ### Puppeteer Server
      
      Browser automation:
      
      ```json
      {
        "puppeteer": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-puppeteer"]
        }
      }
      ```
      
      ## Environment Variables
      
      Reference env vars with `${VAR_NAME}` syntax:
      
      ```json
      {
        "api-server": {
          "command": "node",
          "args": ["server.js"],
          "env": {
            "API_KEY": "${MY_API_KEY}",
            "BASE_URL": "${API_BASE_URL}"
          }
        }
      }
      ```
      
      ## Configuration Loading Order
      
      Scripts check for config in this order:
      
      1. `process.env` (runtime environment)
      2. `.claude/skills/mcp-management/.env`
      3. `.claude/skills/.env`
      4. `.claude/.env`
      
      ## Validation
      
      Config must:
      - Be valid JSON
      - Include `mcpServers` object
      - Each server must have `command` and `args`
      - `env` is optional but must be object if present
      
    • gemini-cli-integration.md 4.2 KB
      # Gemini CLI Integration Guide
      
      ## Overview
      
      Gemini CLI provides automatic MCP tool discovery and execution via natural language prompts. This is the recommended primary method for executing MCP tools.
      
      ## Installation
      
      ```bash
      npm install -g gemini-cli
      ```
      
      Verify installation:
      ```bash
      gemini --version
      ```
      
      ## Configuration
      
      ### Symlink Setup
      
      Gemini CLI reads MCP servers from `.gemini/settings.json`. Create a symlink to `.claude/.mcp.json`:
      
      ```bash
      # Create .gemini directory
      mkdir -p .gemini
      
      # Create symlink (Unix/Linux/macOS)
      ln -sf .claude/.mcp.json .gemini/settings.json
      
      # Create symlink (Windows - requires admin or developer mode)
      mklink .gemini\settings.json .claude\.mcp.json
      ```
      
      ### Security
      
      Add to `.gitignore`:
      ```
      .gemini/settings.json
      ```
      
      This prevents committing sensitive API keys and server configurations.
      
      ## Usage
      
      ### Basic Syntax
      
      ```bash
      gemini [flags] -p "<prompt>"
      ```
      
      ### Essential Flags
      
      - `-y`: Skip confirmation prompts (auto-approve tool execution)
      - `-m <model>`: Model selection
        - `gemini-2.5-flash` (fast, recommended for MCP)
        - `gemini-2.5-flash` (balanced)
        - `gemini-pro` (high quality)
      - `-p "<prompt>"`: Task description
      
      ### Examples
      
      **Screenshot Capture**:
      ```bash
      gemini -y -m gemini-2.5-flash -p "Take a screenshot of https://www.google.com.vn"
      ```
      
      **Memory Operations**:
      ```bash
      gemini -y -m gemini-2.5-flash -p "Remember that Alice is a React developer working on e-commerce projects"
      ```
      
      **Web Research**:
      ```bash
      gemini -y -m gemini-2.5-flash -p "Search for latest Next.js 15 features and summarize the top 3"
      ```
      
      **Multi-Tool Orchestration**:
      ```bash
      gemini -y -m gemini-2.5-flash -p "Search for Claude AI documentation, take a screenshot of the homepage, and save both to memory"
      ```
      
      **Browser Automation**:
      ```bash
      gemini -y -m gemini-2.5-flash -p "Navigate to https://example.com, click the signup button, and take a screenshot"
      ```
      
      ## How It Works
      
      1. **Configuration Loading**: Reads `.gemini/settings.json` (symlinked to `.claude/.mcp.json`)
      2. **Server Connection**: Connects to all configured MCP servers
      3. **Tool Discovery**: Lists all available tools from servers
      4. **Prompt Analysis**: Gemini model analyzes the prompt
      5. **Tool Selection**: Automatically selects relevant tools
      6. **Execution**: Calls tools with appropriate parameters
      7. **Result Synthesis**: Combines tool outputs into coherent response
      
      ## Advanced Configuration
      
      ### Trusted Servers (Skip Confirmations)
      
      Edit `.claude/.mcp.json`:
      
      ```json
      {
        "mcpServers": {
          "memory": {
            "command": "npx",
            "args": ["-y", "@modelcontextprotocol/server-memory"],
            "trust": true
          }
        }
      }
      ```
      
      With `trust: true`, the `-y` flag is unnecessary.
      
      ### Tool Filtering
      
      Limit tool exposure:
      
      ```json
      {
        "mcpServers": {
          "chrome-devtools": {
            "command": "npx",
            "args": ["-y", "chrome-devtools-mcp@latest"],
            "includeTools": ["navigate_page", "screenshot"],
            "excludeTools": ["evaluate_js"]
          }
        }
      }
      ```
      
      ### Environment Variables
      
      Use `$VAR_NAME` syntax for sensitive data:
      
      ```json
      {
        "mcpServers": {
          "brave-search": {
            "command": "npx",
            "args": ["-y", "@modelcontextprotocol/server-brave-search"],
            "env": {
              "BRAVE_API_KEY": "$BRAVE_API_KEY"
            }
          }
        }
      }
      ```
      
      ## Troubleshooting
      
      ### Check MCP Status
      
      ```bash
      gemini
      > /mcp
      ```
      
      Shows:
      - Connected servers
      - Available tools
      - Configuration errors
      
      ### Verify Symlink
      
      ```bash
      # Unix/Linux/macOS
      ls -la .gemini/settings.json
      
      # Windows
      dir .gemini\settings.json
      ```
      
      Should show symlink pointing to `.claude/.mcp.json`.
      
      ### Debug Mode
      
      ```bash
      gemini --debug -p "Take a screenshot"
      ```
      
      Shows detailed MCP communication logs.
      
      ## Comparison with Alternatives
      
      | Method | Speed | Flexibility | Setup | Best For |
      |--------|-------|-------------|-------|----------|
      | Gemini CLI | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | All tasks |
      | Direct Scripts | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | Specific tools |
      | mcp-manager | ⭐ | ⭐⭐ | ⭐⭐⭐ | Fallback |
      
      **Recommendation**: Use Gemini CLI as primary method, fallback to scripts/subagent when unavailable.
      
      ## Resources
      
      - [Gemini CLI Documentation](https://geminicli.com/docs)
      - [MCP Server Configuration](https://geminicli.com/docs/tools/mcp-server)
      - [Tool Reference](https://geminicli.com/docs/tools/mcp-server/#tool-interaction)
      
    • mcp-protocol.md 2.2 KB
      # Model Context Protocol (MCP) Reference
      
      ## Protocol Overview
      
      MCP is JSON-RPC 2.0 based protocol for AI-tool integration.
      
      **Version**: 2025-03-26
      **Foundation**: JSON-RPC 2.0
      **Architecture**: Client-Host-Server
      
      ## Connection Lifecycle
      
      1. **Initialize**: Client sends `initialize` request with capabilities
      2. **Response**: Server responds with its capabilities
      3. **Handshake**: Client sends `notifications/initialized`
      4. **Active**: Bidirectional messaging
      5. **Shutdown**: Close connections, cleanup
      
      ## Core Capabilities
      
      ### Tools (Executable Functions)
      
      Tools are functions that servers expose for execution.
      
      **List Tools**:
      ```json
      {"method": "tools/list"}
      ```
      
      **Call Tool**:
      ```json
      {
        "method": "tools/call",
        "params": {
          "name": "tool_name",
          "arguments": {}
        }
      }
      ```
      
      ### Prompts (Interaction Templates)
      
      Prompts are reusable templates for LLM interactions.
      
      **List Prompts**:
      ```json
      {"method": "prompts/list"}
      ```
      
      **Get Prompt**:
      ```json
      {
        "method": "prompts/get",
        "params": {
          "name": "prompt_name",
          "arguments": {}
        }
      }
      ```
      
      ### Resources (Data Sources)
      
      Resources expose read-only data to clients.
      
      **List Resources**:
      ```json
      {"method": "resources/list"}
      ```
      
      **Read Resource**:
      ```json
      {
        "method": "resources/read",
        "params": {"uri": "resource://path"}
      }
      ```
      
      ## Transport Types
      
      ### stdio (Local)
      
      Server runs as subprocess. Messages via stdin/stdout.
      
      ```typescript
      const transport = new StdioClientTransport({
        command: 'node',
        args: ['server.js']
      });
      ```
      
      ### HTTP+SSE (Remote)
      
      POST for requests, GET for server events.
      
      ```typescript
      const transport = new StreamableHTTPClientTransport({
        url: 'http://localhost:3000/mcp'
      });
      ```
      
      ## Error Codes
      
      - **-32700**: Parse error
      - **-32600**: Invalid request
      - **-32601**: Method not found
      - **-32602**: Invalid params
      - **-32603**: Internal error
      - **-32002**: Resource not found (MCP-specific)
      
      ## Best Practices
      
      1. **Progressive Disclosure**: Load tool definitions on-demand
      2. **Context Efficiency**: Filter data before returning
      3. **Security**: Validate inputs, sanitize outputs
      4. **Resource Management**: Cleanup connections properly
      5. **Error Handling**: Handle all error cases gracefully
      
  • scripts
    • dist
      • analyze-tools.js 2.5 KB
        #!/usr/bin/env node
        /**
         * Tool Analyzer - Intelligently selects relevant MCP tools for tasks
         */
        /**
         * Analyze tools and return those relevant to the task
         */
        export function analyzeToolsForTask(tools, taskDescription) {
            const keywords = extractKeywords(taskDescription);
            const scoredTools = tools.map(tool => ({
                tool,
                score: calculateRelevanceScore(tool, keywords, taskDescription),
                reasons: explainScore(tool, keywords, taskDescription)
            }));
            // Sort by score descending
            scoredTools.sort((a, b) => b.score - a.score);
            // Filter tools with score above threshold
            const threshold = 0.3;
            const relevant = scoredTools.filter(st => st.score > threshold);
            return {
                relevantTools: relevant.map(st => st.tool),
                reasoning: relevant.map(st => `${st.tool.name} (${st.tool.serverName}): ${st.reasons.join('; ')}`),
                confidence: relevant.length > 0
                    ? relevant[0].score
                    : 0
            };
        }
        function extractKeywords(text) {
            const stopWords = new Set([
                'the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at',
                'to', 'for', 'of', 'with', 'by', 'from', 'as', 'is', 'was', 'are'
            ]);
            return text
                .toLowerCase()
                .split(/\W+/)
                .filter(word => word.length > 2 && !stopWords.has(word));
        }
        function calculateRelevanceScore(tool, keywords, taskDescription) {
            let score = 0;
            const toolText = `${tool.name} ${tool.description}`.toLowerCase();
            // Keyword matching
            for (const keyword of keywords) {
                if (toolText.includes(keyword)) {
                    score += 0.2;
                }
            }
            // Exact phrase matching
            const taskLower = taskDescription.toLowerCase();
            if (toolText.includes(taskLower) || taskLower.includes(tool.name.toLowerCase())) {
                score += 0.5;
            }
            // Schema complexity bonus (more params = more specialized)
            if (tool.inputSchema?.properties) {
                const paramCount = Object.keys(tool.inputSchema.properties).length;
                score += Math.min(paramCount * 0.05, 0.3);
            }
            return Math.min(score, 1.0);
        }
        function explainScore(tool, keywords, taskDescription) {
            const reasons = [];
            const toolText = `${tool.name} ${tool.description}`.toLowerCase();
            const matchedKeywords = keywords.filter(k => toolText.includes(k));
            if (matchedKeywords.length > 0) {
                reasons.push(`matches keywords: ${matchedKeywords.join(', ')}`);
            }
            if (tool.description) {
                reasons.push(`description: ${tool.description.slice(0, 100)}`);
            }
            return reasons;
        }
        
      • cli.js 4.5 KB
        #!/usr/bin/env node
        /**
         * MCP Management CLI - Command-line interface for MCP operations
         */
        import { MCPClientManager } from './mcp-client.js';
        import { analyzeToolsForTask } from './analyze-tools.js';
        async function main() {
            const args = process.argv.slice(2);
            const command = args[0];
            const manager = new MCPClientManager();
            try {
                // Load config
                await manager.loadConfig();
                console.log('✓ Config loaded');
                // Connect to all servers
                await manager.connectAll();
                console.log('✓ Connected to all MCP servers\n');
                switch (command) {
                    case 'list-tools':
                        await listTools(manager);
                        break;
                    case 'list-prompts':
                        await listPrompts(manager);
                        break;
                    case 'list-resources':
                        await listResources(manager);
                        break;
                    case 'analyze':
                        await analyzeForTask(manager, args.slice(1).join(' '));
                        break;
                    case 'call-tool':
                        await callTool(manager, args[1], args[2], args[3]);
                        break;
                    default:
                        printUsage();
                }
                await manager.cleanup();
            }
            catch (error) {
                console.error('Error:', error);
                process.exit(1);
            }
        }
        async function listTools(manager) {
            const tools = await manager.getAllTools();
            console.log(`Found ${tools.length} tools:\n`);
            for (const tool of tools) {
                console.log(`📦 ${tool.serverName} / ${tool.name}`);
                console.log(`   ${tool.description}`);
                if (tool.inputSchema?.properties) {
                    console.log(`   Parameters: ${Object.keys(tool.inputSchema.properties).join(', ')}`);
                }
                console.log('');
            }
        }
        async function listPrompts(manager) {
            const prompts = await manager.getAllPrompts();
            console.log(`Found ${prompts.length} prompts:\n`);
            for (const prompt of prompts) {
                console.log(`💬 ${prompt.serverName} / ${prompt.name}`);
                console.log(`   ${prompt.description}`);
                if (prompt.arguments && prompt.arguments.length > 0) {
                    console.log(`   Arguments: ${prompt.arguments.map((a) => a.name).join(', ')}`);
                }
                console.log('');
            }
        }
        async function listResources(manager) {
            const resources = await manager.getAllResources();
            console.log(`Found ${resources.length} resources:\n`);
            for (const resource of resources) {
                console.log(`📄 ${resource.serverName} / ${resource.name}`);
                console.log(`   URI: ${resource.uri}`);
                if (resource.description) {
                    console.log(`   ${resource.description}`);
                }
                if (resource.mimeType) {
                    console.log(`   Type: ${resource.mimeType}`);
                }
                console.log('');
            }
        }
        async function analyzeForTask(manager, task) {
            if (!task) {
                console.error('Please provide a task description');
                process.exit(1);
            }
            console.log(`Analyzing tools for task: "${task}"\n`);
            const tools = await manager.getAllTools();
            const analysis = analyzeToolsForTask(tools, task);
            console.log(`Confidence: ${(analysis.confidence * 100).toFixed(1)}%`);
            console.log(`\nRelevant tools (${analysis.relevantTools.length}):\n`);
            for (let i = 0; i < analysis.relevantTools.length; i++) {
                const tool = analysis.relevantTools[i];
                console.log(`${i + 1}. ${tool.serverName} / ${tool.name}`);
                console.log(`   ${analysis.reasoning[i]}`);
                console.log('');
            }
        }
        async function callTool(manager, serverName, toolName, argsJson) {
            if (!serverName || !toolName || !argsJson) {
                console.error('Usage: cli.ts call-tool <server> <tool> <json-args>');
                process.exit(1);
            }
            const args = JSON.parse(argsJson);
            console.log(`Calling ${serverName}/${toolName}...`);
            const result = await manager.callTool(serverName, toolName, args);
            console.log('\nResult:');
            console.log(JSON.stringify(result, null, 2));
        }
        function printUsage() {
            console.log(`
        MCP Management CLI
        
        Usage:
          cli.ts <command> [options]
        
        Commands:
          list-tools              List all tools from all MCP servers
          list-prompts            List all prompts from all MCP servers
          list-resources          List all resources from all MCP servers
          analyze <task>          Analyze which tools are relevant for a task
          call-tool <server> <tool> <json>  Call a specific tool
        
        Examples:
          cli.ts list-tools
          cli.ts analyze "search the web for documentation"
          cli.ts call-tool memory add '{"key":"name","value":"Alice"}'
          `);
        }
        main();
        
      • mcp-client.js 4.2 KB
        #!/usr/bin/env node
        /**
         * MCP Client - Core client for interacting with MCP servers
         */
        import { Client } from '@modelcontextprotocol/sdk/client/index.js';
        import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
        import { readFile } from 'fs/promises';
        import { resolve } from 'path';
        export class MCPClientManager {
            config = null;
            clients = new Map();
            async loadConfig(configPath = '.claude/.mcp.json') {
                const fullPath = resolve(process.cwd(), configPath);
                const content = await readFile(fullPath, 'utf-8');
                const config = JSON.parse(content);
                this.config = config;
                return config;
            }
            async connectToServer(serverName) {
                if (!this.config?.mcpServers[serverName]) {
                    throw new Error(`Server ${serverName} not found in config`);
                }
                const serverConfig = this.config.mcpServers[serverName];
                const transport = new StdioClientTransport({
                    command: serverConfig.command,
                    args: serverConfig.args,
                    env: serverConfig.env
                });
                const client = new Client({
                    name: `mcp-manager-${serverName}`,
                    version: '1.0.0'
                }, { capabilities: {} });
                await client.connect(transport);
                this.clients.set(serverName, client);
                return client;
            }
            async connectAll() {
                if (!this.config) {
                    throw new Error('Config not loaded. Call loadConfig() first.');
                }
                const connections = Object.keys(this.config.mcpServers).map(name => this.connectToServer(name));
                await Promise.all(connections);
            }
            async getAllTools() {
                const allTools = [];
                for (const [serverName, client] of this.clients.entries()) {
                    const response = await client.listTools();
                    for (const tool of response.tools) {
                        allTools.push({
                            serverName,
                            name: tool.name,
                            description: tool.description || '',
                            inputSchema: tool.inputSchema,
                            outputSchema: tool.outputSchema
                        });
                    }
                }
                return allTools;
            }
            async getAllPrompts() {
                const allPrompts = [];
                for (const [serverName, client] of this.clients.entries()) {
                    const response = await client.listPrompts();
                    for (const prompt of response.prompts) {
                        allPrompts.push({
                            serverName,
                            name: prompt.name,
                            description: prompt.description || '',
                            arguments: prompt.arguments
                        });
                    }
                }
                return allPrompts;
            }
            async getAllResources() {
                const allResources = [];
                for (const [serverName, client] of this.clients.entries()) {
                    const response = await client.listResources();
                    for (const resource of response.resources) {
                        allResources.push({
                            serverName,
                            uri: resource.uri,
                            name: resource.name,
                            description: resource.description,
                            mimeType: resource.mimeType
                        });
                    }
                }
                return allResources;
            }
            async callTool(serverName, toolName, args) {
                const client = this.clients.get(serverName);
                if (!client)
                    throw new Error(`Not connected to server: ${serverName}`);
                return await client.callTool({ name: toolName, arguments: args });
            }
            async getPrompt(serverName, promptName, args) {
                const client = this.clients.get(serverName);
                if (!client)
                    throw new Error(`Not connected to server: ${serverName}`);
                return await client.getPrompt({ name: promptName, arguments: args });
            }
            async readResource(serverName, uri) {
                const client = this.clients.get(serverName);
                if (!client)
                    throw new Error(`Not connected to server: ${serverName}`);
                return await client.readResource({ uri });
            }
            async cleanup() {
                for (const client of this.clients.values()) {
                    await client.close();
                }
                this.clients.clear();
            }
        }
        
    • .env.example 281 B · in bundle
    • .gitignore 801 B · in bundle
    • cli.ts 4.2 KB
      #!/usr/bin/env node
      /**
       * MCP Management CLI - Command-line interface for MCP operations
       */
      
      import { MCPClientManager } from './mcp-client.js';
      import { writeFileSync, mkdirSync } from 'fs';
      import { dirname, join } from 'path';
      import { fileURLToPath } from 'url';
      
      const __filename = fileURLToPath(import.meta.url);
      const __dirname = dirname(__filename);
      
      async function main() {
        const args = process.argv.slice(2);
        const command = args[0];
      
        const manager = new MCPClientManager();
      
        try {
          // Load config
          await manager.loadConfig();
          console.log('✓ Config loaded');
      
          // Connect to all servers
          await manager.connectAll();
          console.log('✓ Connected to all MCP servers\n');
      
          switch (command) {
            case 'list-tools':
              await listTools(manager);
              break;
      
            case 'list-prompts':
              await listPrompts(manager);
              break;
      
            case 'list-resources':
              await listResources(manager);
              break;
      
            case 'call-tool':
              await callTool(manager, args[1], args[2], args[3]);
              break;
      
            default:
              printUsage();
          }
      
          await manager.cleanup();
        } catch (error) {
          console.error('Error:', error);
          process.exit(1);
        }
      }
      
      async function listTools(manager: MCPClientManager) {
        const tools = await manager.getAllTools();
        console.log(`Found ${tools.length} tools:\n`);
      
        for (const tool of tools) {
          console.log(`📦 ${tool.serverName} / ${tool.name}`);
          console.log(`   ${tool.description}`);
          if (tool.inputSchema?.properties) {
            console.log(`   Parameters: ${Object.keys(tool.inputSchema.properties).join(', ')}`);
          }
          console.log('');
        }
      
        // Save tools to JSON file
        const assetsDir = join(__dirname, '..', 'assets');
        const toolsPath = join(assetsDir, 'tools.json');
      
        try {
          mkdirSync(assetsDir, { recursive: true });
          writeFileSync(toolsPath, JSON.stringify(tools, null, 2));
          console.log(`\n✓ Tools saved to ${toolsPath}`);
        } catch (error) {
          console.error(`\n✗ Failed to save tools: ${error}`);
        }
      }
      
      async function listPrompts(manager: MCPClientManager) {
        const prompts = await manager.getAllPrompts();
        console.log(`Found ${prompts.length} prompts:\n`);
      
        for (const prompt of prompts) {
          console.log(`💬 ${prompt.serverName} / ${prompt.name}`);
          console.log(`   ${prompt.description}`);
          if (prompt.arguments && prompt.arguments.length > 0) {
            console.log(`   Arguments: ${prompt.arguments.map((a: any) => a.name).join(', ')}`);
          }
          console.log('');
        }
      }
      
      async function listResources(manager: MCPClientManager) {
        const resources = await manager.getAllResources();
        console.log(`Found ${resources.length} resources:\n`);
      
        for (const resource of resources) {
          console.log(`📄 ${resource.serverName} / ${resource.name}`);
          console.log(`   URI: ${resource.uri}`);
          if (resource.description) {
            console.log(`   ${resource.description}`);
          }
          if (resource.mimeType) {
            console.log(`   Type: ${resource.mimeType}`);
          }
          console.log('');
        }
      }
      
      async function callTool(
        manager: MCPClientManager,
        serverName: string,
        toolName: string,
        argsJson: string
      ) {
        if (!serverName || !toolName || !argsJson) {
          console.error('Usage: cli.ts call-tool <server> <tool> <json-args>');
          process.exit(1);
        }
      
        const args = JSON.parse(argsJson);
        console.log(`Calling ${serverName}/${toolName}...`);
      
        const result = await manager.callTool(serverName, toolName, args);
        console.log('\nResult:');
        console.log(JSON.stringify(result, null, 2));
      }
      
      function printUsage() {
        console.log(`
      MCP Management CLI
      
      Usage:
        cli.ts <command> [options]
      
      Commands:
        list-tools                        List all tools and save to assets/tools.json
        list-prompts                      List all prompts from all MCP servers
        list-resources                    List all resources from all MCP servers
        call-tool <server> <tool> <json>  Call a specific tool
      
      Examples:
        cli.ts list-tools
        cli.ts call-tool memory create_entities '{"entities":[{"name":"Alice","entityType":"person"}]}'
        cli.ts call-tool human-mcp playwright_screenshot_fullpage '{"url":"https://example.com"}'
      
      Note: Tool analysis is done by the LLM reading assets/tools.json directly.
        `);
      }
      
      main();
      
    • mcp-client.ts 4.7 KB
      #!/usr/bin/env node
      /**
       * MCP Client - Core client for interacting with MCP servers
       */
      
      import { Client } from '@modelcontextprotocol/sdk/client/index.js';
      import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
      import { readFile } from 'fs/promises';
      import { resolve } from 'path';
      
      interface MCPConfig {
        mcpServers: {
          [key: string]: {
            command: string;
            args: string[];
            env?: Record<string, string>;
          };
        };
      }
      
      interface ToolInfo {
        serverName: string;
        name: string;
        description: string;
        inputSchema: any;
        outputSchema?: any;
      }
      
      interface PromptInfo {
        serverName: string;
        name: string;
        description: string;
        arguments?: any[];
      }
      
      interface ResourceInfo {
        serverName: string;
        uri: string;
        name: string;
        description?: string;
        mimeType?: string;
      }
      
      export class MCPClientManager {
        private config: MCPConfig | null = null;
        private clients: Map<string, Client> = new Map();
      
        async loadConfig(configPath: string = '.claude/.mcp.json'): Promise<MCPConfig> {
          const fullPath = resolve(process.cwd(), configPath);
          const content = await readFile(fullPath, 'utf-8');
          const config = JSON.parse(content) as MCPConfig;
          this.config = config;
          return config;
        }
      
        async connectToServer(serverName: string): Promise<Client> {
          if (!this.config?.mcpServers[serverName]) {
            throw new Error(`Server ${serverName} not found in config`);
          }
      
          const serverConfig = this.config.mcpServers[serverName];
          const transport = new StdioClientTransport({
            command: serverConfig.command,
            args: serverConfig.args,
            env: serverConfig.env
          });
      
          const client = new Client({
            name: `mcp-manager-${serverName}`,
            version: '1.0.0'
          }, { capabilities: {} });
      
          await client.connect(transport);
          this.clients.set(serverName, client);
          return client;
        }
      
        async connectAll(): Promise<void> {
          if (!this.config) {
            throw new Error('Config not loaded. Call loadConfig() first.');
          }
      
          const connections = Object.keys(this.config.mcpServers).map(name =>
            this.connectToServer(name)
          );
          await Promise.all(connections);
        }
      
        async getAllTools(): Promise<ToolInfo[]> {
          const allTools: ToolInfo[] = [];
          for (const [serverName, client] of this.clients.entries()) {
            const response = await client.listTools({}, { timeout: 300000 });
            for (const tool of response.tools) {
              allTools.push({
                serverName,
                name: tool.name,
                description: tool.description || '',
                inputSchema: tool.inputSchema,
                outputSchema: (tool as any).outputSchema
              });
            }
          }
          return allTools;
        }
      
        async getAllPrompts(): Promise<PromptInfo[]> {
          const allPrompts: PromptInfo[] = [];
          for (const [serverName, client] of this.clients.entries()) {
            const response = await client.listPrompts({}, { timeout: 300000 });
            for (const prompt of response.prompts) {
              allPrompts.push({
                serverName,
                name: prompt.name,
                description: prompt.description || '',
                arguments: prompt.arguments
              });
            }
          }
          return allPrompts;
        }
      
        async getAllResources(): Promise<ResourceInfo[]> {
          const allResources: ResourceInfo[] = [];
          for (const [serverName, client] of this.clients.entries()) {
            const response = await client.listResources({}, { timeout: 300000 });
            for (const resource of response.resources) {
              allResources.push({
                serverName,
                uri: resource.uri,
                name: resource.name,
                description: resource.description,
                mimeType: resource.mimeType
              });
            }
          }
          return allResources;
        }
      
        async callTool(serverName: string, toolName: string, args: any): Promise<any> {
          const client = this.clients.get(serverName);
          if (!client) throw new Error(`Not connected to server: ${serverName}`);
          return await client.callTool({ name: toolName, arguments: args }, { timeout: 300000 });
        }
      
        async getPrompt(serverName: string, promptName: string, args?: any): Promise<any> {
          const client = this.clients.get(serverName);
          if (!client) throw new Error(`Not connected to server: ${serverName}`);
          return await client.getPrompt({ name: promptName, arguments: args }, { timeout: 300000 });
        }
      
        async readResource(serverName: string, uri: string): Promise<any> {
          const client = this.clients.get(serverName);
          if (!client) throw new Error(`Not connected to server: ${serverName}`);
          return await client.readResource({ uri }, { timeout: 300000 });
        }
      
        async cleanup(): Promise<void> {
          for (const client of this.clients.values()) {
            await client.close();
          }
          this.clients.clear();
        }
      }
      
    • package.json 411 B
      {
        "name": "mcp-management-scripts",
        "version": "1.0.0",
        "type": "module",
        "description": "MCP client scripts for managing MCP servers",
        "scripts": {
          "build": "tsc",
          "test": "node --loader ts-node/esm test.ts"
        },
        "dependencies": {
          "@modelcontextprotocol/sdk": "^1.0.0"
        },
        "devDependencies": {
          "@types/node": "^20.0.0",
          "typescript": "^5.0.0",
          "ts-node": "^10.0.0"
        }
      }
      
    • tsconfig.json 323 B
      {
        "compilerOptions": {
          "target": "ES2022",
          "module": "ES2022",
          "moduleResolution": "node",
          "esModuleInterop": true,
          "strict": true,
          "skipLibCheck": true,
          "outDir": "./dist",
          "rootDir": "./",
          "resolveJsonModule": true
        },
        "include": ["*.ts"],
        "exclude": ["node_modules", "dist"]
      }
      
  • 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.

No comments yet.

Reviews (0)

No reviews yet.

Related