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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@godrix/create-mcp-server

v1.0.1

Published

CLI to create MCP (Model Context Protocol) servers with TypeScript. Provides a base structure with examples of tools, resources, and prompts.

Readme

Create MCP Server

A CLI tool to create MCP (Model Context Protocol) servers with TypeScript. This tool provides a base structure with examples of tools, resources, and prompts to facilitate the development of custom MCP servers.

Quick Start

Create a new MCP server with one command:

npx @godrix/create-mcp-server my-mcp-server

This will:

  1. Create a new directory with your project name
  2. Set up the complete MCP server structure
  3. Configure all necessary files
  4. Install dependencies
  5. Provide you with next steps

What's Included

Project Structure

my-mcp-server/
├── src/
│   ├── controllers/
│   │   ├── tools/
│   │   │   └── ExampleToolsController.ts    # Example controller for tools
│   │   ├── resources/
│   │   │   └── ExampleResourcesController.ts # Example controller for resources
│   │   └── prompts/
│   │       └── ExamplePromptsController.ts   # Example controller for prompts with argsSchema
│   ├── model/
│   │   ├── Error.ts                          # Error model
│   │   ├── ExampleData.ts                    # Example data model
│   │   ├── User.ts                           # User model
│   │   └── index.ts                          # Model exports
│   ├── services/
│   │   └── ExampleApiService.ts              # Example API service
│   ├── utils/
│   │   ├── apiResponseHandler.ts             # API response handler
│   │   ├── env.ts                            # Environment configuration
│   │   └── request.ts                        # Base HTTP request class
│   └── server.ts                             # Main server file
├── package.json                              # Project configuration
├── tsconfig.json                             # TypeScript configuration
├── .gitignore                                # Git ignore rules
├── .env                                      # Environment variables
├── env.example                               # Environment variables example
├── mcp.example.json                          # MCP configuration example
└── README.md                                 # Project documentation

Features

  • Tools: Example tools for API interaction
  • Resources: Example resources for data access
  • Prompts: Example prompts with argsSchema
  • TypeScript: Full TypeScript support
  • Error Handling: Standardized error handling
  • Environment: Configurable environment variables

Installation

Global Installation

npm install -g @godrix/create-mcp-server

Then use it anywhere:

create-mcp-server my-mcp-server

One-time Usage

npx @godrix/create-mcp-server my-mcp-server

Usage

Basic Usage

npx @godrix/create-mcp-server my-mcp-server

Interactive Setup

The CLI will ask you for:

  • Project description
  • Author name
  • Version
  • API URL (optional)
  • API Key (optional)

Options

  • If the directory already exists, it will ask if you want to overwrite it
  • All configuration is done interactively

Development

After creating your project:

cd my-mcp-server
npm install
npm run dev

Configuration

Environment Variables

The CLI creates a .env file with your configuration:

API_URL=https://api.example.com
API_KEY=your_api_key_here
READ_ONLY=false

MCP Configuration

Use the generated mcp.example.json as a template for your LLM configuration:

{
  "servers": [
    {
      "name": "my-mcp-server",
      "command": "npx",
      "args": ["my-mcp-server", "-y"],
      "envs": {
        "API_URL": "https://api.example.com",
        "API_KEY": "your_api_key_here",
        "READ_ONLY": "false"
      }
    }
  ]
}

Customization

Adding New Tools

  1. Create a new controller in src/controllers/tools/
  2. Implement the necessary methods
  3. Register the controller in server.ts

Adding New Resources

  1. Create a new controller in src/controllers/resources/
  2. Implement the necessary methods
  3. Register the controller in server.ts

Adding New Prompts

  1. Create a new controller in src/controllers/prompts/
  2. Implement the necessary methods
  3. Register the controller in server.ts

Examples

Create a Simple MCP Server

npx @godrix/create-mcp-server simple-mcp

Create a Custom MCP Server

npx @godrix/create-mcp-server my-custom-mcp
# Follow the interactive prompts

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

MIT