@nikeandocean/carbon-factor-matcher 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +243 -240
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,240 +1,243 @@
|
|
|
1
|
-
[](https://smithery.ai/servers/nikeandocean/carbon-factor-matcher)
|
|
2
|
-
|
|
3
|
-
# Carbon Factor Matcher — MCP Server for Carbon Accounting
|
|
4
|
-
|
|
5
|
-
An MCP (Model Context Protocol) server that connects AI agents with carbon emission factor databases. It provides intelligent emission factor matching for carbon accounting, LCA (Life Cycle Assessment), and ESG reporting applications.
|
|
6
|
-
|
|
7
|
-
## What is this MCP?
|
|
8
|
-
|
|
9
|
-
Carbon Factor Matcher helps AI agents find the most appropriate emission factors from standardized environmental databases. It uses a hybrid search algorithm:
|
|
10
|
-
|
|
11
|
-
1. **Keyword + Embedding retrieval** — Field-weighted keyword scoring and semantic similarity to find candidate factors
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
### Key Features
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
- Multi-language support (Chinese/English activity descriptions)
|
|
25
|
-
- Zero configuration — works out of the box after installation
|
|
26
|
-
- MCP-compatible — works with Claude, Cursor, Windsurf, Cline, Continue, and any MCP client
|
|
27
|
-
|
|
28
|
-
## Installation
|
|
29
|
-
|
|
30
|
-
### Claude Code
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
claude mcp add carbon-factor-matcher -- npx -y @nikeandocean/carbon-factor-matcher
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Claude Desktop
|
|
37
|
-
|
|
38
|
-
Add to `claude_desktop_config.json`:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
{
|
|
42
|
-
"mcpServers": {
|
|
43
|
-
"carbon-factor-matcher": {
|
|
44
|
-
"command": "npx",
|
|
45
|
-
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Config file locations:
|
|
52
|
-
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
53
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
54
|
-
|
|
55
|
-
### Cursor
|
|
56
|
-
|
|
57
|
-
Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
{
|
|
61
|
-
"mcpServers": {
|
|
62
|
-
"carbon-factor-matcher": {
|
|
63
|
-
"command": "npx",
|
|
64
|
-
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Or via Cursor UI: **Settings → MCP → Add new global MCP server**.
|
|
71
|
-
|
|
72
|
-
### Windsurf
|
|
73
|
-
|
|
74
|
-
Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
75
|
-
|
|
76
|
-
```json
|
|
77
|
-
{
|
|
78
|
-
"mcpServers": {
|
|
79
|
-
"carbon-factor-matcher": {
|
|
80
|
-
"command": "npx",
|
|
81
|
-
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Or via Windsurf UI: **Settings → Cascade → MCP Servers → Add**.
|
|
88
|
-
|
|
89
|
-
### Cline (VS Code Extension)
|
|
90
|
-
|
|
91
|
-
Add to Cline MCP settings (click **MCP Servers** icon in Cline panel):
|
|
92
|
-
|
|
93
|
-
```json
|
|
94
|
-
{
|
|
95
|
-
"mcpServers": {
|
|
96
|
-
"carbon-factor-matcher": {
|
|
97
|
-
"command": "npx",
|
|
98
|
-
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Continue (VS Code / JetBrains)
|
|
105
|
-
|
|
106
|
-
Add to `~/.continue/config.yaml`:
|
|
107
|
-
|
|
108
|
-
```yaml
|
|
109
|
-
mcpServers:
|
|
110
|
-
- name: carbon-factor-matcher
|
|
111
|
-
command: npx
|
|
112
|
-
args:
|
|
113
|
-
- "-y"
|
|
114
|
-
- "@nikeandocean/carbon-factor-matcher"
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Smithery.ai (One-Click Install)
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
npx -y smithery mcp add nikeandocean/carbon-factor-matcher
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Or visit [smithery.ai/server/@nikeandocean/carbon-factor-matcher](https://smithery.ai/server/@nikeandocean/carbon-factor-matcher) for hosted endpoint.
|
|
124
|
-
|
|
125
|
-
## Pro License
|
|
126
|
-
|
|
127
|
-
The Free tier works immediately after installation (300 queries/day, ELCD database, keyword search). To unlock the full experience:
|
|
128
|
-
|
|
129
|
-
| Plan | Price | Features |
|
|
130
|
-
|------|-------|----------|
|
|
131
|
-
| **Free** | $0 | ELCD database (
|
|
132
|
-
| **Pro** | $5 (one-time) | ELCD + ecoinvent (
|
|
133
|
-
|
|
134
|
-
### Purchase License Key
|
|
135
|
-
|
|
136
|
-
👉 **[Buy Pro License](https://nikeandocean.github.io/carbon-factor-matcher)**
|
|
137
|
-
|
|
138
|
-
After purchase, you'll receive a license key via email. Set it as an environment variable in your MCP config:
|
|
139
|
-
|
|
140
|
-
```json
|
|
141
|
-
{
|
|
142
|
-
"mcpServers": {
|
|
143
|
-
"carbon-factor-matcher": {
|
|
144
|
-
"command": "npx",
|
|
145
|
-
"args": ["-y", "@nikeandocean/carbon-factor-matcher"],
|
|
146
|
-
"env": {
|
|
147
|
-
"CARBON_FACTOR_LICENSE_KEY": "PRO-xxxx-xxxx"
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Configuration
|
|
155
|
-
|
|
156
|
-
| Variable | Description | Default |
|
|
157
|
-
|----------|-------------|---------|
|
|
158
|
-
| `CARBON_FACTOR_LICENSE_KEY` | Your license key (empty = Free tier) | — |
|
|
159
|
-
| `CARBON_FACTOR_DATA_DIR` | Path to local factor database | `data/factors` |
|
|
160
|
-
|
|
161
|
-
Note: No external LLM API configuration needed. The calling AI agent handles final factor selection.
|
|
162
|
-
|
|
163
|
-
## Available Tools
|
|
164
|
-
|
|
165
|
-
### `factor_match`
|
|
166
|
-
|
|
167
|
-
Match activity data to emission factors. Free tier uses keyword search; Pro tier uses hybrid
|
|
168
|
-
|
|
169
|
-
**Input:**
|
|
170
|
-
```json
|
|
171
|
-
{
|
|
172
|
-
"activity_data": "
|
|
173
|
-
"top_k":
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
**Output (Pro tier):**
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"candidates": [
|
|
181
|
-
{
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
1
|
+
[](https://smithery.ai/servers/nikeandocean/carbon-factor-matcher)
|
|
2
|
+
|
|
3
|
+
# Carbon Factor Matcher — MCP Server for Carbon Accounting
|
|
4
|
+
|
|
5
|
+
An MCP (Model Context Protocol) server that connects AI agents with carbon emission factor databases. It provides intelligent emission factor matching for carbon accounting, LCA (Life Cycle Assessment), and ESG reporting applications.
|
|
6
|
+
|
|
7
|
+
## What is this MCP?
|
|
8
|
+
|
|
9
|
+
Carbon Factor Matcher helps AI agents find the most appropriate emission factors from standardized environmental databases. It uses a hybrid search algorithm:
|
|
10
|
+
|
|
11
|
+
1. **Keyword + Embedding retrieval** — Field-weighted keyword scoring and semantic similarity to find candidate factors
|
|
12
|
+
|
|
13
|
+
The calling AI agent selects the best match from the ranked candidates. No external LLM API needed.
|
|
14
|
+
|
|
15
|
+
### Supported Databases
|
|
16
|
+
|
|
17
|
+
- **ELCD** — European Reference Life Cycle Database (500+ factors, included in Free tier)
|
|
18
|
+
- **ecoinvent 3.10** — Swiss Centre for Life Cycle Inventories (6,000+ factors, Pro license required)
|
|
19
|
+
- **MEE** — China Ministry of Ecology and Environment (48 provincial/grid factors, Pro license required)
|
|
20
|
+
|
|
21
|
+
### Key Features
|
|
22
|
+
|
|
23
|
+
- Hybrid keyword + embedding matching (DashScope text-embedding-v4)
|
|
24
|
+
- Multi-language support (Chinese/English activity descriptions)
|
|
25
|
+
- Zero configuration — works out of the box after installation
|
|
26
|
+
- MCP-compatible — works with Claude, Cursor, Windsurf, Cline, Continue, and any MCP client
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Claude Code
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add carbon-factor-matcher -- npx -y @nikeandocean/carbon-factor-matcher
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Claude Desktop
|
|
37
|
+
|
|
38
|
+
Add to `claude_desktop_config.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"carbon-factor-matcher": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Config file locations:
|
|
52
|
+
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
53
|
+
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
54
|
+
|
|
55
|
+
### Cursor
|
|
56
|
+
|
|
57
|
+
Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"mcpServers": {
|
|
62
|
+
"carbon-factor-matcher": {
|
|
63
|
+
"command": "npx",
|
|
64
|
+
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or via Cursor UI: **Settings → MCP → Add new global MCP server**.
|
|
71
|
+
|
|
72
|
+
### Windsurf
|
|
73
|
+
|
|
74
|
+
Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mcpServers": {
|
|
79
|
+
"carbon-factor-matcher": {
|
|
80
|
+
"command": "npx",
|
|
81
|
+
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Or via Windsurf UI: **Settings → Cascade → MCP Servers → Add**.
|
|
88
|
+
|
|
89
|
+
### Cline (VS Code Extension)
|
|
90
|
+
|
|
91
|
+
Add to Cline MCP settings (click **MCP Servers** icon in Cline panel):
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"mcpServers": {
|
|
96
|
+
"carbon-factor-matcher": {
|
|
97
|
+
"command": "npx",
|
|
98
|
+
"args": ["-y", "@nikeandocean/carbon-factor-matcher"]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Continue (VS Code / JetBrains)
|
|
105
|
+
|
|
106
|
+
Add to `~/.continue/config.yaml`:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
mcpServers:
|
|
110
|
+
- name: carbon-factor-matcher
|
|
111
|
+
command: npx
|
|
112
|
+
args:
|
|
113
|
+
- "-y"
|
|
114
|
+
- "@nikeandocean/carbon-factor-matcher"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Smithery.ai (One-Click Install)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx -y smithery mcp add nikeandocean/carbon-factor-matcher
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or visit [smithery.ai/server/@nikeandocean/carbon-factor-matcher](https://smithery.ai/server/@nikeandocean/carbon-factor-matcher) for hosted endpoint.
|
|
124
|
+
|
|
125
|
+
## Pro License
|
|
126
|
+
|
|
127
|
+
The Free tier works immediately after installation (300 queries/day, ELCD database, keyword search). To unlock the full experience:
|
|
128
|
+
|
|
129
|
+
| Plan | Price | Features |
|
|
130
|
+
|------|-------|----------|
|
|
131
|
+
| **Free** | $0 | ELCD database (500+ factors), keyword search, 300 queries/day |
|
|
132
|
+
| **Pro** | $5 (one-time) | ELCD + ecoinvent + MEE (6,370+ factors), hybrid keyword + embedding matching, unlimited queries |
|
|
133
|
+
|
|
134
|
+
### Purchase License Key
|
|
135
|
+
|
|
136
|
+
👉 **[Buy Pro License](https://nikeandocean.github.io/carbon-factor-matcher)**
|
|
137
|
+
|
|
138
|
+
After purchase, you'll receive a license key via email. Set it as an environment variable in your MCP config:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"carbon-factor-matcher": {
|
|
144
|
+
"command": "npx",
|
|
145
|
+
"args": ["-y", "@nikeandocean/carbon-factor-matcher"],
|
|
146
|
+
"env": {
|
|
147
|
+
"CARBON_FACTOR_LICENSE_KEY": "PRO-xxxx-xxxx"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Configuration
|
|
155
|
+
|
|
156
|
+
| Variable | Description | Default |
|
|
157
|
+
|----------|-------------|---------|
|
|
158
|
+
| `CARBON_FACTOR_LICENSE_KEY` | Your license key (empty = Free tier) | — |
|
|
159
|
+
| `CARBON_FACTOR_DATA_DIR` | Path to local factor database | `data/factors` |
|
|
160
|
+
|
|
161
|
+
Note: No external LLM API configuration needed. The calling AI agent handles final factor selection.
|
|
162
|
+
|
|
163
|
+
## Available Tools
|
|
164
|
+
|
|
165
|
+
### `factor_match`
|
|
166
|
+
|
|
167
|
+
Match activity data to emission factors. Free tier uses keyword search; Pro tier uses hybrid keyword + embedding matching. Returns ranked candidates for the calling agent to select from.
|
|
168
|
+
|
|
169
|
+
**Input:**
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"activity_data": "electricity, medium voltage, industrial grid, China, Guangdong",
|
|
173
|
+
"top_k": 5
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Output (Pro tier):**
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"candidates": [
|
|
181
|
+
{
|
|
182
|
+
"name": "electricity, provincial grid, Guangdong (广东)",
|
|
183
|
+
"value": 0.4419,
|
|
184
|
+
"unit": "kgCO2/kWh",
|
|
185
|
+
"geography": {"location": "China, Guangdong (广东)"},
|
|
186
|
+
"source": "MEE (Ministry of Ecology and Environment), China",
|
|
187
|
+
"source_year": 2023,
|
|
188
|
+
"db_source": "mee",
|
|
189
|
+
"keyword_score": 0.8293,
|
|
190
|
+
"embedding_score": 0.6779,
|
|
191
|
+
"hybrid_score": 0.7233,
|
|
192
|
+
"final_score": 0.7233
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"selection_guidance": "从候选列表中选择最匹配的排放因子..."
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `factor_search`
|
|
200
|
+
|
|
201
|
+
Search emission factors by keyword with optional filters.
|
|
202
|
+
|
|
203
|
+
**Input:**
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"query": "diesel",
|
|
207
|
+
"category": "fuel",
|
|
208
|
+
"limit": 10
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### `factor_detail`
|
|
213
|
+
|
|
214
|
+
Get full metadata for a specific factor.
|
|
215
|
+
|
|
216
|
+
**Input:**
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"factor_id": "elec-cn-south-10kv-2024"
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Demo
|
|
224
|
+
|
|
225
|
+
👉 **[Try the Live Demo](https://nikeandocean.github.io/carbon-factor-matcher/demo.html)** — Search 30+ emission factors directly in your browser (no installation needed).
|
|
226
|
+
|
|
227
|
+
## System Requirements
|
|
228
|
+
|
|
229
|
+
- Node.js 18+ (for `npx`)
|
|
230
|
+
- Python 3.11+ (auto-installed via pip)
|
|
231
|
+
|
|
232
|
+
## Support
|
|
233
|
+
|
|
234
|
+
- **Email:** tao.yan@zju.edu.cn
|
|
235
|
+
- **Issues:** https://github.com/nikeandocean/carbon-factor-matcher/issues
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
This is proprietary software. See [LICENSE](LICENSE) for details.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
© 2024 Carbon Factor Matcher. All rights reserved.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nikeandocean/carbon-factor-matcher",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "MCP server for intelligent emission factor matching — connects AI agents with carbon emission factor databases (ELCD, ecoinvent)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|