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

@mazhu/create-mcp-server

v1.0.0

Published

One command to create a production-ready MCP Server. CLI + SDK for building Model Context Protocol servers in TypeScript.

Readme

create-mcp-server

One command to create a production-ready MCP Server

npm version License: MIT

MCP (Model Context Protocol) is the standard for connecting AI assistants like Claude to external tools and data sources. This package provides:

  1. CLI - Scaffold a complete MCP Server project in seconds
  2. SDK - Ergonomic TypeScript API for building servers

Quick Start

# Create a new MCP server project
npx create-mcp-server my-server

# Or start from an example
npx create-mcp-server my-server --example calculator

cd my-server
npm install
npm run dev

That's it! You now have a working MCP Server with:

  • ✅ TypeScript setup
  • ✅ Tool, resource, and prompt examples
  • ✅ Build configuration
  • ✅ Claude Desktop integration guide

CLI Usage

npx create-mcp-server <project-name> [options]

Options:
  --example <name>    Start with an example (calculator, filesystem, weather, github, database)
  -h, --help          Show help
  -v, --version       Show version

Examples

| Example | Description | |---------|-------------| | calculator | Math operations (add, subtract, multiply, divide, power, sqrt) | | filesystem | File operations (read, write, list, info, create, delete) | | weather | Weather data via wttr.in (current, forecast) | | github | GitHub API (repo info, issues, user data) | | database | Database operations (query, insert, create table) |

SDK Usage

The generated project uses @modelcontextprotocol/sdk directly. Here's the pattern:

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: "my-server",
  version: "1.0.0",
});

// Register a tool
server.tool(
  "greet",
  "Greet someone by name",
  { name: z.string().describe("Name to greet") },
  async ({ name }) => ({
    content: [{ type: "text", text: `Hello, ${name}!` }],
  })
);

// Register a resource
server.resource(
  "config",
  "config://app",
  { description: "Application config" },
  async (uri) => ({
    contents: [{ uri: uri.href, text: JSON.stringify({ version: "1.0.0" }) }],
  })
);

// Register a prompt
server.prompt(
  "help",
  { description: "Get help" },
  async () => ({
    messages: [{ role: "user", content: { type: "text", text: "How can I help?" } }],
  })
);

// Start the server
const transport = new StdioServerTransport();
await server.connect(transport);

Using with Claude Desktop

Add your server to Claude Desktop's config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/path/to/my-server/dist/index.js"]
    }
  }
}

Restart Claude Desktop and your tools will be available!

Project Structure

my-server/
├── src/
│   └── index.ts      # Server entry point
├── dist/             # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

API Reference

Tools

Tools let AI models invoke actions on your server:

server.tool(
  "tool-name",           // Unique identifier
  "Description",         // Human-readable description
  {                      // Input schema (Zod)
    param: z.string(),
  },
  async (args) => {      // Handler
    return {
      content: [{ type: "text", text: "result" }],
    };
  }
);

Resources

Resources expose read-only data:

server.resource(
  "resource-name",
  "resource://uri",      // URI pattern
  { description: "..." },
  async (uri) => ({
    contents: [{ uri: uri.href, text: "data" }],
  })
);

Prompts

Prompts are reusable templates:

server.prompt(
  "prompt-name",
  { description: "..." },
  async () => ({
    messages: [
      { role: "user", content: { type: "text", text: "..." } },
    ],
  })
);

Why create-mcp-server?

  • Zero config - Works out of the box
  • Type-safe - Full TypeScript support with Zod schemas
  • Production-ready - Proper build setup, error handling, docs
  • Examples - Real-world examples to learn from
  • Minimal deps - Only @modelcontextprotocol/sdk and zod

Comparison

| Feature | create-mcp-server | Manual Setup | |---------|-------------------|--------------| | Time to first tool | ~30 seconds | ~30 minutes | | TypeScript config | ✅ Included | Manual | | Build setup | ✅ Included | Manual | | Examples | ✅ 5 examples | None | | Claude Desktop guide | ✅ Included | Find yourself |

Contributing

Contributions welcome! See GitHub.

License

MIT © Mike Wang

Links