A skills-based approach for using MCPorter with Claude Code. This system saves context tokens by loading MCP tool documentation only when needed, through Claude's skills routing system.
MCP servers expose many tools, but loading all their schemas and documentation into every Claude conversation wastes context. You end up with thousands of tokens of tool definitions Claude may never use.
This project uses a two-tier system:
- CLAUDE.md - A lightweight router (~50 lines) that matches trigger phrases to skill files
- Skill files - Detailed documentation for each MCP, loaded only when relevant
When you say "add a button component", Claude reads CLAUDE.md, sees it matches shadcn triggers, then loads the full shadcn skill file. Tools are invoked via MCPorter CLI rather than native MCP connections.
~/.claude/
├── CLAUDE.md # Router with trigger phrases
└── skills/
├── mcp-setup.md # Meta-skill: how to add new MCPs
└── mcp/ # MCP-specific skill files
├── context7-docs.md
├── blender-mcp.md
└── shadcn-mcp.md
Note: Skill files can be in subdirectories. Just update the paths in CLAUDE.md accordingly (e.g.,
~/.claude/skills/mcp/blender-mcp.md).
npm install -g mcporterCopy the CLAUDE.md and skills/ folder to your Claude configuration directory:
# Create the skills directory
mkdir -p ~/.claude/skills
# Copy files
cp CLAUDE.md ~/.claude/
cp -r skills/* ~/.claude/skills/Add MCP servers to your MCP config file (e.g., ~/.cursor/mcp.json):
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@context7/mcp"]
},
"shadcn": {
"command": "npx",
"args": ["-y", "@anthropic/shadcn-mcp"]
}
}
}# List available servers
npx mcporter list
# List tools for a server
npx mcporter list context7 --all-parametersJust talk to Claude naturally. The router handles the rest:
| You say... | Claude loads... |
|---|---|
| "How do I use hooks in React?" | context7-docs.md |
| "Add a card component" | shadcn-mcp.md |
| "Create a 3D cube in Blender" | blender-mcp.md |
| "Set up the GitHub MCP" | mcp-setup.md |
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────┐
│ User prompt │ -> │ CLAUDE.md │ -> │ Skill file │ -> │ MCPorter│
│ │ │ (router) │ │ (full docs) │ │ CLI │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────┘
│ │
~50 lines Only loaded
always loaded when needed
# List all configured servers
npx mcporter list
# List tools with parameters
npx mcporter list <server> --all-parameters
# Call a tool
npx mcporter call <server>.<tool> param:"value"
# Examples
npx mcporter call context7.resolve-library-id libraryName:"react"
npx mcporter call shadcn.search_items_in_registries query:"button"Use the included mcp-setup.md skill. Tell Claude:
"Add the GitHub MCP server"
Or follow the manual process:
- Add server to your MCP config
- Discover tools:
npx mcporter list <server> --all-parameters - Test tools - MCPs often have undocumented requirements
- Create skill file at
~/.claude/skills/mcp/<server>.md - Add router entry to CLAUDE.md
See skills/mcp-setup.md for the complete workflow.
# [Server Name] Skill
Use this skill when [describe trigger conditions].
## When to Use
- [Condition 1]
- [Condition 2]
## Commands
### [Tool Name]
\`\`\`bash
npx mcporter call <server>.<tool> param:"value"
\`\`\`
## Common Workflows
### [Workflow Name]
1. Step 1
2. Step 2
## Quirks & Gotchas
- [Document hidden requirements discovered during testing]| Skill | Description | Trigger Phrases |
|---|---|---|
context7-docs.md |
Library documentation lookup | "how do I", "docs for", "latest API" |
shadcn-mcp.md |
UI component library | "shadcn", "add button", "UI component" |
blender-mcp.md |
3D scene control | "in Blender", "3D model", "render" |
mcp-setup.md |
Add new MCP servers | "add MCP", "new MCP server" |
MCPorter bridges the gap between MCP servers and CLI-based workflows:
- No native connection required - Works with any Claude interface
- Testable - Debug MCP calls directly in terminal
- Composable - Chain with other CLI tools
- Transparent - See exactly what's being sent/received
- Keep CLAUDE.md under ~50 lines - it's loaded on every conversation
- Put all detailed documentation in skill files
- Test MCP tools before writing skill files - they often have undocumented requirements
- Use the
Quirks & Gotchassection to document workarounds - Organize skills into subdirectories if you have many
MIT