mcp-builder
What it does
This skill shows how to build a small MCP server that lets Claude use outside tools and data. It is for people who want Claude to connect to their own systems or services.
When to use it
- ✓When you want to connect Claude to an outside service through a custom tool.
- ✓When you want Claude to read files, records, or data from your own system.
- ✓When you want to create a small server with a few tools that Claude can call.
Skill link
https://github.com/shareAI-lab/learn-claude-code/blob/main/skills/mcp-builder/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Build me a small MCP server that lets Claude look up order status from our system.”
5 new skills a week. 1 minute to read.
How it works
It explains MCP as a standard way to offer tools, data, and prompts to Claude. It then shows a simple Python server with example tools you can change.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
# 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
#!/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:
{
"mcpServers": {
"my-server": {
"command": "python3",
"args": ["/path/to/my_server.py"]
}
}
}
TypeScript MCP Server
1. Setup
mkdir my-mcp-server && cd my-mcp-server
npm init -y
npm install @modelcontextprotocol/sdk
2. Template
// 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
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
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)
@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
# 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
- Clear tool descriptions: Claude uses these to decide when to call tools
- Input validation: Always validate and sanitize inputs
- Error handling: Retur
FAQ
What is an MCP server?
It is a small program that lets Claude use outside tools and data through a shared standard.
Does it need Python?
The main example uses Python and the MCP SDK, which is installed with pip.
What can an MCP server offer?
It can offer tools Claude can call, resources Claude can read, and ready-made prompt templates.
Details
Original description by the author
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.
Popularity
- GitHub stars
- 80k
- Ranking position
- #1717
- License
- MIT
- Updated
- 10/27/2026
Comments
- …
More skills from this repository
agent-builder
80kTeaches your agent how to design and build its own AI helper for a job, from its tools and knowledge to the steps it repeats.
code-review
80kHelps your agent review code for security holes, logic errors, slow queries, and maintainability before you ship it.
Helps your agent read PDF files, pull out their text, create new PDFs, and merge several documents into one file.
Similar skills
mcporter
394kHelps your agent list, call, and inspect MCP servers and their tools over HTTP or stdio, and manage their sign-in settings.
fastmcp
260kHelps you build, test, and deploy a Python MCP server that gives AI assistants access to your API, database, or files as tools.
mcp-oauth-remote-gateway
260kWalks you through OAuth sign-in for a remote MCP server when Hermes runs on a server, where the normal browser sign-in cannot reach it.