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

@gongfu/mcp-server

v0.2.1-alpha

Published

Kongfu MCP Server - Model Context Protocol implementation with SSE support

Readme

@kongfu/mcp-server

Konfu MCP Server - 实现 Model Context Protocol 的服务器,支持 SSE 和 STDIO 传输。

特性

  • 🚀 完整的 MCP 协议实现
  • 📡 支持 SSE (Server-Sent Events) 传输
  • 🔌 支持 STDIO 传输
  • 🛠️ 内置工具:任务管理、PRD 生成、IDE 同步
  • 📚 资源提供:任务和 PRD 访问
  • 💡 提示词模板:代码审查、错误修复等

安装

npm install @kongfu/mcp-server

使用方式

1. SSE 模式(适用于 Web 集成)

# 启动 SSE 服务器
kongfu-mcp-sse

# 或指定端口和工作空间
PORT=3001 KONFU_WORKSPACE=/path/to/project kongfu-mcp-sse

SSE 端点:

  • 连接:GET http://localhost:3001/mcp/sse
  • 发送消息:POST http://localhost:3001/mcp/sse/message
  • 健康检查:GET http://localhost:3001/health

2. STDIO 模式(适用于 Claude Desktop)

# 启动 STDIO 服务器
kongfu-mcp-stdio

# 或指定工作空间
KONFU_WORKSPACE=/path/to/project kongfu-mcp-stdio

在 Claude Desktop 配置:

{
  "mcpServers": {
    "kongfu": {
      "command": "kongfu-mcp-stdio",
      "env": {
        "KONFU_WORKSPACE": "/path/to/your/project"
      }
    }
  }
}

编程使用

创建自定义 MCP 服务器

import { KonfuMcpServer } from '@kongfu/mcp-server';
import { SSEServerTransport } from '@kongfu/mcp-server/transport';

// 创建服务器
const server = new KonfuMcpServer({
  name: 'my-kongfu-server',
  version: '1.0.0',
  workspaceRoot: process.cwd()
});

// 创建传输层
const transport = new SSEServerTransport(app, '/mcp');

// 启动服务器
await server.start(transport);

SSE 客户端示例

import { SSEClientTransport } from '@kongfu/mcp-server/transport';

// 创建客户端传输
const transport = new SSEClientTransport('http://localhost:3001/mcp/sse');

// 设置消息处理器
transport.onmessage = (message) => {
  console.log('Received:', message);
};

// 连接
await transport.start();

// 发送消息
await transport.send({
  jsonrpc: '2.0',
  method: 'tools/call',
  params: {
    name: 'create_task',
    arguments: {
      name: '实现用户登录',
      type: 'feature',
      description: '支持邮箱和手机号登录'
    }
  },
  id: 1
});

可用工具

create_task

创建新的开发任务。

{
  "name": "任务名称",
  "type": "feature|bug|test|doc|refactor",
  "description": "任务描述",
  "priority": "low|normal|high|urgent",
  "est": "3d"
}

update_task_status

更新任务状态。

{
  "taskId": "feature-login",
  "status": "todo|doing|review|done"
}

generate_prd

生成产品需求文档。

{
  "idea": "产品想法描述",
  "template": "模板名称"
}

sync_to_ide

同步配置到 IDE。

{
  "ide": "cursor|claude"
}

可用资源

  • kongfu://tasks/{taskId} - 访问特定任务
  • kongfu://prds/{prdId} - 访问特定 PRD

可用提示词

  • generate-tasks - 根据需求生成任务
  • code-review - 代码审查助手
  • fix-error - 错误修复助手

配置选项

环境变量

  • PORT - SSE 服务器端口(默认:3001)
  • KONFU_WORKSPACE - 工作空间根目录(默认:当前目录)
  • LOG_LEVEL - 日志级别(默认:info)
  • NODE_ENV - 环境(development/production)

开发

# 安装依赖
npm install

# 开发模式(SSE)
npm run dev:sse

# 开发模式(STDIO)
npm run dev:stdio

# 构建
npm run build

# 测试
npm test

架构

@kongfu/mcp-server
├── server/          # MCP 服务器核心
├── transport/       # 传输层实现(SSE、STDIO)
├── tools/           # 工具实现
├── resources/       # 资源提供者
├── prompts/         # 提示词模板
└── utils/           # 工具函数

License

MIT