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

ccdb-mcp-server

v1.1.0

Published

CCDB碳排放因子搜索 MCP Server - 支持 Streamable HTTP 和 stdio 双传输机制

Readme

CCDB 碳排放因子搜索 MCP Server

npm version

基于 Model Context Protocol (MCP) 构建的碳排放因子数据库搜索服务,支持 Streamable HTTPstdio 双传输机制。

✨ 功能

| 工具名称 | 描述 | | --- | --- | | search_factors | 搜索碳排放因子(格式化可读输出) | | search_factors_json | 搜索碳排放因子(结构化 JSON 输出,适合计算) | | compare_factors | 多关键词碳排放因子对比(最多 5 个) |

| 提示模板 | 描述 | | --- | --- | | factor_search | 引导 LLM 进行因子搜索 | | carbon_calculation | 引导 LLM 进行碳排放量计算 |

🚀 快速开始

方式一:通过 npx 直接运行(推荐)

无需安装,直接运行:

# stdio 模式
npx ccdb-mcp-server --stdio

# Streamable HTTP 模式
npx ccdb-mcp-server --http --port 3000

方式二:全局安装

npm install -g ccdb-mcp-server

# stdio 模式
ccdb-mcp --stdio

# Streamable HTTP 模式
ccdb-mcp --http --port 3000

方式三:从源码运行

git clone https://github.com/carbonstop/ccdb-mcp.git
cd ccdb-mcp
npm install
npm run build

# stdio 模式
npm start

# Streamable HTTP 模式
node dist/index.js --http

开发模式(无需编译)

# HTTP 模式
npm run dev

# stdio 模式
npm run dev:stdio

🔌 集成配置

Claude Desktop (stdio 模式)

~/Library/Application Support/Claude/claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "ccdb-factor-search": {
      "command": "npx",
      "args": ["-y", "ccdb-mcp-server", "--stdio"]
    }
  }
}

Claude Desktop (Streamable HTTP 模式)

先启动 HTTP 服务:

npx ccdb-mcp-server --http --port 3000

然后在 Claude Desktop 配置中添加:

{
  "mcpServers": {
    "ccdb-factor-search": {
      "url": "http://localhost:3000/mcp"
    }
  }
}

Cursor (stdio 模式)

在 Cursor 设置的 MCP 配置中添加:

{
  "ccdb-factor-search": {
    "command": "npx",
    "args": ["-y", "ccdb-mcp-server", "--stdio"]
  }
}

📡 API 端点

Streamable HTTP 模式

| 方法 | 路径 | 说明 | | --- | --- | --- | | POST | /mcp | MCP 请求(初始化/工具调用) | | GET | /mcp | SSE 通知流 | | DELETE | /mcp | 会话终止 | | GET | /health | 健康检查 |

🏗️ 项目结构

ccdb-mcp/
├── src/
│   ├── index.ts            # 入口 — CLI 参数解析与传输层分发
│   ├── server.ts           # MCP Server 核心 — Tools / Prompts 注册
│   ├── ccdb-api.ts         # CCDB API 客户端 — 请求封装与类型定义
│   ├── transport-stdio.ts  # stdio 传输层
│   └── transport-http.ts   # Streamable HTTP 传输层
├── package.json
├── tsconfig.json
└── README.md

📝 使用示例

通过 MCP 客户端调用 search_factors 工具:

{
  "name": "search_factors",
  "arguments": {
    "name": "电力",
    "lang": "zh"
  }
}

返回格式化的碳排放因子数据,包含因子值、单位、适用地区、年份、来源机构等详细信息。

📦 发布到 npm

npm login
npm publish

License

MIT