MCP Server Builder
Skill1 starsChanged 7 months agoMITView on GitHub
Build Model Context Protocol (MCP) servers from scratch. Scaffold server projects, define tools and resources, handle authentication, and test locally. Trigger phrases: "build an MCP server", "create MCP server", "scaffold MCP", "new MCP project", "MCP tool server", "model context protocol server"
- Reads credentials
In this repository164 other files it gives its agents.
- instrument-data-to-allotropeSkill
- literature-reviewSkill
- nextflow-developmentSkill
- scientific-problem-selectionSkill
- scvi-toolsSkill
- single-cell-rna-qcSkill
- discover-brandSkill
- enforce-voiceSkill
- generate-guidelinesSkill
- csat-reportSkill
- customer-escalationSkill
- customer-researchSkill
- draft-responseSkill
- kb-articleSkill
- sentiment-analysisSkill
- ticket-triageSkill
- analyzeSkill
- build-dashboardSkill
- create-vizSkill
- data-context-extractorSkill
- data-modelingSkill
- data-pipelineSkill
- etl-designSkill
- explore-dataSkill
- sql-queriesSkill
- statistical-analysisSkill
- validate-dataSkill
- write-querySkill
- accessibility-reviewSkill
- component-librarySkill
- design-critiqueSkill
- design-handoffSkill
- design-systemSkill
- frontend-designSkill
- research-synthesisSkill
- user-researchSkill
- ux-copySkill
- wireframingSkill
- Agent DevelopmentSkill
- CLAUDE.md ManagementSkill
- Plugin DevelopmentSkill
- Prompt EngineeringSkill
- Skill CreatorSkill
- curriculum-designSkill
- lesson-planningSkill
- quiz-generatorSkill
- study-guideSkill
- tutoringSkill
- api-designSkill
- architectureSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- database-migrationSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- documentationSkill
- error-handlingSkill
- git-workflowSkill
- incident-responseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Create the project structure:
- Distinctive: line 73
Add error handling and logging
- Distinctive: line 98
API Key: Read from environment variable, attach to outgoing requests
- Distinctive: line 105
Run with stdio transport for quick testing
- Distinctive: line 107
Verify each tool and resource responds correctly
- Distinctive: line 108
Test error cases and edge conditions
- Distinctive: line 144
Return structured errors: - use MCP error codes, not raw exceptions
- Distinctive: line 146
Log all operations: - use stderr for debug logs (stdout is the transport)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Server Builder
Build production-ready MCP servers that expose tools and resources to Claude Code and other MCP clients.
Prerequisites
- Node.js 18+ or Python 3.10+ installed
- Understanding of the domain the server will serve
- Familiarity with JSON-RPC and REST API patterns
Workflow
Step 1: Define Server Purpose
Gather the following from the user:
- Server name - kebab-case identifier (e.g.,
weather-api,jira-connector) - Language - TypeScript (recommended) or Python
- Tools - list of actions the server exposes (name, description, parameters)
- Resources - list of data the server provides (URI patterns, MIME types)
- Authentication - none, API key, OAuth 2.0, or custom
- Transport - stdio (default) or SSE (server-sent events)
Step 2: Scaffold the Project
Create the project structure:
<server-name>/
src/
index.ts # Entry point and server setup
tools/ # Tool handler implementations
resources/ # Resource provider implementations
auth/ # Authentication middleware
package.json # Dependencies and scripts
tsconfig.json # TypeScript configuration
.env.example # Environment variable template
README.md # Setup and usage documentationFor Python projects, use:
<server-name>/
src/
__init__.py
server.py # Entry point and server setup
tools/ # Tool handlers
resources/ # Resource providers
pyproject.toml # Dependencies
.env.example
README.mdStep 3: Implement the Server Core
- Initialize the MCP server with name and version
- Register tool handlers with input schemas (JSON Schema)
- Register resource providers with URI templates
- Configure transport layer (stdio or SSE)
- Add error handling and logging
Step 4: Define Tool Schemas
For each tool, define:
- name - unique identifier in snake_case
- description - clear explanation of what the tool does and when to use it
- inputSchema - JSON Schema for parameters with required fields
- handler - async function that executes the tool logic
Step 5: Define Resource Providers
For each resource, define:
- URI pattern - template like
myserver://items/{id} - name - human-readable name
- description - what data this resource provides
- mimeType - content type (e.g.,
application/json,text/plain) - handler - async function that returns the resource content
Step 6: Add Authentication
Based on the chosen auth method:
- API Key: Read from environment variable, attach to outgoing requests
- OAuth 2.0: Implement token refresh flow, store tokens securely
- Custom: Implement the specific auth protocol required
Step 7: Test Locally
- Build the project:
npm run buildor equivalent - Run with stdio transport for quick testing
- Configure in Claude Code's
settings.jsonundermcpServers - Verify each tool and resource responds correctly
- Test error cases and edge conditions
Output Format
The skill produces:
- Complete project directory with all source files
package.jsonorpyproject.tomlwith correct dependencies- Tool and resource implementations with proper schemas
- Authentication setup if required
- README with installation and configuration instructions
Examples
Example 1: Database Query Server
User: "Build an MCP server that queries our PostgreSQL database"
Action: Scaffold a TypeScript MCP server with tools for query_table, list_tables, describe_table, and resources for db://tables/{name}/schema.
Example 2: REST API Wrapper
User: "Create an MCP server for the GitHub API"
Action: Scaffold a server with tools for create_issue, list_repos, search_code, resources for github://repos/{owner}/{repo}, and OAuth 2.0 authentication.
Example 3: File Processing Server
User: "Make an MCP server that converts CSV files to JSON"
Action: Scaffold a server with a convert_csv tool that accepts file paths and conversion options, returning structured JSON output.
Best Practices
- Write detailed tool descriptions - the LLM uses these to decide when to call your tool
- Use strict input schemas - validate all parameters with JSON Schema
- Return structured errors - use MCP error codes, not raw exceptions
- Keep tools focused - one tool per action, not one mega-tool
- Log all operations - use stderr for debug logs (stdout is the transport)
- Handle timeouts - set reasonable timeouts for external API calls
- Version your server - bump version when tool schemas change
- Document environment variables - list all required config in
.env.example
Error Handling
| Error | Cause | Recovery |
| Transport failure | stdio/SSE connection lost | Restart server process |
| Schema validation | Invalid tool parameters | Return clear validation error message |
| Auth failure | Expired or invalid credentials | Refresh token or prompt for new credentials |
| External API error | Upstream service unavailable | Return error with retry guidance |
| Resource not found | Invalid URI or missing data | Return appropriate MCP error code |
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.

