$npx -y skills add walidboulanouar/Ay-Skills --skill mcp-clientUniversal MCP client for connecting to any MCP server with progressive disclosure. Wraps MCP servers as skills to avoid context window bloat from tool definitions. Use when interacting with external MCP servers (Zapier, Sequential Thinking, GitHub, filesystem, etc.), listing avai
| 1 | # Universal MCP Client |
| 2 | |
| 3 | Connect to any MCP server with progressive disclosure - load tool schemas on-demand instead of dumping thousands of tokens into context upfront. |
| 4 | |
| 5 | ## Skill Location |
| 6 | |
| 7 | This skill is located at: `.claude/skills/mcp-client/` |
| 8 | |
| 9 | **Script path:** `.claude/skills/mcp-client/scripts/mcp_client.py` |
| 10 | |
| 11 | ## Configuration |
| 12 | |
| 13 | The script looks for config in this order: |
| 14 | 1. `MCP_CONFIG_PATH` env var (custom path) |
| 15 | 2. **`references/mcp-config.json`** (this skill's config - recommended) |
| 16 | 3. `.mcp.json` in project root |
| 17 | 4. `~/.claude.json` |
| 18 | |
| 19 | **Your config file:** `.claude/skills/mcp-client/references/mcp-config.json` |
| 20 | |
| 21 | Edit this file to add your API keys. The example file (`example-mcp-config.json`) is kept as a reference template. |
| 22 | |
| 23 | Security note: |
| 24 | - Never commit real API keys. This repo uses a placeholder `${AY_PROPOSALS_API_KEY}` for the AY Proposals server. |
| 25 | - Option 1 (recommended): Create a private config and point the script to it: `export MCP_CONFIG_PATH=~/.claude/skills/mcp-client/references/mcp-config.local.json` (same structure, with your real token). Keep that file out of git. |
| 26 | - Option 2: Export your key in the shell: `export AY_PROPOSALS_API_KEY=...` and ensure your runtime interpolates env vars. If not, use Option 1. |
| 27 | |
| 28 | **If the user hasn't provided their Zapier API key yet, ask them for it.** |
| 29 | |
| 30 | ## Running Commands |
| 31 | |
| 32 | All commands use the script at `.claude/skills/mcp-client/scripts/mcp_client.py`: |
| 33 | |
| 34 | ```bash |
| 35 | # List configured servers |
| 36 | python .claude/skills/mcp-client/scripts/mcp_client.py servers |
| 37 | |
| 38 | # List tools from a server |
| 39 | python .claude/skills/mcp-client/scripts/mcp_client.py tools <server_name> |
| 40 | |
| 41 | # Call a tool |
| 42 | python .claude/skills/mcp-client/scripts/mcp_client.py call <server> <tool> '{"arg": "value"}' |
| 43 | ``` |
| 44 | |
| 45 | ## Workflow |
| 46 | |
| 47 | 1. **Check config exists** - Run `servers` command. If error, create `.mcp.json` |
| 48 | 2. **List servers** - See what MCP servers are configured |
| 49 | 3. **List tools** - Get tool schemas from a specific server |
| 50 | 4. **Call tool** - Execute a tool with arguments |
| 51 | |
| 52 | ## Commands Reference |
| 53 | |
| 54 | | Command | Description | |
| 55 | |---------|-------------| |
| 56 | | `servers` | List all configured MCP servers | |
| 57 | | `tools <server>` | List tools with full parameter schemas | |
| 58 | | `call <server> <tool> '<json>'` | Execute a tool with arguments | |
| 59 | |
| 60 | ## Example: Zapier |
| 61 | |
| 62 | ```bash |
| 63 | # 1. List servers to confirm Zapier is configured |
| 64 | python .claude/skills/mcp-client/scripts/mcp_client.py servers |
| 65 | |
| 66 | # 2. List Zapier tools |
| 67 | python .claude/skills/mcp-client/scripts/mcp_client.py tools zapier |
| 68 | |
| 69 | # 3. Call a Zapier tool |
| 70 | python .claude/skills/mcp-client/scripts/mcp_client.py call zapier <tool_name> '{"param": "value"}' |
| 71 | ``` |
| 72 | |
| 73 | ## Example: Sequential Thinking |
| 74 | |
| 75 | ```bash |
| 76 | # 1. List tools |
| 77 | python .claude/skills/mcp-client/scripts/mcp_client.py tools sequential-thinking |
| 78 | |
| 79 | # 2. Use sequential thinking |
| 80 | python .claude/skills/mcp-client/scripts/mcp_client.py call sequential-thinking sequentialthinking '{"thought": "Breaking down the problem...", "thoughtNumber": 1, "totalThoughts": 5, "nextThoughtNeeded": true}' |
| 81 | ``` |
| 82 | |
| 83 | ## Config Format |
| 84 | |
| 85 | Config file format (`references/mcp-config.json`): |
| 86 | |
| 87 | ```json |
| 88 | { |
| 89 | "mcpServers": { |
| 90 | "zapier": { |
| 91 | "url": "https://mcp.zapier.com/api/v1/connect", |
| 92 | "api_key": "your-api-key" |
| 93 | }, |
| 94 | "sequential-thinking": { |
| 95 | "command": "npx", |
| 96 | "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | ``` |
| 101 | |
| 102 | **Transport detection:** |
| 103 | - `url` + `api_key` → FastMCP with Bearer auth (Zapier) |
| 104 | - `command` + `args` → stdio (local servers like sequential-thinking) |
| 105 | - `url` ending in `/sse` → SSE transport |
| 106 | - `url` ending in `/mcp` → Streamable HTTP |
| 107 | |
| 108 | ## Error Handling |
| 109 | |
| 110 | Errors return JSON: |
| 111 | ```json |
| 112 | {"error": "message", "type": "configuration|validation|connection"} |
| 113 | ``` |
| 114 | |
| 115 | - `configuration` - Config file not found. Create `.mcp.json` |
| 116 | - `validation` - Invalid server or tool name |
| 117 | - `connection` - Failed to connect to server |
| 118 | |
| 119 | ## Dependencies |
| 120 | |
| 121 | ```bash |
| 122 | pip install mcp fastmcp |
| 123 | ``` |
| 124 | |
| 125 | ## References |
| 126 | |
| 127 | - `references/example-mcp-config.json` - Template config file |
| 128 | - `references/mcp-servers.md` - Common server configurations |
| 129 | - `references/python-mcp-sdk.md` - Python SDK documentation |