ccdb

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CCDB 碳排放因子搜索

CCDB Carbon Emission Factor Search

通过 ccdb-mcp-server 调用碳阻迹 CCDB 碳排放因子数据库。
Call Carbonstop's CCDB carbon emission factor database via ccdb-mcp-server.

前置条件

Prerequisites

需要全局安装 ccdb-mcp-server:
bash
npm install -g ccdb-mcp-server
无需 API Key,公开接口。
Global installation of ccdb-mcp-server is required:
bash
npm install -g ccdb-mcp-server
No API Key required, it's a public interface.

可用工具

Available Tools

通过
mcporter
以 stdio 模式调用
ccdb-mcp
CLI,暴露 3 个 MCP 工具:
Bridge to
ccdb-mcp
CLI via
mcporter
in stdio mode, exposing 3 MCP tools:

1. search_factors — 搜索碳排放因子(格式化输出)

1. search_factors — Search Carbon Emission Factors (Formatted Output)

用途:按关键词搜索碳排放因子,返回人类可读的格式化文本。
bash
mcporter call ccdb-mcp --stdio -- search_factors '{"name":"电力","lang":"zh"}'
参数:
参数类型必填说明
name
string搜索关键词,如"电力"、"水泥"、"钢铁"、"天然气"
lang
"zh"
|
"en"
搜索语言,默认
zh
返回:格式化文本,包含因子值、单位、适用地区、年份、发布机构等。
Purpose: Search carbon emission factors by keyword, return human-readable formatted text.
bash
mcporter call ccdb-mcp --stdio -- search_factors '{"name":"电力","lang":"zh"}'
Parameters:
ParameterTypeRequiredDescription
name
stringSearch keyword, e.g., "electricity", "cement", "steel", "natural gas"
lang
"zh"
|
"en"
Search language, default
zh
Returns: Formatted text including factor value, unit, applicable region, year, publishing institution, etc.

2. search_factors_json — 搜索碳排放因子(JSON 输出)

2. search_factors_json — Search Carbon Emission Factors (JSON Output)

用途:与 search_factors 相同,但返回结构化 JSON,适合程序化处理和碳排放计算。
bash
mcporter call ccdb-mcp --stdio -- search_factors_json '{"name":"电力","lang":"zh"}'
参数同
search_factors
返回 JSON 字段说明:
字段说明
name
因子名称
factor
排放因子值
unit
单位(如 kgCO₂e/kWh)
countries
适用国家/地区
year
发布年份
institution
发布机构
specification
规格说明
description
描述
sourceLevel
因子级别
business
所属行业
documentType
文件类型
Purpose: Same as search_factors, but returns structured JSON suitable for programmatic processing and carbon emission calculation.
bash
mcporter call ccdb-mcp --stdio -- search_factors_json '{"name":"电力","lang":"zh"}'
Parameters are the same as
search_factors
.
Returned JSON Field Explanation:
FieldDescription
name
Factor name
factor
Emission factor value
unit
Unit (e.g., kgCO₂e/kWh)
countries
Applicable countries/regions
year
Publication year
institution
Publishing institution
specification
Specification description
description
Description
sourceLevel
Factor level
business
Industry category
documentType
Document type

3. compare_factors — 多关键词碳排放因子对比

3. compare_factors — Multi-Keyword Carbon Emission Factor Comparison

用途:同时对比最多 5 个关键词的碳排放因子,用于横向比较不同能源/材料。
bash
mcporter call ccdb-mcp --stdio -- compare_factors '{"keywords":["电力","天然气","煤炭"],"lang":"zh"}'
参数:
参数类型必填说明
keywords
string[]搜索关键词列表,1-5 个
lang
"zh"
|
"en"
搜索语言,默认
zh
Purpose: Compare carbon emission factors for up to 5 keywords simultaneously, for horizontal comparison of different energy sources/materials.
bash
mcporter call ccdb-mcp --stdio -- compare_factors '{"keywords":["电力","天然气","煤炭"],"lang":"zh"}'
Parameters:
ParameterTypeRequiredDescription
keywords
string[]List of search keywords, 1-5 items
lang
"zh"
|
"en"
Search language, default
zh

调用方式

Calling Methods

本 Skill 通过
mcporter
CLI 以 stdio 模式桥接 ccdb-mcp-server:
bash
undefined
This Skill bridges ccdb-mcp-server via
mcporter
CLI in stdio mode:
bash
undefined

通用格式

General format

mcporter call ccdb-mcp --stdio -- <tool_name> '<json_arguments>'

如果 `mcporter` 尚未配置 ccdb-mcp,先注册:

```bash
mcporter add ccdb-mcp --command "ccdb-mcp" --args "--stdio"
备选方案(直接用 npx,无需 mcporter):
bash
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agent","version":"1.0.0"}}}' | npx -y ccdb-mcp-server --stdio 2>/dev/null
或使用下方的直接 HTTP 调用脚本(推荐,最轻量)。
mcporter call ccdb-mcp --stdio -- <tool_name> '<json_arguments>'

If `mcporter` hasn't configured ccdb-mcp yet, register first:

```bash
mcporter add ccdb-mcp --command "ccdb-mcp" --args "--stdio"
Alternative Solution (directly use npx, no mcporter required):
bash
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agent","version":"1.0.0"}}}' | npx -y ccdb-mcp-server --stdio 2>/dev/null
Or use the direct HTTP call script below (recommended, most lightweight).

直接调用脚本(推荐 · 无需安装 MCP Server)

Direct Call Script (Recommended · No MCP Server Installation Required)

Skill 自带轻量 CLI 脚本
scripts/ccdb-search.mjs
,直接调用 CCDB 公开 HTTP API,无需安装任何依赖。
The Skill comes with a lightweight CLI script
scripts/ccdb-search.mjs
, which directly calls CCDB's public HTTP API without any dependencies.

搜索因子(格式化输出)

Search Factors (Formatted Output)

bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "电力"
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "cement" en
bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "电力"
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "cement" en

搜索因子(JSON 输出,适合计算)

Search Factors (JSON Output, Suitable for Calculation)

bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "电力" zh --json
bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "电力" zh --json

多关键词对比

Multi-Keyword Comparison

bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 柴油
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 --json
bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 柴油
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 --json

Node.js 一行式(备选)

Node.js One-Liner (Alternative)

bash
node -e "const c=require('crypto'),n=process.argv[1],s=c.createHash('md5').update('mcp_ccdb_search'+n).digest('hex');fetch('https://gateway.carbonstop.com/management/system/website/searchFactorDataMcp',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sign:s,name:n,lang:'zh'})}).then(r=>r.json()).then(d=>console.log(JSON.stringify(d,null,2)))" "电力"
bash
node -e "const c=require('crypto'),n=process.argv[1],s=c.createHash('md5').update('mcp_ccdb_search'+n).digest('hex');fetch('https://gateway.carbonstop.com/management/system/website/searchFactorDataMcp',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({sign:s,name:n,lang:'zh'})}).then(r=>r.json()).then(d=>console.log(JSON.stringify(d,null,2)))" "电力"

使用场景与示例

Usage Scenarios & Examples

场景 1:查询某种能源的排放因子

Scenario 1: Query Emission Factor of a Certain Energy Source

用户:中国电网的碳排放因子是多少?
→ 搜索关键词
"电力"
"中国电网"
,筛选中国地区、最新年份
User: What is the carbon emission factor of China's power grid?
→ Search with keyword
"electricity"
or
"China Power Grid"
, filter for China region and latest year

场景 2:碳排放量计算

Scenario 2: Carbon Emission Calculation

用户:我公司去年用了 50 万度电,碳排放是多少?
→ 步骤:
  1. 搜索
    "电力"
    因子,选中国、最新年份
  2. 碳排放 = 500000 kWh × 因子值 (kgCO₂e/kWh)
User: My company used 500,000 kWh of electricity last year, how much carbon emission is that?
→ Steps:
  1. Search for
    "electricity"
    factor, select China and latest year
  2. Carbon Emission = 500000 kWh × Factor Value (kgCO₂e/kWh)

场景 3:不同能源对比

Scenario 3: Comparison of Different Energy Sources

用户:对比电力、天然气和柴油的碳排放因子
→ 使用
compare_factors
,keywords =
["电力", "天然气", "柴油"]
User: Compare the carbon emission factors of electricity, natural gas and diesel
→ Use
compare_factors
, keywords =
["electricity", "natural gas", "diesel"]

场景 4:特定行业查询

Scenario 4: Specific Industry Query

用户:水泥行业的碳排放因子
→ 搜索
"水泥"
User: Carbon emission factor of the cement industry
→ Search for
"cement"

注意事项

Notes

  1. 优先推荐中国大陆地区、最新年份的因子(除非用户指定其他地区)
  2. 因子值需注意单位换算:不同因子的单位可能不同(kgCO₂/kWh vs tCO₂/TJ 等)
  3. 数据来源权威性:关注发布机构(如生态环境部、IPCC、IEA 等)
  4. 搜索无结果时:尝试换同义词(如"电"→"电力"→"电网"→"electricity")
  5. 计算场景用 JSON 版本
    search_factors_json
    返回精确数值,适合计算
  1. Prioritize factors from mainland China and the latest year (unless user specifies other regions)
  2. Pay attention to unit conversion for factor values: Different factors may have different units (e.g., kgCO₂/kWh vs tCO₂/TJ)
  3. Authority of data sources: Focus on publishing institutions (e.g., Ministry of Ecology and Environment, IPCC, IEA, etc.)
  4. When no results are found: Try synonyms (e.g., "电" → "电力" → "电网" → "electricity")
  5. Use JSON version for calculation scenarios:
    search_factors_json
    returns precise numerical values suitable for calculation