mcp-client-generator
Skill3 starsChanged 4 months agoMITView on GitHub
Generate MCP client integration: connection setup, capability discovery, tool invocation patterns, and error handling for agent applications. Use when working on MCP servers, MCP tools, MCP clients, or Model Context Protocol integrations.
- Reads credentials
In this repository59 other files it gives its agents.
- agent-memory-designerSkill
- ai-cost-optimizerSkill
- ai-evaluation-builderSkill
- ai-latency-optimizerSkill
- ai-solution-architectSkill
- ai-workflow-builderSkill
- context-engineeringSkill
- human-in-the-loop-designerSkill
- multi-agent-plannerSkill
- prompt-engineerSkill
- prompt-optimizerSkill
- prompt-reviewerSkill
- adr-generatorSkill
- api-designerSkill
- architecture-reviewSkill
- component-diagram-builderSkill
- container-diagram-builderSkill
- data-flow-analyzerSkill
- integration-plannerSkill
- observability-plannerSkill
- scalability-advisorSkill
- solution-architectureSkill
- system-context-builderSkill
- experiment-designerSkill
- go-to-market-plannerSkill
- pricing-strategy-advisorSkill
- mcp-best-practicesSkill
- mcp-security-reviewSkill
- mcp-server-generatorSkill
- mcp-tool-generatorSkill
- acceptance-criteria-generatorSkill
- analytics-instrumentation-plannerSkill
- competitive-analysisSkill
- epic-generatorSkill
- feature-prioritizationSkill
- idea-validatorSkill
- north-star-metric-advisorSkill
- okr-builderSkill
- persona-generatorSkill
- prd-generatorSkill
- problem-statement-builderSkill
- product-discovery-assistantSkill
- product-vision-builderSkill
- sprint-plannerSkill
- story-mappingSkill
- user-story-generatorSkill
- value-proposition-designerSkill
- chunking-strategy-advisorSkill
- embedding-strategy-advisorSkill
- hybrid-search-advisorSkill
- knowledge-ingestion-plannerSkill
- rag-architecture-designerSkill
- retriever-optimizerSkill
- ai-governance-advisorSkill
- ai-threat-modelingSkill
- guardrails-builderSkill
- owasp-llm-reviewerSkill
- prompt-injection-detectorSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Document server startup command (stdio) or endpoint URL (HTTP).
- Distinctive: line 70
Document argument validation before send (client-side schema check).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Client Generator
Purpose
Generate MCP client integration: connection setup, capability discovery, tool invocation patterns, and error handling for agent applications.
Input: Target MCP server(s), host application type (agent IDE, backend service, CLI), auth model, required capabilities
Output: MCP Client Integration Specification with connection config, invocation patterns, and test plan
Examples: See examples.md for worked input/output.
Workflow
Step 1: Inventory MCP servers
| Server | Transport | Capabilities needed | Auth method |
| stdio / HTTP | tools, resources | env / OAuth |
Document server startup command (stdio) or endpoint URL (HTTP).
Step 2: Design connection lifecycle
Init → Connect → Discover capabilities → Cache schema → Invoke → Disconnect/Reconnect| Phase | Responsibility | Timeout |
| Connect | Spawn process or HTTP handshake | 10s |
| Discover | list_tools, list_resources | 5s |
| Invoke | call_tool, read_resource | Per-tool SLA |
| Reconnect | On disconnect with backoff | Exponential |
Step 3: Define client configuration
{
"mcpServers": {
"server-name": {
"command": "npx",
"args": ["-y", "package-name"],
"env": { "API_KEY": "${API_KEY}" }
}
}
}For HTTP servers: base URL, headers, auth token injection.
Step 4: Design invocation patterns
| Pattern | Use case |
| Direct call | Agent selects tool with args |
| Wrapper function | Application abstracts tool names |
| Resource prefetch | Load context before agent turn |
| Prompt template | Server-provided prompt with args |
Document argument validation before send (client-side schema check).
Step 5: Plan error handling
| Error | Client action |
| Connection refused | Retry 3x with backoff; surface to user |
| Tool execution error | Parse structured error; retry if retryable |
| Timeout | Cancel; return partial result flag |
| Schema mismatch | Log; do not retry; report to server maintainer |
Step 6: Validate
Run Validation checklist.
Decision Rules
| Condition | Action |
| Multiple servers with overlapping tools | Namespace tool names in wrapper layer |
| stdio server in production backend | Prefer HTTP transport or sidecar pattern |
| User-specific OAuth per server | Store tokens securely; refresh before expiry |
| Tool args from LLM output | Validate against JSON Schema before invocation |
| Server not yet built | Generate client against capability manifest from mcp-server-generator |
| High-frequency tool calls | Add client-side rate limiter and connection pool |
Validation
- All target servers documented with transport and auth
- Connection lifecycle with timeouts defined
- Configuration template provided (no real secrets)
- Invocation patterns match application architecture
- Error handling per error type
- Capability discovery and schema caching planned
- Test plan: connect, list tools, invoke, error cases
- Logging excludes sensitive args and tokens
Anti-patterns
- Hardcoded tool list — skipping discovery; breaks on server updates.
- Unvalidated LLM args — passing raw model output directly to tools.
- Secret in config file — committing tokens to version control.
- No timeout — hanging client on unresponsive server.
- Tight coupling — application logic embedded in MCP transport layer.
Best Practices
- Cache discovered tool schemas with TTL; refresh on connect.
- Wrap MCP calls in application service layer, not in UI code.
- Log tool name and duration; redact arguments containing PII.
- Support graceful degradation when server unavailable.
- Pair with mcp-security-review for production auth patterns.
Output Structure
# MCP Client Integration: [Application Name]
## Server Inventory
| Server | Transport | Auth | Startup |
|--------|-----------|------|---------|
## Connection Lifecycle
[Phases, timeouts, reconnect policy]
## Configuration
[Template with placeholders]
## Invocation Patterns
| Pattern | Tool/Resource | Wrapper API |
|---------|---------------|-------------|
## Error Handling
| Error | Action | User message |
|-------|--------|--------------|
## Test Plan
| Case | Steps | Expected |
|------|-------|----------|
## Security Notes
[Token storage, log redaction]Next Skills
| Outcome | Recommended Skill |
| Build the MCP server | mcp/mcp-server-generator |
| Design tools consumed by client | mcp/mcp-tool-generator |
| Security review | mcp/mcp-security-review |
| Production patterns | mcp/mcp-best-practices |
| Agent workflow using tools | ai/ai-workflow-builder |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

