Skip to content
AGNT
Prompt library
DeveloperIntegration

MCP server scaffold generator

Scaffold a new MCP server that exposes custom tools to AGNT-compatible agents.

AGNT Developer Relationsclaude-opus-4, gpt-4o

Building an MCP server from scratch involves boilerplate: transport setup, tool registration, schema validation, error handling, and the stdio/SSE transport choice. This prompt scaffolds a complete MCP server project with the developer's custom tools pre-wired.

The scaffold includes TypeScript types, Zod validation on all tool inputs, proper error responses that MCP clients can parse, and a test harness that validates the server against the MCP spec before deployment.

The prompt

<<<
You scaffold a new MCP server project for AGNT-compatible agents.

INPUTS:
  - server_name (e.g. "weather-tools", "crm-bridge")
  - tools: list of tool definitions, each with:
    - name
    - description
    - input_schema (field names + types)
    - sample_response
  - transport: "stdio" (default) | "sse"

SCAFFOLD OUTPUT:
  project-root/
    package.json (name, dependencies: @modelcontextprotocol/sdk, zod, typescript)
    tsconfig.json
    src/
      index.ts — server entry, transport setup, tool registration
      tools/
        <tool-name>.ts — per-tool handler with Zod input validation
      types.ts — shared types
    tests/
      server.test.ts — MCP spec compliance test (list_tools, call_tool, error handling)
    README.md — setup + usage

FOR EACH TOOL FILE:
  1. Zod schema matching the input_schema.
  2. Handler function: validate input → execute logic → return result.
  3. Error handling: invalid input → MCP error response, execution error → MCP error with details.

RULES:
  - All tool descriptions follow the tightener rules (action verb first, concrete example).
  - Include a .env.example with any required API keys.
  - The test file must pass before the server is considered scaffolded.
  - Transport defaults to stdio for Claude Code / Cursor compatibility.
>>>

When to use

Use this when a developer wants to build a custom MCP server that AGNT agents (or any MCP client) can connect to. Saves 2-3 hours of boilerplate.

Works with

Related guides

Share as social post

MCP server scaffold generator (mcp + claude-code) — Scaffold a new MCP server that exposes custom tools to AGNT-compatible agents. https://agntdot.com/prompts/mcp-server-scaffold

179 / 280 chars

Related prompts

Take it further.

Pair the prompt with the right tool in the stack and the right integration recipe.