home / skills / plurigrid / asi / mcp-builder

mcp-builder skill

/skills/mcp-builder

This skill guides you to build high-quality MCP servers that enable LLMs to interact with external services through well-defined tools.

This is most likely a fork of the mcp-builder skill from project-n-e-k-o
npx playbooks add skill plurigrid/asi --skill mcp-builder

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.7 KB
---
name: mcp-builder
description: Guide for creating high-quality MCP (Model Context Protocol) servers
  that enable LLMs to interact with external services through well-designed tools.
  Use when building MCP servers to integrate external APIs or services, whether in
  Python (FastMCP) or Node/TypeScript (MCP SDK).
license: Apache-2.0
metadata:
  trit: 1
  source: anthropics/skills
---

# MCP Server Development Guide

Create MCP servers that enable LLMs to interact with external services through well-designed tools.

## High-Level Workflow

### Phase 1: Research and Planning

**Understand Modern MCP Design:**
- Balance comprehensive API coverage with specialized workflow tools
- Use clear, descriptive tool names with consistent prefixes (e.g., `github_create_issue`)
- Design tools that return focused, relevant data
- Provide actionable error messages

**Study MCP Protocol:**
- Start with sitemap: `https://modelcontextprotocol.io/sitemap.xml`
- Key pages: specification, transport mechanisms, tool definitions

### Phase 2: Implementation

**Recommended Stack:**
- **Language**: TypeScript (best SDK support)
- **Transport**: Streamable HTTP for remote, stdio for local

**Project Structure:**
```
my-mcp-server/
├── src/
│   ├── index.ts      # Server entry point
│   ├── tools/        # Tool implementations
│   └── utils/        # Shared utilities
├── package.json
└── tsconfig.json
```

**Tool Implementation Pattern:**
```typescript
server.registerTool({
  name: "github_create_issue",
  description: "Create a new GitHub issue",
  inputSchema: z.object({
    repo: z.string().describe("Repository name (owner/repo)"),
    title: z.string().describe("Issue title"),
    body: z.string().optional().describe("Issue body")
  }),
  outputSchema: z.object({
    id: z.number(),
    url: z.string()
  }),
  annotations: {
    readOnlyHint: false,
    destructiveHint: false,
    idempotentHint: false
  },
  handler: async (input) => {
    // Implementation
    return { id: 123, url: "https://..." };
  }
});
```

### Phase 3: Test

```bash
# TypeScript
npm run build
npx @modelcontextprotocol/inspector

# Python
python -m py_compile your_server.py
```

### Phase 4: Create Evaluations

Create 10 complex, realistic questions to test your MCP server:

```xml
<evaluation>
  <qa_pair>
    <question>Find all open issues labeled 'bug' in the repo</question>
    <answer>5</answer>
  </qa_pair>
</evaluation>
```

## Tool Design Best Practices

- Use Zod (TS) or Pydantic (Python) for schemas
- Include constraints and examples in field descriptions
- Define `outputSchema` for structured data
- Support pagination where applicable
- Add tool annotations (readOnly, destructive, idempotent)

Overview

This skill is a practical guide for creating high-quality MCP (Model Context Protocol) servers that let LLMs call external services via well-designed tools. It focuses on pragmatic patterns for planning, implementing, testing, and evaluating MCP servers with an emphasis on robust tool schemas and clear semantics. The guide favors developer ergonomics and predictable tool behavior to improve LLM reliability and safety.

How this skill works

It walks through a four-phase workflow: research and planning, implementation, testing, and creating evaluations. The guide recommends concrete project structure and a tool registration pattern with input/output schemas, annotations, and handlers. It also covers stack choices (TypeScript preferred for SDK support), transport options, and testing commands to validate server behavior. Finally, it explains how to build realistic evaluation sets to measure correctness and robustness.

When to use it

  • Building an MCP server to expose APIs and actions to LLM-based agents.
  • Designing tools that require strict input/output validation and predictable errors.
  • Implementing integrations where read-only, destructive, and idempotent hints matter.
  • Creating evaluation suites to verify LLM-driven workflows and edge cases.
  • Porting existing service APIs to a standardized MCP tool surface for models.

Best practices

  • Name tools with clear, consistent prefixes (e.g., github_create_issue) and short descriptions.
  • Define inputSchema and outputSchema using Zod (TS) or Pydantic (Python) and include constraints/examples.
  • Return focused, relevant data and actionable error messages; avoid noisy payloads.
  • Annotate tools with readOnly/destructive/idempotent hints and support pagination where applicable.
  • Use streamable HTTP for remote transport and stdio for local development; prefer TypeScript for SDK completeness.

Example use cases

  • Expose a GitHub integration with tools to list issues, create issues, and add labels with strict schemas.
  • Build a ticketing MCP server that enforces required fields and returns structured ticket objects for downstream reasoning.
  • Create a data-fetching service that supports pagination and filtered queries for large datasets.
  • Develop evaluation scenarios of 10+ realistic questions to validate tool behavior and edge-case handling.
  • Wrap internal microservices as MCP tools to allow LLM orchestration without leaking raw internals.

FAQ

Which language and transport should I choose?

TypeScript is recommended for best SDK support; use streamable HTTP for remote servers and stdio for local testing.

How many evaluations should I create?

Start with at least 10 complex, realistic QA pairs that exercise core workflows and edge cases to measure reliability.