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

mcptool

v0.1.1

Published

A compiler for producing MCP servers

Readme

🤖 mcptool

A tool to generate TypeScript MCP servers from source code.

  • Supports multiple flavors (e.g. tmcp, official mcp)
  • Generates type-safe MCP tool implementations
  • Configurable transport methods (e.g. stdio, http)
  • Automatically installs missing dependencies

Install

npm install -g mcptool

Usage

npx mcptool src/input.ts -o src/server.ts

How it works

This tool will process a typescript entrypoint and generate a fully functional MCP server implementation based on the provided code.

For example, take the following code as input:

/**
 * Adds two numbers
 * @mcpTool
 */
export function add(a: number, b: number): number {
  return a + b;
}

If we run npx mcptool src/input.ts, this will generate an MCP server that exposes the add function as an MCP tool.

The generated file will be TypeScript, and should be committed to your repository. This is not "build output", in that you can choose to modify it manually from now on or can use it as a pre-commit step to always regenerate it.

Key points to note:

  • All exported functions of the entrypoint file with @mcpTool JSDoc comments will be exposed as MCP tools.
  • The generated server will use the types defined in your source code, ensuring type safety.
  • You can choose which SDK to use (e.g. tmcp or the official MCP TypeScript SDK).
  • If your function returns a CallToolResult (e.g. from tmcp), the generated server will use it as-is rather than wrapping it again.

Options

  • --outFile, -o <path> - Output file path
  • --cwd, -c <path> - Current working directory (default: .)
  • --transport, -t <type> - Transport method: stdio or http (default: stdio)
  • --name, -n <name> - Project name (defaults to package.json name)
  • --version, -v <version> - Project version (defaults to package.json version)
  • --flavor, -f <flavor> - MCP flavor: tmcp or mcp (default: tmcp)
  • --interactive, -i - Run in interactive mode (default: false)
  • --silent, -s - Suppress output messages (default: false)
  • --install - Automatically install missing dependencies (default: false)

Example with options

mcptool src/input.ts -o src/server.ts -t http -f mcp --install

Formatting

The generated code is automatically formatted using the formatter installed locally in your project if it is supported. Supported formatters are:

If none of these are installed, the code will be unformatted and may not adhere to your project's coding style.

License

MIT License