MCP Server Skills
Pattern for building MCP servers in Next.js with mcp-handler, shared Zod schemas, and reusable server actions.
Install
npx skills add gocallum/nextjs16-agent-skills --skill mcp-server-skillsgit clone --depth 1 https://github.com/gocallum/nextjs16-agent-skills.git /tmp/nextjs16-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/nextjs16-agent-skills/skills/mcp-server-skills ~/.claude/skills/mcp-server-skillsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
## Links
- Model Context Protocol: https://modelcontextprotocol.io/
- mcp-handler (HTTP): https://www.npmjs.com/package/mcp-handler
- Reference implementation (Roll Dice): https://github.com/gocallum/rolldice-mcpserver
- Claude Desktop + mcp-remote bridge: https://www.npmjs.com/package/mcp-remote
## Folder Structure (Next.js App Router)
```
app/
api/[transport]/route.ts # One handler for all transports (e.g., /api/mcp)
actions/mcp-actions.ts # Server actions reusing the same logic/schemas
lib/
dice.ts | tools.ts # Zod schemas, tool definitions, pure logic
components/ # UI that calls server actions for web testing
```
**Goal:** Keep `route.ts` minimal. Put logic + Zod schemas in `lib/*` so both the MCP handler and server actions share a single source of truth.
## Shared Zod Schema + Tool Definition
```ts
// lib/dice.ts
import { z } from "zod";
export const diceSchema = z.number().int().min(2);
export function rollDice(sides: number) {
const validated = diceSchema.parse(sides);
const value = 1 + Math.floor(Math.random() * validated);
return { type: "text" as const, text: `🎲 You rolled a ${value}!` };
}
export const rollDiceTool = {
name: "roll_dice",
description: "Rolls an N-sided die",
schema: { sides: diceSchema },
} as const;
```
## Reusable Server Actions (Web UI + Tests)Details
- Skill name
mcp-server-skills- Repository
- gocallum/nextjs16-agent-skills
- Path
skills/mcp-server-skills/SKILL.md- Repo updated
- 21 January 2026
FAQ
What does the MCP Server Skills skill do?
Pattern for building MCP servers in Next.js with mcp-handler, shared Zod schemas, and reusable server actions.
How do I install the MCP Server Skills skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add gocallum/nextjs16-agent-skills --skill mcp-server-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is MCP Server Skills popular?
It lives in gocallum/nextjs16-agent-skills, which has 23 GitHub stars and 7 forks.
Related skills
AI Agents UI Skills
23gocallum/nextjs16-agent-skills
Comprehensive guide for building AI agents using ToolLoopAgent, workflow patterns, and AI SDK UI components (useChat, generative UIs, tool calling)
AI SDK 6 Skills
23gocallum/nextjs16-agent-skills
AI SDK 6 Beta overview, agents, tool approval, Groq (Llama), and Vercel AI Gateway. Key breaking changes from v5 and new patterns.
Authjs Skills
23gocallum/nextjs16-agent-skills
Auth.js v5 setup for Next.js authentication including Google OAuth, credentials provider, environment configuration, and core API integration
Stitch Design Local
14yshishenya/stitchflow
Legacy compatibility alias for StitchFlow. Use when a user explicitly references stitch-design-local, or when older prompts and setups still call that skill name.
Hermes Profile Distribution
44SamueleBassoli/hermes-fleet-apps
Use when a repo ships its own Hermes agent. Package it.
Upstash Vector Db Skills
23gocallum/nextjs16-agent-skills
Upstash Vector DB setup, semantic search, namespaces, and embedding models (MixBread preferred). Use when building vector search features on Vercel.
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.