npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-mcp-server-pro

v1.0.1

Published

Scaffold production-ready MCP servers in one command. Uses the latest SDK v2 API, Vitest tests, GitHub Actions CI, and agent-friendly README templates.

Downloads

204

Readme

Create MCP Server Pro — Scaffold Production-Ready MCP Servers

npm version npm downloads CI TypeScript License: MIT

Scaffold a production-ready MCP server in one command. TypeScript, Vitest tests, GitHub Actions CI, error handling patterns, and best practices — all included.

npx create-mcp-server-pro my-server

The official MCP scaffolder was archived in November 2024. This is the production-ready replacement — built from patterns used in 4 real MCP servers with 100+ combined tools.

Why This One?

| Feature | Official (archived) | FastMCP template | create-mcp-server-pro | | ----------------------- | :-----------------: | :--------------: | :-----------------------: | | Maintained | Archived Nov 2024 | Yes | Yes | | Official MCP SDK | Yes | No (FastMCP) | Yes | | Vitest tests | No | No | Yes | | GitHub Actions CI | No | No | Yes | | Error handling patterns | No | No | Yes | | Agent-friendly README | No | No | Yes | | Auth boilerplate | No | No | Yes | | semantic-release | No | No | Yes | | ESLint 9 + Prettier | No | No | Yes |

Quick Start

Interactive

npx create-mcp-server-pro my-server

You'll be asked for:

  • Server name — npm package name (defaults to mcp-server-<directory>)
  • Description — what your server does
  • Authentication — whether it needs an API token
  • Author — your name

Non-Interactive (Agent-Friendly)

npx create-mcp-server-pro my-server \
  --name mcp-server-weather \
  --description "MCP server for weather data" \
  --auth \
  --author "Your Name"

All flags are optional. Provide --name and --description to skip all prompts.

After Scaffolding

cd my-server
npm install
npm run build
npm test

Then add your tools in src/tools.ts and register them in src/index.ts.

What Gets Generated

my-server/
  src/
    index.ts          # McpServer setup, tool registration, StdioServerTransport
    tools.ts          # Example tools with proper error handling
  tests/
    tools.test.ts     # Vitest tests with fetch mocking
  .github/
    workflows/
      ci.yml          # Node 20 + 22 matrix, lint, typecheck, build, test
      release.yml     # semantic-release on version tags
    FUNDING.yml
  package.json        # bin field, correct deps, scripts, lint-staged
  tsconfig.json       # ES2022, NodeNext, strict mode
  tsup.config.ts      # ESM, node20 target, shebang banner
  vitest.config.ts    # globals, v8 coverage
  eslint.config.js    # flat config, typescript-eslint strict
  .prettierrc.json
  .gitignore
  LICENSE             # MIT
  README.md           # Agent-friendly with Quick Start configs

How to Build an MCP Server

If you're new to MCP (Model Context Protocol), here's what you need to know.

What is MCP?

MCP is an open standard by Anthropic that lets AI assistants (Claude, Cursor, GitHub Copilot, Windsurf) connect to external tools and data. Your MCP server exposes tools that AI agents can call.

AI Assistant  <-->  MCP Protocol  <-->  Your Server  <-->  APIs / Data

Anatomy of a Tool

Every MCP tool has three parts:

import { z } from "zod";

server.tool(
  "tool_name", // 1. Name (snake_case)
  "What this tool does — be specific for the AI", // 2. Description
  {
    // 3. Input schema (Zod)
    query: z.string().describe("Search query"),
    limit: z
      .number()
      .int()
      .min(1)
      .max(100)
      .default(10)
      .describe("Max results to return"),
  },
  async ({ query, limit }) => {
    // 4. Handler
    try {
      const results = await searchAPI(query, limit);
      return {
        content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
      };
    } catch (err) {
      const message = err instanceof Error ? err.message : String(err);
      return {
        content: [{ type: "text", text: `Error: ${message}` }],
        isError: true,
      };
    }
  },
);

Best Practices

These patterns come from building 4 production MCP servers:

Naming

  • Use snake_case for tool names (e.g. search_packages, get_user)
  • Avoid spaces, dots, or mixed case — they cause tokenization issues in LLMs

Descriptions

  • Write descriptions for the AI, not for humans
  • Be specific: "Search npm packages by keyword and return name, version, and description" is better than "Search packages"
  • Every Zod field should have .describe() — this is how the AI knows what to pass

Error Handling

  • Wrap external calls in try/catch
  • Return { content: [...], isError: true } for recoverable errors
  • Include actionable context: "API_TOKEN not set. Set it in your MCP client env." not "Auth failed"

Testing

  • Test tool logic separately from MCP registration
  • Mock fetch with vi.spyOn(globalThis, "fetch")
  • Test both success and error paths

Project Structure

  • Keep tool logic in src/tools.ts (or src/tools/ for many tools)
  • Keep MCP registration in src/index.ts
  • This separation makes tools testable without MCP transport

Connecting to AI Clients

After building your server (npm run build), connect it:

Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "my-server"]
    }
  }
}

Cursor.cursor/mcp.json in your project:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "my-server"]
    }
  }
}

VS Code (GitHub Copilot).vscode/mcp.json:

{
  "servers": {
    "my-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "my-server"]
    }
  }
}

Real-World Examples

These MCP servers were built with the same patterns this scaffolder generates:

| Server | Tools | What it does | | ---------------------------------------------------------------------------- | :---: | ------------------------------------------------------------- | | mcp-server-devutils | 17 | Base64, UUID, hash, JWT decode, cron, timestamps, JSON, regex | | mcp-server-npm | 6 | Search packages, view details, compare, check downloads | | mcp-server-github-gist | 8 | Create, read, update, list, and search GitHub Gists | | mcp-server-cloudflare | 13 | Workers, KV, R2, DNS, and cache management |

Author

Ofer Shapira

LinkedIn GitHub

License

MIT