Skip to main content
ClaudeWave
Skill384 repo starsupdated 3d ago

mcp-builder

The mcp-builder skill guides developers in creating MCP (Model Context Protocol) servers that allow language models to interact with external services and APIs through well-designed tools. Use this skill when building an MCP server to integrate external APIs or services in Python using FastMCP or in Node/TypeScript using the MCP SDK, following a disciplined approach that emphasizes careful planning, API coverage, clear tool naming, and actionable error messaging.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/waybarrios/opencode-power-pack /tmp/mcp-builder && cp -r /tmp/mcp-builder/skills/mcp-builder ~/.claude/skills/mcp-builder
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

## Overview

Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.

## Working discipline

These bias toward caution over speed — use judgment on trivial tasks.

- **Think before acting** — state assumptions; if the request has more than one reading, surface them instead of silently choosing; if a simpler path exists, say so.
- **Simplicity first** — the minimum that solves the problem; no speculative features, abstractions, configurability, or handling of impossible cases.
- **Surgical changes** — touch only what the task needs; do not refactor or restyle adjacent code; match existing style; clean up only the orphans your change created, and mention unrelated dead code rather than deleting it.
- **Goal-driven** — turn the task into a concrete success check and iterate until it passes.

## High-level workflow

Creating a high-quality MCP server involves four main phases.

### Phase 1: Deep research and planning

#### 1.1 Understand modern MCP design

**API coverage vs. workflow tools:** Balance comprehensive API endpoint coverage with specialized workflow tools. Workflow tools can be more convenient for specific tasks, while comprehensive coverage gives agents flexibility to compose operations. Performance varies by client — some clients benefit from code execution that combines basic tools, while others work better with higher-level workflows. When uncertain, prioritize comprehensive API coverage.

**Tool naming and discoverability:** Clear, descriptive tool names help agents find the right tools quickly. Use consistent prefixes (e.g., `github_create_issue`, `github_list_repos`) and action-oriented naming.

**Context management:** Agents benefit from concise tool descriptions and the ability to filter / paginate results. Design tools that return focused, relevant data. Some clients support code execution which can help agents filter and process data efficiently.

**Actionable error messages:** Error messages should guide agents toward solutions with specific suggestions and next steps.

#### 1.2 Study MCP protocol documentation

Start with the sitemap to find relevant pages: `https://modelcontextprotocol.io/sitemap.xml`. Then fetch specific pages with `.md` suffix for markdown format, e.g. `https://modelcontextprotocol.io/specification/draft.md`.

Key pages:

- Specification overview and architecture
- Transport mechanisms (streamable HTTP, stdio)
- Tool, resource, and prompt definitions

#### 1.3 Study framework documentation

**Recommended stack:**

- **Language**: TypeScript (high-quality SDK support, broad compatibility, models generate it well due to static typing and good linting).
- **Transport**: Streamable HTTP for remote servers using stateless JSON; stdio for local servers.

For TypeScript: load `https://raw.githubusercontent.com/modelcontextprotocol/typescript-sdk/main/README.md`.

For Python: load `https://raw.githubusercontent.com/modelcontextprotocol/python-sdk/main/README.md`.

#### 1.4 Plan the implementation

- **Understand the API:** review the service's API documentation to identify key endpoints, authentication requirements, and data models.
- **Tool selection:** prioritize comprehensive API coverage. List endpoints to implement, starting with the most common operations.

### Phase 2: Implementation

#### 2.1 Set up project structure

Standard layout for both languages includes a server entry point, a tools module, an API client utility, and a schema definition file.

#### 2.2 Implement core infrastructure

Shared utilities to build first:

- API client with authentication
- Error-handling helpers
- Response formatting (JSON / Markdown)
- Pagination support

#### 2.3 Implement tools

For each tool:

**Input schema:** use Zod (TypeScript) or Pydantic (Python). Include constraints and clear descriptions. Add examples in field descriptions.

**Output schema:** define `outputSchema` where possible for structured data. Use `structuredContent` in tool responses (TypeScript SDK feature). This helps clients understand and process tool outputs.

**Tool description:** concise summary of functionality, parameter descriptions, return-type schema.

**Implementation:** async/await for I/O. Proper error handling with actionable messages. Pagination where applicable. Return both text content and structured data when using modern SDKs.

**Annotations:**

- `readOnlyHint`: true / false
- `destructiveHint`: true / false
- `idempotentHint`: true / false
- `openWorldHint`: true / false

### Phase 3: Review and test

#### 3.1 Code quality

Review for: no duplicated code (DRY), consistent error handling, full type coverage, clear tool descriptions.

#### 3.2 Build and test

**TypeScript:** `npm run build` to verify compilation. Test with the MCP Inspector: `npx @modelcontextprotocol/inspector`.

**Python:** verify syntax with `python -m py_compile your_server.py`. Test with the MCP Inspector.

### Phase 4: Create evaluations

After implementing the server, create evaluations to test its effectiveness with real LLM agents.

#### 4.1 Purpose

Evaluations test whether LLMs can effectively use the MCP server to answer realistic, complex questions.

#### 4.2 Create 10 evaluation questions

1. **Tool inspection** — list available tools and understand their capabilities.
2. **Content exploration** — use READ-ONLY operations to explore available data.
3. **Question generation** — create 10 complex, realistic questions.
4. **Answer verification** — solve each question yourself to verify answers.

#### 4.3 Evaluation requirements

Each question must be:

- **Independent** — not dependent on other questions.
- **Read-only** — only non-destructive operations required.
- **Complex** — requiring multiple tool calls and deep exploration.
- **Realistic** — based on real use cases humans care about.
- **Verifiable** — single, clear ans
agents-md-improverSkill

Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate project context. Use when the user asks to check, audit, review, update, improve, or fix their AGENTS.md or CLAUDE.md, mentions "project rules maintenance" or "agent context optimization", or when the codebase has changed enough that the rules file may be stale. Scans the repository for every rules file, grades each against a quality rubric, outputs a quality report, and applies targeted edits only after user approval.

agents-md-reviseSkill

Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future sessions benefit. Use when the user says "revise the rules", "update AGENTS.md / CLAUDE.md with what we just learned", "save this to project memory", "remember this for next time", or at the end of a productive session when valuable context has emerged that is not yet documented. This is the COMPLEMENT to agents-md-improver: improver audits, this one captures.

code-architectSkill

Design a feature architecture by analyzing existing codebase patterns and conventions, then provide a comprehensive implementation blueprint with specific files to create or modify, component designs, data flows, and a build sequence. Use this skill when the user asks for an architecture design, an implementation plan for a non-trivial feature, or when dispatched as a sub-task during feature-dev architecture phase.

code-explorerSkill

Deeply analyze an existing codebase feature by tracing execution paths, mapping architecture layers, understanding patterns and abstractions, and documenting dependencies. Use this skill when you need to understand how a feature works before modifying or extending it, when dispatched as a sub-task during feature-dev exploration, or when the user asks "how does X work in this codebase".

code-reviewSkill

Review a pull request or a set of code changes for bugs, logic errors, and project-convention violations using a confidence-filtered, multi-agent process. Use this skill when the user asks to review a PR, audit pending changes, or inspect a diff for problems before merging.

code-reviewerSkill

Review code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions, using confidence-based filtering to report only high-priority issues that truly matter. Use this skill when reviewing a small set of changes locally (such as unstaged diff), when dispatched as a sub-task during feature-dev quality review, or when the user wants a critique of a specific file or function.

feature-devSkill

Guide a feature implementation through a structured seven-phase workflow with deep codebase understanding, clarifying questions, parallel architecture design, and quality review. Use this skill when the user asks to build a new feature, add functionality, or wants a methodical approach to implementation rather than diving straight to code.

frontend-designSkill

Create distinctive, production-grade frontend interfaces with high design quality and accessible markup. Use this skill when the user asks to build or beautify web components, pages, applications, landing pages, dashboards, artifacts, or React/HTML/CSS UI. Generates creative, polished code that avoids generic AI aesthetics, then self-checks it against an objective accessibility and quality rubric.