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

jq-simple-mcp-server

v1.0.0

Published

A simple MCP server with stdio transport

Readme

Simple MCP Server

一个使用 TypeScript 编写的最简单的 MCP (Model Context Protocol) 服务器,支持 stdio 协议传输。

功能特性

  • 🚀 基于 @modelcontextprotocol/sdk 构建
  • 📡 支持 stdio 传输协议
  • 🛠️ 提供简单的 hello 工具演示
  • 📦 支持 npx 直接运行
  • 💾 完整的 TypeScript 支持

快速开始

安装依赖

npm install

编译项目

npm run build

运行服务器

# 方式 1: 使用 npm
npm start

# 方式 2: 使用 npx
npx simple-mcp-server

# 方式 3: 开发模式
npm run dev

项目结构

simple-mcp-server/
├── src/
│   └── index.ts          # 主要服务器逻辑
├── dist/                 # 编译输出目录
├── package.json          # 项目配置
├── tsconfig.json         # TypeScript 配置
└── README.md            # 说明文档

工具说明

hello 工具

这是一个简单的问候工具,用于演示 MCP 服务器的基本功能。

参数:

  • name (string, 可选): 要问候的名字,默认为 "World"

示例:

{
  "name": "hello",
  "arguments": {
    "name": "Alice"
  }
}

响应:

{
  "content": [
    {
      "type": "text",
      "text": "Hello, Alice!"
    }
  ]
}

开发

脚本命令

  • npm run build - 编译 TypeScript 代码
  • npm run start - 运行编译后的服务器
  • npm run dev - 开发模式运行(使用 ts-node)

添加新工具

  1. ListToolsRequestSchema 处理器中添加工具定义
  2. CallToolRequestSchema 处理器中添加工具实现

示例:

// 添加工具定义
{
  name: "my-tool",
  description: "我的工具描述",
  inputSchema: {
    type: "object",
    properties: {
      param: {
        type: "string",
        description: "参数描述",
      },
    },
  },
}

// 添加工具实现
case "my-tool": {
  const param = request.params.arguments?.param;
  return {
    content: [
      {
        type: "text",
        text: `处理结果: ${param}`,
      },
    ],
  };
}

发布

准备发布

npm run build

发布到 npm

npm publish

发布后,用户可以通过以下方式使用:

npx simple-mcp-server

环境要求

  • Node.js >= 18
  • npm >= 8

许可证

MIT License

相关链接