MCP Server and Client Build and Repair
Build or repair MCP servers and clients with validated schemas, correct transports, safe tool handlers, and protocol-level tests.
Before & after
Same prompt, same agent — the only difference is the skill.
Building an MCP server requires connecting tools to external data sources. You'll need to set up the server architecture, define tool handlers that the client can call, and establish the communication protocol. Consider what data your agents will need access to and design tools around those queries. You might use HTTP or stdio transport. Make sure to handle errors gracefully and validate input. Testing is important so your tools work reliably. Documentation helps users understand how to use your server.
MCP SERVER IMPLEMENTATION: ANALYTICS CONNECTOR
ARCHITECTURE
• Transport: stdio + optional HTTP
• SDK: TypeScript SDK
• Data source: Analytics platform API (env vars)
TOOL DEFINITIONS (3 tools)
Tool 1: query_events
Inputs: start_date (ISO8601), end_date, event_name, properties (object)
Output: Array of event objects with timestamp, user_id, event_name, properties
Validation: Zod schema enforces date format, property types
Tool 2: get_user_profile
Inputs: user_id (string)
Output: {user_id, created_at, total_events, last_active, custom_attributes}
Validation: User_id must be non-empty; return 404 if not found
Tool 3: list_funnels
Inputs: funnel_name, date_range (enum: 7d|30d|90d)
Output: {funnel_name, total_users, conversion_rate_by_step, avg_time_to_completion}
Validation: Funnel_name checked against approved list
SETUP STEPS
1. Install TypeScript SDK
2. Define Zod schemas for all inputs
3. Implement tool handlers (map inputs to API calls)
4. Set up error handling (rate limits, auth failures, timeouts)
5. Test with mock client
6. Deploy to stdio or HTTP endpoint
COMMON PITFALLS
• Rate limiting: Implement request deduplication and caching
• Auth expiry: Refresh tokens before expiration
• Timeout: Set 30-second handler timeout
• Schema drift: Version tool definitions; notify clients on changesAbout this skill
Your MCP server starts, but tools never appear. Or calls work locally and hang behind an HTTP proxy. This skill builds and repairs MCP integrations by tracing the protocol exchange, separating transport failures from handler failures, and implementing the smallest complete fix.
What it does
- Builds TypeScript or Python servers and clients with an explicit capability and transport contract.
- Designs tool schemas, resource URIs, result shapes, and useful error responses.
- Diagnoses initialization failures, missing tools, corrupted stdio, HTTP streaming problems, and stalled calls.
- Adds deadlines, cancellation handling, pagination, and safe retry behavior around external services.
- Checks authentication boundaries, credential handling, and isolation between remote clients.
- Produces focused protocol and integration checks, including failure cases and disconnect cleanup.
What you get
Runnable implementation files or a focused patch, plus launch instructions and checks that demonstrate discovery and execution through an MCP client. Debugging requests receive an evidence-based diagnosis with a clear distinction between confirmed causes and remaining hypotheses.
Best for
Developers exposing APIs, databases, or local utilities to AI clients, and teams maintaining MCP servers or embedding MCP clients in applications.
SKILL.md preview
---
name: mcp-server-and-client-build-and-repair
description: >-
Build, debug, and extend MCP servers and clients in TypeScript or Python by checking lifecycle negotiation, schemas, transports, execution boundaries, and client interoperability. Use when the user says "build an MCP server", "connect my app to MCP", "add a tool to this server", "my tools never show up", "tool calls keep timing out", "it works over stdio but fails over HTTP", "review this MCP implementation", or "expose these files as resources".
---
# MCP Server and Client Build and Repair
… (sign up to view the full skill)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.