Skip to main content
skill CX Codex

mcp-server-skills — Claude Code skill for Next.js MCP servers

A layout for MCP servers in Next.js: shared Zod schemas, a thin route, and server actions that feed the web UI.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gocallum/nextjs16-agent-skills --skill mcp-server-skills -a claude-code
Open on GitHub

What mcp-server-skills does

This skill lays out the App Router folders for an MCP server. The handler sits in app/api/[transport]/route.ts, schemas and pure logic go in lib/*, and server actions in app/actions/mcp-actions.ts import that same logic so the web UI and tests stay in step.

The point is a small route.ts. It only wires createMcpHandler from mcp-handler and registers tools with server.tool, pulling name, description and schema from the shared file. Tool replies follow one shape, { success, result | error }, which keeps MCP output and UI output from drifting apart. HTTP and SSE run through /api/[transport]; stdio needs its own entrypoint. Set basePath to match the folder path.

For desktop testing the skill shows a config that points mcp-remote at http://localhost:3000/api/mcp. Nothing connects unless that local server is up. It also warns against stateful globals, since those break on serverless hosting such as Vercel, where maxDuration and runtime may need setting.

What it helps with

  • define a tool's Zod schema once and reuse it in both MCP and the UI
  • keep route.ts thin by moving logic into lib/*
  • check MCP tool replies through server actions in the web UI
  • hook an HTTP MCP transport into Claude Desktop with mcp-remote
  • standardise tool and UI responses as { success, result | error }

Example prompts for the agent

  • Build the MCP server on Next.js with this skill: put the Zod schemas in lib/dice.ts and wire createMcpHandler in app/api/[transport]/route.ts.
  • Add a roll_dice tool plus a server action that runs the same logic for a web test.
  • Set up the Claude Desktop config with mcp-remote pointing at http://localhost:3000/api/mcp.

How to install mcp-server-skills

1Skills CLI (Vercel)

npx skills add gocallum/nextjs16-agent-skills --skill mcp-server-skills -a claude-code

2Manually: put the files in place

~/.claude/skills/mcp-server-skills/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mcp-server-skills/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about mcp-server-skills

How do I install mcp-server-skills in Claude Code?

Run npx skills add gocallum/nextjs16-agent-skills --skill mcp-server-skills -a claude-code. The skill file lands at ~/.claude/skills/mcp-server-skills/SKILL.md.

What does mcp-server-skills do?

It documents a Next.js MCP server pattern: shared Zod schemas and logic in lib/*, a thin handler in app/api/[transport]/route.ts, and server actions for the web UI.

How is this different from setting up an MCP server by hand?

Schemas and logic live in one place, so MCP tools and server actions call the same code instead of duplicating it.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor