mcp-development
Learn to develop Model Context Protocol servers with typed tools, resource endpoints, and prompt templates. This skill covers server initialization, input validation with schemas, error handling, and transport configuration for both stdio and HTTP-based deployments. Includes patterns for composable tool design and security best practices like secret redaction.
mcp-development teaches you to build MCP servers with tools, resources, prompts, and transport configuration.
AI-generated summary based on this skill's SKILL.md
Install
rohitg00/awesome-claude-code-toolkit/mcp-development · repository language: JavaScript
git clone https://github.com/rohitg00/awesome-claude-code-toolkit
cp -r awesome-claude-code-toolkit/skills/mcp-development ~/.claude/skills/mcp-developmentnpx skillfed install rohitg00/awesome-claude-code-toolkit/mcp-developmentFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I build an MCP server with tools?
mcp-development teaches you to build Model Context Protocol servers by initializing a server instance, defining typed tools with Zod schemas for input validation, and implementing tool handlers. Start by creating a server object, registering tools with clear descriptions and input schemas, then handle tool calls with proper error handling. The skill covers composable tool design patterns and demonstrates real examples like database tools and API integrations.
What are MCP resource endpoints and how do I design prompt templates?
mcp-development explains that MCP resource endpoints expose data sources to clients through URI-based access patterns, while prompt templates provide reusable instruction sets. Resources can serve files, database records, or API responses. Prompt templates combine static instructions with dynamic variables. The skill shows how to implement both, including best practices for organizing resources hierarchically and designing templates that compose well with tools for flexible client workflows.
How do I configure MCP server transport and client connections?
mcp-development covers two main transport types: stdio for local processes and SSE (Server-Sent Events) for HTTP. For stdio, configure the server to read JSON-RPC messages from stdin and write responses to stdout. For SSE, set up HTTP endpoints for client connections. The skill includes configuration examples for both transports, connection lifecycle management, and how to handle client initialization and capability negotiation during setup.
How do I validate MCP tool inputs and handle errors properly?
mcp-development teaches input validation using Zod schemas defined in each tool's input_schema field. Zod automatically validates incoming arguments against your schema before the tool handler runs. For error handling, implement try-catch blocks in tool handlers, return structured error responses with clear messages, and avoid exposing sensitive details. The skill emphasizes logging errors for debugging while keeping client-facing messages user-friendly and secure.
What MCP development best practices and anti-patterns should I know?
mcp-development highlights key practices: keep tools focused and composable, use descriptive names and documentation, validate all inputs with schemas, redact secrets from responses, and test error paths. Anti-patterns to avoid include overly broad tool permissions, missing input validation, exposing internal errors to clients, and poor error messages. The skill provides a development checklist covering security, reliability, and maintainability for production MCP servers.
Can you show me a tutorial for building MCP servers?
mcp-development provides step-by-step guidance: initialize your server with the MCP SDK, define tools with typed inputs using Zod, implement handlers with error handling, add resources and prompts if needed, configure your transport (stdio or SSE), and test end-to-end. The skill includes concrete examples like database tools, API wrappers, and file servers. Follow the development checklist to ensure security, proper validation, and client compatibility before deployment.
SKILL.md
rendered from the published skill — quoted content, verbatim
MCP Development
MCP Server with Tools
```typescript import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod";
const server = new McpServer({ name: "project-tools", version: "1.0.0", });
server.tool(
"search_files",
"Search for files matching a glob pattern in the project directory",
{
pattern: z.string().describe("Glob pattern (e.g., '*/.ts')"),
directory: z.string().optional().describe("Base directory to search from"),
},
async ({ pattern, directory }) => {
const files = await glob(pattern, { cwd: directory ?? process.cwd() });
return {
content: [
{
type: "text",
text: files.length > 0
? files.join("\n")
: No files found matching ${pattern},
},
],
};
}
);
server.tool( "run_query", "Execute a read-only SQL query against the application database", { query: z.string().describe("SQL
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/mcp-development/SKILL.md