Agent skill

MCP Server Builder

by shareAI-lab in shareAI-lab/learn-claude-code

Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

MITAuto-check passedAgent Workflows

Install MCP Server Builder

skills CLI
$ npx skills add shareAI-lab/learn-claude-code --skill mcp-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shareAI-lab/learn-claude-code mcp-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shareAI-lab/learn-claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcp-builder .claude/skills/mcp-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-builder
GitHub stars
78k
Used in
5 other repos
Token cost
~1.2k tokens
SKILL.md length
147 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

  • Works in 5 steps: Project Setup → Basic Server Template → Register with Claude → …
  • Creating an MCP server that wraps an external service
  • SKILL.md covers What is MCP?, Quick Start: Python MCP Server, TypeScript MCP Server and Advanced Patterns, plus 2 more sections
  • Calls python3, npm and pip; reaches api.weatherapi.com

What it does

MCP servers can expose three things: tools Claude can call like API endpoints, resources it can read like files or records, and prompt templates. A Python quick start covers project setup with a virtual environment, a basic server template and registering the server in Claude's mcp.json file, and a TypeScript path starts from npm init and the @modelcontextprotocol/sdk package with a template of its own.

Advanced patterns follow for wrapping an external API with httpx, reading from a sqlite3 database and serving read-only resources. Testing uses the MCP Inspector against the running server. Best practices are clear tool descriptions, validated and sanitized input, meaningful error messages, async I/O, authentication for sensitive operations and tools that are safe to retry.

When your agent uses it

  • Creating an MCP server that wraps an external service
  • Adding custom tools to Claude through MCP
  • Exposing database content to an agent as read-only resources
  • Testing an MCP server with the Inspector

Example prompts

  • “Build a Python MCP server with a tool that looks up order status from our REST API.”
  • “Scaffold a TypeScript MCP server and register it in my Claude config.”
  • “Add a read-only resource for app settings to my existing MCP server.”

Requirements

  • Python 3 or Node.js with npm, depending on the server language

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Project Setup
  2. Basic Server Template
  3. Register with Claude
  4. Setup
  5. Template

What it can do on your machine

Read from SKILL.md and the folder at commit ce8f9f1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • npm
    • pip
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.weatherapi.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

MCP Server Builder loads about 1.2k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 147 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shareAI-lab/learn-claude-code at commit ce8f9f1, republished under its MIT licence (© shareAI-lab). 147 words, ~1,230 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-builder/SKILL.md (or your agent's skills folder).
name
mcp-builder
description
Build MCP (Model Context Protocol) servers that give Claude new capabilities. Use when user wants to create an MCP server, add tools to Claude, or integrate external services.

MCP Server Building Skill

You now have expertise in building MCP (Model Context Protocol) servers. MCP enables Claude to interact with external services through a standardized protocol.

What is MCP?

MCP servers expose:

  • Tools: Functions Claude can call (like API endpoints)
  • Resources: Data Claude can read (like files or database records)
  • Prompts: Pre-built prompt templates

Quick Start: Python MCP Server

1. Project Setup
bash
# Create project
mkdir my-mcp-server && cd my-mcp-server
python3 -m venv venv && source venv/bin/activate

# Install MCP SDK
pip install mcp
2. Basic Server Template
python
#!/usr/bin/env python3
"""my_server.py - A simple MCP server"""

from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp.types import Tool, TextContent

# Create server instance
server = Server("my-server")

# Define a tool
@server.tool()
async def hello(name: str) -> str:
    """Say hello to someone.

    Args:
        name: The name to greet
    """
    return f"Hello, {name}!"

@server.tool()
async def add_numbers(a: int, b: int) -> str:
    """Add two numbers together.

    Args:
        a: First number
        b: Second number
    """
    return str(a + b)

# Run server
async def main():
    async with stdio_server() as (read, write):
        await server.run(read, write)

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())
3. Register with Claude

Add to ~/.claude/mcp.json:

json
{
  "mcpServers": {
    "my-server": {
      "command": "python3",
      "args": ["/path/to/my_server.py"]
    }
  }
}

TypeScript MCP Server

1. Setup
bash
mkdir my-mcp-server && cd my-mcp-server
npm init -y
npm install @modelcontextprotocol/sdk
2. Template
typescript
// src/index.ts
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({
  name: "my-server",
  version: "1.0.0",
});

// Define tools
server.setRequestHandler("tools/list", async () => ({
  tools: [
    {
      name: "hello",
      description: "Say hello to someone",
      inputSchema: {
        type: "object",
        properties: {
          name: { type: "string", description: "Name to greet" },
        },
        required: ["name"],
      },
    },
  ],
}));

server.setRequestHandler("tools/call", async (request) => {
  if (request.params.name === "hello") {
    const name = request.params.arguments.name;
    return { content: [{ type: "text", text: `Hello, ${name}!` }] };
  }
  throw new Error("Unknown tool");
});

// Start server
const transport = new StdioServerTransport();
server.connect(transport);

Advanced Patterns

External API Integration
python
import httpx
from mcp.server import Server

server = Server("weather-server")

@server.tool()
async def get_weather(city: str) -> str:
    """Get current weather for a city."""
    async with httpx.AsyncClient() as client:
        resp = await client.get(
            f"https://api.weatherapi.com/v1/current.json",
            params={"key": "YOUR_API_KEY", "q": city}
        )
        data = resp.json()
        return f"{city}: {data['current']['temp_c']}C, {data['current']['condition']['text']}"
Database Access
python
import sqlite3
from mcp.server import Server

server = Server("db-server")

@server.tool()
async def query_db(sql: str) -> str:
    """Execute a read-only SQL query."""
    if not sql.strip().upper().startswith("SELECT"):
        return "Error: Only SELECT queries allowed"

    conn = sqlite3.connect("data.db")
    cursor = conn.execute(sql)
    rows = cursor.fetchall()
    conn.close()
    return str(rows)
Resources (Read-only Data)
python
@server.resource("config://settings")
async def get_settings() -> str:
    """Application settings."""
    return open("settings.json").read()

@server.resource("file://{path}")
async def read_file(path: str) -> str:
    """Read a file from the workspace."""
    return open(path).read()

Testing

bash
# Test with MCP Inspector
npx @anthropics/mcp-inspector python3 my_server.py

# Or send test messages directly
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | python3 my_server.py

Best Practices

  1. Clear tool descriptions: Claude uses these to decide when to call tools
  2. Input validation: Always validate and sanitize inputs
  3. Error handling: Return meaningful error messages
  4. Async by default: Use async/await for I/O operations
  5. Security: Never expose sensitive operations without auth
  6. Idempotency: Tools should be safe to retry

© shareAI-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/mcp-builder of shareAI-lab/learn-claude-code.

Open the folder on GitHubat commit ce8f9f1

Used in 6 other repositories

We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in shareAI-lab/learn-claude-code, which our catalogue first saw on October 7, 2026.

Compare with similar skills

MCP Server Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Server Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Server Builder this skillshareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
Zizkadb ReleaseZIZKA-AI-SL/ZizkaDB125—~399Automated safety check: PassCustom licence
Nevermined PaymentsLeoYeAI/openclaw-master-skills2.2k—~4.5kAutomated safety check: NotesMIT
LexGuard MCP Developer GuideSeoNaRu/lexguard-mcp131—~1.1kAutomated safety check: PassCustom licence
Context7 MCP Skillholon-run/uxc116—~564Automated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Zizkadb Release

    ZIZKA-AI-SL/ZizkaDB

    Bumps versions, runs pre-push verification, and publishes ZizkaDB SDK and MCP packages.

    125 GitHub stars~399 tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Nevermined Payments

    LeoYeAI/openclaw-master-skills

    Integrates Nevermined payment infrastructure into AI agents, MCP servers, Google A2A agents, and REST APIs.

    2.2k GitHub stars~4.5k tokensUpdated 2 mo ago
    Backend & APIsAuto-check: notes
  • LexGuard MCP Developer Guide

    SeoNaRu/lexguard-mcp

    Developer guide for the LexGuard Korean law MCP server: layer rules, adding tools and repositories, JSON-RPC responses, law API handling, answer rules and tests.

    131 GitHub stars~1.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Context7 MCP Skill

    holon-run/uxc

    Query up-to-date library documentation and code examples using Context7 MCP.

    116 GitHub stars~564 tokensUpdated 24 days ago
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/Kode-CLI

    Guide to designing and building MCP servers: tool, resource and prompt design for agent usability, with TypeScript or Python implementation workflows.

    5.2k GitHub stars~1.9k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from shareAI-lab/learn-claude-code

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Auto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    Auto-check passed
  • PDF Processing Guide

    shareAI-lab/learn-claude-code

    Gives the agent command-line and Python recipes for reading, creating, merging and splitting PDF files, plus tips for large and scanned documents.

    78k GitHub starsUsed in 5 repos~646 tokens
    Auto-check passed

Questions about MCP Server Builder

What does MCP Server Builder do?

Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing. MCP servers can expose three things: tools Claude can call like API endpoints, resources it can read like files or records, and prompt templates.json file, and a TypeScript path starts from npm init and the @modelcontextprotocol/sdk package with a template of its own.

When should I use MCP Server Builder?

MCP Server Builder fits situations like: creating an MCP server that wraps an external service; adding custom tools to Claude through MCP; exposing database content to an agent as read-only resources; testing an MCP server with the Inspector.

How do I install MCP Server Builder in Claude Code?

Run `npx skills add shareAI-lab/learn-claude-code --skill mcp-builder -a claude-code`. Or copy the skill folder (skills/mcp-builder in shareAI-lab/learn-claude-code) into .claude/skills/mcp-builder in your project. Claude Code loads it when a task matches its description.

How do I install MCP Server Builder in Codex?

Run `npx skills add shareAI-lab/learn-claude-code --skill mcp-builder -a codex`. Or copy the skill folder (skills/mcp-builder in shareAI-lab/learn-claude-code) into .agents/skills/mcp-builder in your project. Codex loads it when a task matches its description.

Can I use MCP Server Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shareAI-lab/learn-claude-code --skill mcp-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-builder, .gemini/skills/mcp-builder, .github/skills/mcp-builder and .opencode/skills/mcp-builder in your project.

What does MCP Server Builder need to run?

Going by SKILL.md and its folder, MCP Server Builder needs the command-line tools its instructions call (python3, npm, pip and npx). Our summary lists: Python 3 or Node.js with npm, depending on the server language.

Does MCP Server Builder access the network?

SKILL.md names 1 domain. In commands or code: api.weatherapi.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is MCP Server Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MCP Server Builder use?

MCP Server Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Server Builder use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to MCP Server Builder?

Skills that share tags, products or a category with MCP Server Builder: MCP Server Builder (anthropics/skills, 180k stars), Zizkadb Release (ZIZKA-AI-SL/ZizkaDB, 125 stars), Nevermined Payments (LeoYeAI/openclaw-master-skills, 2.2k stars) and LexGuard MCP Developer Guide (SeoNaRu/lexguard-mcp, 131 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Server Builder?

shareAI-lab (a GitHub organization) maintains it in shareAI-lab/learn-claude-code, which has 78,211 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 28, 2026.

Source: shareAI-lab/learn-claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.