mcp-builder
Skill2.1k starsChanged 7 months agoMITView on GitHub
Build MCP (Model Context Protocol) servers using the official @modelcontextprotocol/sdk. Use this skill when users ask to create an MCP server, MCP tools, MCP resources, or want to expose APIs/functionality to AI agents. This skill covers vanilla MCP implementation with Streamable HTTP transport, session management, tools, resources, and prompts.
- Reads credentials
186 other projects use a version of this.
Trending
Quiet since April.thin dataabout the whole repository
Most recently taken up by
- rvdbreemen/OTGW-firmwaretheir own version, first seen Nov 8, 2026
- codewhale-hq/codewhale-plugin-marketplacetheir own version, first seen Nov 8, 2026
- Bruno-Cunha-Souza/ValarMindSkillstheir own version, first seen Nov 8, 2026
- Leodorareluctant259/superpowers-zhtheir own version, first seen Nov 8, 2026
- truongpx396/learn-harness-engineering-by-building-mini-claude-codetheir own version, first seen Nov 8, 2026
- ControllableModel/SWE-Skills-Benchtheir own version, first seen Nov 8, 2026
Who's talking about chatgptprojects/clear-code
- karthink/gptel-agent“The Claude Code source code has leaked, probably bringing a massive boost to open source projects such as …”GitHub · Mar 31, 2026 · 1 reactions
- ProSkillsMD/proskills“[SUBMISSION] clear-code”GitHub · Apr 20, 2026
The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.
Used with
Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 projects that use this
ComposioHQSkillcodebase-migrate
Run large codebase migrations and multi-file refactors. Uses the Composio CLI to coordinate issue tracking, batched PRs, and CI verification while the agent executes the transforms locally across hundreds of files.
Also in 5 projects that use this
truongtv22SkillProblem-Solving Techniques
Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.
Also in 5 projects that use this
ArogyaReddySkillskill-share
A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.
Also in 26 projects that use this
AnthropicSkillacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.
Also in 8 projects that use this
- +2 more from Leodorareluctant259
Other versions186 projects use a version of this.
Word for word · 3
- Leanmcp/superview.sh★ 2.1k100% same
- chatgptprojects/claude-code★ 2.1k100% same
- Leanmcp/gateway-skills★ 2.1k100% same
Edited · 0
None found.
Wrote their own version · 183
- anthropics/skills★ 189ksame name
- shareAI-lab/analysis_claude_code★ 80ksame name
- shareAI-lab/learn-claude-code★ 80ksame name
- ComposioHQ/awesome-claude-skills★ 75ksame name
- activepieces/activepieces★ 25ksame name
- ComposioHQ/awesome-codex-skills★ 17ksame name
- composio-community/awesome-codex-skills★ 16ksame name
- mcp-use/mcp-use★ 11ksame name
- jnMetaCode/superpowers-zh★ 8.4ksame name
- vudovn/ag-kit★ 8.2ksame name
173 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- claude-code-devSkill
- analyze-exportsSkill
- code-explanationSkill
- fireworks-inferenceSkill
- godot-city-game-3dSkill
- ios-bootstrap-testflightSkill
- leanmcp-builderSkill
- mcp-apps-builderSkill
- posthog-adblock-bypassSkill
- publicity-distributionSkill
- research-observabilitySkill
- research-paper-integritySkill
- security-reproSkill
- tinker-training-inferenceSkill
- translate-explanationSkill
- vuln-reproSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 167 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Resources: - Read-only data endpoints:
- Distinctive: line 57
Recommendation: Use Streamable HTTP for most production servers.
- Distinctive: line 310
Preserve existing structure: - Don't change fundamental architecture
- Distinctive: line 312
Maintain backward compatibility: - Don't break existing functionality
- Very specific: line 316
Add new tools/resources/prompts to existing service files
- Distinctive: line 318
Follow existing code patterns
- Distinctive: line 319
Use TypeScript for type safety
- Distinctive: line 324
Remove essential boilerplate code
- Distinctive: line 325
Create unnecessary new files
- Distinctive: line 326
Add terminal/command instructions (user will run commands themselves)
“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Builder Skill
This skill guides you in building MCP (Model Context Protocol) servers using the official @modelcontextprotocol/sdk package with TypeScript.
When to Use This Skill
- User asks to "create an MCP server"
- User wants to "expose an API to AI agents"
- User needs "tools for Claude/LLM"
- User mentions "Model Context Protocol"
- User wants to build "AI agent integrations"
MCP Core Concepts
What is MCP?
Model Context Protocol (MCP) is an open standard that enables structured, secure interactions between Large Language Models (LLMs) and external systems. MCP acts as a bridge allowing AI agents to:
- Access external data sources safely
- Execute tools and functions
- Maintain consistent communication protocols
- Integrate with APIs and databases
Key Components
Tools - Interactive functions that perform actions or computations:
- Execute operations and computations
- Accept parameters from the LLM
- Return structured responses
- Can change system state (side effects allowed)
- Examples: calculations, database operations, API calls, sending emails
Resources - Read-only data endpoints:
- Passive data sources (no side effects)
- Loaded into AI context for reasoning
- URI-based identification
- Examples: documentation, config files, status data, user profiles
Prompts - Reusable prompt templates:
- Pre-defined conversation starters
- Can accept arguments for customization
- Return structured messages for the LLM
Transport Options
| Transport | Best For | Pros | Cons |
| Streamable HTTP | Production, cloud, multiple clients | Scalable, remote access | Requires session management |
| SSE | Real-time apps, live updates | Streaming, auto-reconnect | Connection limits |
| STDIO | Local desktop, development | Simple, low latency | Single session, local only |
Recommendation: Use Streamable HTTP for most production servers.
Project Structure
my-mcp-server/
├── src/
│ ├── server.ts # Express server with transport setup
│ ├── mcp-server.ts # MCP server with tools/resources/prompts
│ └── minimal/ # Optional: organized components
│ ├── tool.ts
│ ├── resource.ts
│ └── prompt.ts
├── package.json
├── tsconfig.json
└── .envRequired Dependencies
{
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.0",
"express": "^4.21.0",
"cors": "^2.8.5",
"dotenv": "^16.5.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@types/express": "^4.17.21",
"@types/cors": "^2.8.17",
"typescript": "^5.6.3",
"tsx": "^4.20.3"
}
}TypeScript Configuration
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src/**/*"]
}Implementation Pattern
1. MCP Server Setup (mcp-server.ts)
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
export function createMCPServer() {
const server = new McpServer({
name: 'my-mcp-server',
version: '1.0.0',
});
// Register tools
server.tool('toolName', 'Tool description', {
param1: { type: 'string', description: 'Parameter description' }
}, async (args) => {
// Implementation
return {
content: [{ type: 'text', text: JSON.stringify(result) }]
};
});
// Register resources
server.resource('resource://uri', 'Resource description', async () => ({
contents: [{
uri: 'resource://uri',
mimeType: 'application/json',
text: JSON.stringify(data)
}]
}));
// Register prompts
server.prompt('promptName', 'Prompt description', async (args) => ({
messages: [{
role: 'user',
content: { type: 'text', text: `Prompt content with ${args.param}` }
}]
}));
return server;
}2. HTTP Server with Session Management (server.ts)
import express from 'express';
import cors from 'cors';
import { randomUUID } from 'node:crypto';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
import { createMCPServer } from './mcp-server.js';
const app = express();
const PORT = process.env.PORT || 3001;
// CORS for browser clients
app.use(cors({
origin: '*',
methods: ['GET', 'POST', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'mcp-session-id', 'mcp-protocol-version', 'Authorization'],
exposedHeaders: ['mcp-session-id'],
credentials: true,
}));
app.use(express.json());
// Session storage
const transports: Record<string, StreamableHTTPServerTransport> = {};
// MCP endpoint handler
const handleMCPRequest = async (req, res) => {
const sessionId = req.headers['mcp-session-id'] as string | undefined;
let transport: StreamableHTTPServerTransport;
if (sessionId && transports[sessionId]) {
transport = transports[sessionId];
} else if (!sessionId && isInitializeRequest(req.body)) {
transport = new StreamableHTTPServerTransport({
sessionIdGenerator: () => randomUUID(),
onsessioninitialized: (newSessionId) => {
transports[newSessionId] = transport;
},
});
transport.onclose = () => {
if (transport.sessionId) delete transports[transport.sessionId];
};
const server = createMCPServer();
await server.connect(transport);
} else {
res.status(400).json({
jsonrpc: '2.0',
error: { code: -32000, message: 'No valid session ID or not an init request' },
id: null,
});
return;
}
await transport.handleRequest(req, res, req.body);
};
app.post('/', handleMCPRequest);
app.post('/mcp', handleMCPRequest);
app.get('/health', (req, res) => {
res.json({ status: 'ok', server: 'my-mcp-server', version: '1.0.0' });
});
app.listen(PORT, () => console.log(`MCP Server running on port ${PORT}`));Tool Implementation Examples
Simple Tool
server.tool('echo', 'Echo a message back', {
message: { type: 'string', description: 'Message to echo' }
}, async ({ message }) => ({
content: [{ type: 'text', text: `Echo: ${message}` }]
}));Tool with Multiple Parameters
server.tool('calculate', 'Perform arithmetic operations', {
a: { type: 'number', description: 'First number' },
b: { type: 'number', description: 'Second number' },
operation: { type: 'string', description: 'Operation: add, subtract, multiply, divide' }
}, async ({ a, b, operation }) => {
let result: number;
switch (operation) {
case 'add': result = a + b; break;
case 'subtract': result = a - b; break;
case 'multiply': result = a * b; break;
case 'divide':
if (b === 0) throw new Error('Division by zero');
result = a / b;
break;
default: throw new Error('Invalid operation');
}
return { content: [{ type: 'text', text: JSON.stringify({ result }) }] };
});External API Tool
server.tool('getWeather', 'Get current weather for a city', {
city: { type: 'string', description: 'City name' }
}, async ({ city }) => {
const response = await fetch(`https://api.weather.com/v1/current?city=${encodeURIComponent(city)}&key=${process.env.WEATHER_API_KEY}`);
const data = await response.json();
return {
content: [{ type: 'text', text: JSON.stringify({
city,
temperature: data.main.temp,
conditions: data.weather[0].description
}) }]
};
});Resource Implementation Examples
// Static resource
server.resource('config://settings', 'Application settings', async () => ({
contents: [{
uri: 'config://settings',
mimeType: 'application/json',
text: JSON.stringify({ theme: 'dark', language: 'en' })
}]
}));
// Dynamic resource
server.resource('server://info', 'Server information', async () => ({
contents: [{
uri: 'server://info',
mimeType: 'application/json',
text: JSON.stringify({
name: 'my-server',
version: '1.0.0',
uptime: process.uptime(),
timestamp: new Date().toISOString()
})
}]
}));Editing Guidelines
Core Principles
- Edit existing files, don't recreate - Template files are provided; modify them
- Preserve existing structure - Don't change fundamental architecture
- Minimal necessary changes - Make smallest changes to achieve requirements
- Maintain backward compatibility - Don't break existing functionality
DO
- Add new tools/resources/prompts to existing service files
- Extend existing functionality
- Follow existing code patterns
- Use TypeScript for type safety
DON'T
- Completely rewrite template files
- Remove essential boilerplate code
- Create unnecessary new files
- Add terminal/command instructions (user will run commands themselves)
Running the Server
The user will handle running commands. Your job is to provide the code files only.
Standard commands the user might run:
npm install- Install dependenciesnpm run devornpx tsx src/server.ts- Development modenpm run build- Build for productionnpm start- Run production build
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

