ccdb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCCDB 碳排放因子搜索
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-serverNo API Key required, it's a public interface.
可用工具
Available Tools
通过 以 stdio 模式调用 CLI,暴露 3 个 MCP 工具:
mcporterccdb-mcpBridge to CLI via in stdio mode, exposing 3 MCP tools:
ccdb-mcpmcporter1. search_factors — 搜索碳排放因子(格式化输出)
1. search_factors — Search Carbon Emission Factors (Formatted Output)
用途:按关键词搜索碳排放因子,返回人类可读的格式化文本。
bash
mcporter call ccdb-mcp --stdio -- search_factors '{"name":"电力","lang":"zh"}'参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string | ✅ | 搜索关键词,如"电力"、"水泥"、"钢铁"、"天然气" |
| | ❌ | 搜索语言,默认 |
返回:格式化文本,包含因子值、单位、适用地区、年份、发布机构等。
Purpose: Search carbon emission factors by keyword, return human-readable formatted text.
bash
mcporter call ccdb-mcp --stdio -- search_factors '{"name":"电力","lang":"zh"}'Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | ✅ | Search keyword, e.g., "electricity", "cement", "steel", "natural gas" |
| | ❌ | Search language, default |
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 字段说明:
| 字段 | 说明 |
|---|---|
| 因子名称 |
| 排放因子值 |
| 单位(如 kgCO₂e/kWh) |
| 适用国家/地区 |
| 发布年份 |
| 发布机构 |
| 规格说明 |
| 描述 |
| 因子级别 |
| 所属行业 |
| 文件类型 |
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_factorsReturned JSON Field Explanation:
| Field | Description |
|---|---|
| Factor name |
| Emission factor value |
| Unit (e.g., kgCO₂e/kWh) |
| Applicable countries/regions |
| Publication year |
| Publishing institution |
| Specification description |
| Description |
| Factor level |
| Industry category |
| 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"}'参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| string[] | ✅ | 搜索关键词列表,1-5 个 |
| | ❌ | 搜索语言,默认 |
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:
| Parameter | Type | Required | Description |
|---|---|---|---|
| string[] | ✅ | List of search keywords, 1-5 items |
| | ❌ | Search language, default |
调用方式
Calling Methods
本 Skill 通过 CLI 以 stdio 模式桥接 ccdb-mcp-server:
mcporterbash
undefinedThis Skill bridges ccdb-mcp-server via CLI in stdio mode:
mcporterbash
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/nullOr use the direct HTTP call script below (recommended, most lightweight).
直接调用脚本(推荐 · 无需安装 MCP Server)
Direct Call Script (Recommended · No MCP Server Installation Required)
Skill 自带轻量 CLI 脚本 ,直接调用 CCDB 公开 HTTP API,无需安装任何依赖。
scripts/ccdb-search.mjsThe Skill comes with a lightweight CLI script , which directly calls CCDB's public HTTP API without any dependencies.
scripts/ccdb-search.mjs搜索因子(格式化输出)
Search Factors (Formatted Output)
bash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "电力"
node /workspace/skills/ccdb/scripts/ccdb-search.mjs "cement" enbash
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 --jsonbash
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 电力 天然气 --jsonbash
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 柴油
node /workspace/skills/ccdb/scripts/ccdb-search.mjs --compare 电力 天然气 --jsonNode.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 or , filter for China region and latest year
"electricity""China Power Grid"场景 2:碳排放量计算
Scenario 2: Carbon Emission Calculation
用户:我公司去年用了 50 万度电,碳排放是多少?
→ 步骤:
- 搜索 因子,选中国、最新年份
"电力" - 碳排放 = 500000 kWh × 因子值 (kgCO₂e/kWh)
User: My company used 500,000 kWh of electricity last year, how much carbon emission is that?
→ Steps:
- Search for factor, select China and latest year
"electricity" - Carbon Emission = 500000 kWh × Factor Value (kgCO₂e/kWh)
场景 3:不同能源对比
Scenario 3: Comparison of Different Energy Sources
用户:对比电力、天然气和柴油的碳排放因子
→ 使用 ,keywords =
compare_factors["电力", "天然气", "柴油"]User: Compare the carbon emission factors of electricity, natural gas and diesel
→ Use , keywords =
compare_factors["electricity", "natural gas", "diesel"]场景 4:特定行业查询
Scenario 4: Specific Industry Query
用户:水泥行业的碳排放因子
→ 搜索
"水泥"User: Carbon emission factor of the cement industry
→ Search for
"cement"注意事项
Notes
- 优先推荐中国大陆地区、最新年份的因子(除非用户指定其他地区)
- 因子值需注意单位换算:不同因子的单位可能不同(kgCO₂/kWh vs tCO₂/TJ 等)
- 数据来源权威性:关注发布机构(如生态环境部、IPCC、IEA 等)
- 搜索无结果时:尝试换同义词(如"电"→"电力"→"电网"→"electricity")
- 计算场景用 JSON 版本:返回精确数值,适合计算
search_factors_json
- Prioritize factors from mainland China and the latest year (unless user specifies other regions)
- Pay attention to unit conversion for factor values: Different factors may have different units (e.g., kgCO₂/kWh vs tCO₂/TJ)
- Authority of data sources: Focus on publishing institutions (e.g., Ministry of Ecology and Environment, IPCC, IEA, etc.)
- When no results are found: Try synonyms (e.g., "电" → "电力" → "电网" → "electricity")
- Use JSON version for calculation scenarios: returns precise numerical values suitable for calculation
search_factors_json