@carbonstopper/agent-mcp 0.1.2
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/AGENTS.md +40 -0
- package/README.md +162 -0
- package/dist/apipath.d.ts +13 -0
- package/dist/apipath.js +16 -0
- package/dist/apipath.js.map +1 -0
- package/dist/baseurl.d.ts +1 -0
- package/dist/baseurl.js +3 -0
- package/dist/baseurl.js.map +1 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.js +62 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +12 -0
- package/dist/tools.js +238 -0
- package/dist/tools.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +19 -0
- package/dist/version.js.map +1 -0
- package/package.json +50 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This is a stdio MCP server for Carbonstop server-side Agent usage. It wraps Java internal Agent APIs through gateway service prefixes:
|
|
6
|
+
|
|
7
|
+
- `/ai/agent/internal/platform/**`
|
|
8
|
+
- `/footprint3/agent/internal/skills/**`
|
|
9
|
+
|
|
10
|
+
## Authentication
|
|
11
|
+
|
|
12
|
+
Do not use Carbon Cloud open platform API keys here.
|
|
13
|
+
|
|
14
|
+
The MCP process reads:
|
|
15
|
+
|
|
16
|
+
- `CARBONSTOP_AGENT_BASE_URL`
|
|
17
|
+
- `CARBONSTOP_AGENT_INTERNAL_KEY`
|
|
18
|
+
- `CARBONSTOP_TIMEOUT`
|
|
19
|
+
|
|
20
|
+
Each tool call must include `sessionId`. The HTTP client forwards it in both `X-Agent-Session-Id` and the JSON body.
|
|
21
|
+
|
|
22
|
+
## Architecture
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
src/index.ts MCP server entry and tool registration
|
|
26
|
+
src/tools.ts Zod schemas, descriptions, route mapping, body builder
|
|
27
|
+
src/client.ts HTTP client with retry and Agent internal headers
|
|
28
|
+
src/config.ts environment loading
|
|
29
|
+
src/apipath.ts Java endpoint paths
|
|
30
|
+
src/version.ts version info
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Tool Families
|
|
34
|
+
|
|
35
|
+
- Platform context and memory: `session_context`, `project_memory_get`, `project_memory_patch`, `project_memory_compress`
|
|
36
|
+
- Product carbon skills: `modeling_preview`, `modeling_execute`, `modeling_update`, `modeling_detail`
|
|
37
|
+
- Report skills: `report_generate`, `report_detail`
|
|
38
|
+
- Support skills: `analysis_run`, `factor_search`, `knowledge_search`
|
|
39
|
+
|
|
40
|
+
Write or high-risk tools require `idempotencyKey`.
|
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# carbonstop-agent-mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for Carbonstop Agent internal skill APIs.
|
|
4
|
+
|
|
5
|
+
This package is for server-side Agent scenarios. It wraps Carbonstop Java internal Agent APIs and forwards the Agent session identity to the gateway.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
This Agent package is published as `@carbonstopper/agent-mcp`; the existing `@carbonstopper/mcp` package remains the Carbon Cloud open-platform-key version.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @carbonstopper/agent-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or run directly:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @carbonstopper/agent-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
1. Configure the Agent internal key:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
export CARBONSTOP_AGENT_INTERNAL_KEY="your-agent-internal-key"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Start the MCP server:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx @carbonstopper/agent-mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The npm release includes the default gateway base URL injected during the release build. For local debugging or environment override, set:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
export CARBONSTOP_AGENT_BASE_URL="https://your-gateway-host"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`CARBONSTOP_BASE_URL` is also accepted as a compatibility fallback.
|
|
42
|
+
|
|
43
|
+
## MCP Client Config
|
|
44
|
+
|
|
45
|
+
### Claude Code / Claude Desktop
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"carbonstop-agent": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["@carbonstopper/agent-mcp"],
|
|
53
|
+
"env": {
|
|
54
|
+
"CARBONSTOP_AGENT_INTERNAL_KEY": "your-agent-internal-key"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Cursor
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"carbonstop-agent": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["@carbonstopper/agent-mcp"],
|
|
69
|
+
"env": {
|
|
70
|
+
"CARBONSTOP_AGENT_INTERNAL_KEY": "your-agent-internal-key"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For local debugging against a non-default gateway, add:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
"CARBONSTOP_AGENT_BASE_URL": "http://localhost:8080"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Authentication
|
|
84
|
+
|
|
85
|
+
- The MCP server does not use Carbon Cloud open platform API keys.
|
|
86
|
+
- Each tool call must include `sessionId`; the Agent should pass the session id received from the server-side Agent invocation.
|
|
87
|
+
- The MCP server forwards:
|
|
88
|
+
- `X-Agent-Internal-Key: ${CARBONSTOP_AGENT_INTERNAL_KEY}`
|
|
89
|
+
- `X-Agent-Session-Id: ${sessionId}`
|
|
90
|
+
- The same `sessionId` is kept in the JSON body for audit, idempotency, trace, and business context.
|
|
91
|
+
|
|
92
|
+
## Available Tools
|
|
93
|
+
|
|
94
|
+
| Tool | Description |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `session_context` | Resolve session ownership and business context. |
|
|
97
|
+
| `project_memory_get` | Read project memory. |
|
|
98
|
+
| `project_memory_patch` | Patch project memory. Requires `idempotencyKey`. |
|
|
99
|
+
| `project_memory_compress` | Save compressed project memory. Requires `idempotencyKey`. |
|
|
100
|
+
| `modeling_preview` | Preview product carbon AI modeling. |
|
|
101
|
+
| `modeling_execute` | Execute product carbon AI modeling. Requires `idempotencyKey`. |
|
|
102
|
+
| `modeling_update` | Update an existing product carbon model. Requires `accountId` and `idempotencyKey`. |
|
|
103
|
+
| `modeling_detail` | Get product carbon model details. |
|
|
104
|
+
| `report_generate` | Generate a product carbon report. Requires `idempotencyKey`. |
|
|
105
|
+
| `report_detail` | Get product carbon report detail and latest report URL. |
|
|
106
|
+
| `analysis_run` | Run product carbon analysis. |
|
|
107
|
+
| `factor_search` | Search and match carbon emission factors. |
|
|
108
|
+
| `knowledge_search` | Search carbon knowledge. |
|
|
109
|
+
|
|
110
|
+
## Tool Request Shape
|
|
111
|
+
|
|
112
|
+
Most tools forward the unified Agent skill request:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"sessionId": "agent_xxx",
|
|
117
|
+
"projectId": 1001,
|
|
118
|
+
"accountId": 2001,
|
|
119
|
+
"modelId": null,
|
|
120
|
+
"reportId": null,
|
|
121
|
+
"idempotencyKey": "agent_xxx_modeling_execute_v1",
|
|
122
|
+
"confirmed": true,
|
|
123
|
+
"pendingActionId": null,
|
|
124
|
+
"input": {}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Write or high-risk tools require `idempotencyKey`, especially:
|
|
129
|
+
|
|
130
|
+
- `modeling_execute`
|
|
131
|
+
- `modeling_update`
|
|
132
|
+
- `report_generate`
|
|
133
|
+
- `project_memory_patch`
|
|
134
|
+
- `project_memory_compress`
|
|
135
|
+
|
|
136
|
+
## API Routes
|
|
137
|
+
|
|
138
|
+
Platform APIs are called through the `ai` gateway prefix:
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
/ai/agent/internal/platform/**
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Product carbon skill APIs are called through the `footprint3` gateway prefix:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
/footprint3/agent/internal/skills/**
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Release Build
|
|
151
|
+
|
|
152
|
+
`RELEASE_BASE_URL_ENCODED` is a repository secret used by the GitHub Actions build to inject the default gateway base URL. It is not required in MCP client config.
|
|
153
|
+
|
|
154
|
+
Runtime environment variables still take priority:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
CARBONSTOP_AGENT_BASE_URL > CARBONSTOP_BASE_URL > release build URL
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const SessionContext: () => string;
|
|
2
|
+
export declare const ProjectMemoryGet: () => string;
|
|
3
|
+
export declare const ProjectMemoryPatch: () => string;
|
|
4
|
+
export declare const ProjectMemoryCompress: () => string;
|
|
5
|
+
export declare const ModelingPreview: () => string;
|
|
6
|
+
export declare const ModelingExecute: () => string;
|
|
7
|
+
export declare const ModelingUpdate: () => string;
|
|
8
|
+
export declare const ModelingDetail: () => string;
|
|
9
|
+
export declare const ReportGenerate: () => string;
|
|
10
|
+
export declare const ReportDetail: () => string;
|
|
11
|
+
export declare const AnalysisRun: () => string;
|
|
12
|
+
export declare const FactorSearch: () => string;
|
|
13
|
+
export declare const KnowledgeSearch: () => string;
|
package/dist/apipath.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const aiPrefix = "/ai";
|
|
2
|
+
const footprint3Prefix = "/footprint3";
|
|
3
|
+
export const SessionContext = () => `${aiPrefix}/agent/internal/platform/sessionContext`;
|
|
4
|
+
export const ProjectMemoryGet = () => `${aiPrefix}/agent/internal/platform/project-memory/get`;
|
|
5
|
+
export const ProjectMemoryPatch = () => `${aiPrefix}/agent/internal/platform/project-memory/patch`;
|
|
6
|
+
export const ProjectMemoryCompress = () => `${aiPrefix}/agent/internal/platform/project-memory/compress`;
|
|
7
|
+
export const ModelingPreview = () => `${footprint3Prefix}/agent/internal/skills/modeling/preview`;
|
|
8
|
+
export const ModelingExecute = () => `${footprint3Prefix}/agent/internal/skills/modeling/execute`;
|
|
9
|
+
export const ModelingUpdate = () => `${footprint3Prefix}/agent/internal/skills/modeling/update`;
|
|
10
|
+
export const ModelingDetail = () => `${footprint3Prefix}/agent/internal/skills/modeling/detail`;
|
|
11
|
+
export const ReportGenerate = () => `${footprint3Prefix}/agent/internal/skills/report/generate`;
|
|
12
|
+
export const ReportDetail = () => `${footprint3Prefix}/agent/internal/skills/report/detail`;
|
|
13
|
+
export const AnalysisRun = () => `${footprint3Prefix}/agent/internal/skills/analysis/run`;
|
|
14
|
+
export const FactorSearch = () => `${footprint3Prefix}/agent/internal/skills/factor/search`;
|
|
15
|
+
export const KnowledgeSearch = () => `${footprint3Prefix}/agent/internal/skills/knowledge/search`;
|
|
16
|
+
//# sourceMappingURL=apipath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apipath.js","sourceRoot":"","sources":["../src/apipath.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,KA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 @@
|
|
|
1
|
+
{"version":3,"file":"baseurl.js","sourceRoot":"","sources":["../src/baseurl.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,MAAM,CAAC,MAAM,cAAc,GAAW,0CAA0C,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Config } from "./config.js";
|
|
2
|
+
export declare class Client {
|
|
3
|
+
private config;
|
|
4
|
+
constructor(config: Config);
|
|
5
|
+
private request;
|
|
6
|
+
get(path: string, sessionId: string, query?: Record<string, string>): Promise<{
|
|
7
|
+
status: number;
|
|
8
|
+
body: string;
|
|
9
|
+
}>;
|
|
10
|
+
post(path: string, sessionId: string, jsonBody?: unknown): Promise<{
|
|
11
|
+
status: number;
|
|
12
|
+
body: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const userAgent = "carbonstop-agent-mcp/0.1.0";
|
|
2
|
+
const maxRetries = 3;
|
|
3
|
+
const baseBackoff = 1000;
|
|
4
|
+
export class Client {
|
|
5
|
+
config;
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
async request(method, path, sessionId, body, query) {
|
|
10
|
+
if (!path.startsWith("/"))
|
|
11
|
+
path = "/" + path;
|
|
12
|
+
const u = new URL(this.config.baseURL + path);
|
|
13
|
+
if (query) {
|
|
14
|
+
for (const [k, v] of Object.entries(query)) {
|
|
15
|
+
if (v)
|
|
16
|
+
u.searchParams.set(k, v);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
let lastErr = null;
|
|
20
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
21
|
+
if (attempt > 0) {
|
|
22
|
+
const backoff = Math.pow(2, attempt - 1) * baseBackoff;
|
|
23
|
+
await new Promise((r) => setTimeout(r, backoff));
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const headers = {
|
|
27
|
+
"X-Agent-Internal-Key": this.config.agentInternalKey,
|
|
28
|
+
"X-Agent-Session-Id": sessionId,
|
|
29
|
+
Accept: "application/json",
|
|
30
|
+
"User-Agent": userAgent,
|
|
31
|
+
};
|
|
32
|
+
if (body) {
|
|
33
|
+
headers["Content-Type"] = "application/json;charset=utf-8";
|
|
34
|
+
}
|
|
35
|
+
const resp = await fetch(u.toString(), {
|
|
36
|
+
method,
|
|
37
|
+
headers,
|
|
38
|
+
body,
|
|
39
|
+
signal: AbortSignal.timeout(this.config.timeout * 1000),
|
|
40
|
+
});
|
|
41
|
+
const text = await resp.text();
|
|
42
|
+
if (resp.status === 429 || resp.status >= 500) {
|
|
43
|
+
lastErr = new Error(`retryable server error: ${resp.status}`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
return { status: resp.status, body: text };
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
lastErr = e;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`request failed after ${maxRetries + 1} retries: ${lastErr?.message}`);
|
|
54
|
+
}
|
|
55
|
+
async get(path, sessionId, query) {
|
|
56
|
+
return this.request("GET", path, sessionId, undefined, query);
|
|
57
|
+
}
|
|
58
|
+
async post(path, sessionId, jsonBody) {
|
|
59
|
+
return this.request("POST", path, sessionId, JSON.stringify(jsonBody));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAC/C,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,MAAM,OAAO,MAAM;IACT,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,C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+
import { getBaseURL } from "./version.js";
|
|
2
|
+
export function load() {
|
|
3
|
+
const baseURL = process.env.CARBONSTOP_AGENT_BASE_URL ||
|
|
4
|
+
process.env.CARBONSTOP_BASE_URL ||
|
|
5
|
+
getBaseURL() ||
|
|
6
|
+
"";
|
|
7
|
+
const agentInternalKey = process.env.CARBONSTOP_AGENT_INTERNAL_KEY || "";
|
|
8
|
+
const parsedTimeout = parseInt(process.env.CARBONSTOP_TIMEOUT || "60", 10);
|
|
9
|
+
const timeout = Number.isFinite(parsedTimeout) && parsedTimeout > 0 ? parsedTimeout : 60;
|
|
10
|
+
return {
|
|
11
|
+
baseURL: baseURL.replace(/\/$/, ""),
|
|
12
|
+
agentInternalKey,
|
|
13
|
+
timeout,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1C,MAAM,UAAU,IAAI;IAClB,MAAM,OAAO,GACX,OAAO,CAAC,GAAG,CAAC,yBAAyB;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC/B,UAAU,EAAE;QACZ,EAAE,CAAC;IACL,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,EAAE,CAAC;IACzE,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzF,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACnC,gBAAgB;QAChB,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { load } from "./config.js";
|
|
5
|
+
import { Client } from "./client.js";
|
|
6
|
+
import { schemas, descriptions, toolRoutes, buildBody, getSessionId } from "./tools.js";
|
|
7
|
+
import { Version } from "./version.js";
|
|
8
|
+
const config = load();
|
|
9
|
+
if (!config.baseURL) {
|
|
10
|
+
console.error("[carbonstop-agent-mcp] CARBONSTOP_AGENT_BASE_URL is required");
|
|
11
|
+
process.exit(2);
|
|
12
|
+
}
|
|
13
|
+
if (!config.agentInternalKey) {
|
|
14
|
+
console.error("[carbonstop-agent-mcp] CARBONSTOP_AGENT_INTERNAL_KEY is required");
|
|
15
|
+
process.exit(2);
|
|
16
|
+
}
|
|
17
|
+
const server = new McpServer({
|
|
18
|
+
name: "carbonstop-agent-mcp",
|
|
19
|
+
version: Version,
|
|
20
|
+
});
|
|
21
|
+
const client = new Client(config);
|
|
22
|
+
function textContent(text) {
|
|
23
|
+
return { content: [{ type: "text", text }] };
|
|
24
|
+
}
|
|
25
|
+
function errorContent(text) {
|
|
26
|
+
return { content: [{ type: "text", text }], isError: true };
|
|
27
|
+
}
|
|
28
|
+
for (const [name, schema] of Object.entries(schemas)) {
|
|
29
|
+
if (!schema)
|
|
30
|
+
continue;
|
|
31
|
+
server.registerTool(name, {
|
|
32
|
+
description: descriptions[name] || "",
|
|
33
|
+
inputSchema: schema,
|
|
34
|
+
}, async (args) => {
|
|
35
|
+
const route = toolRoutes[name];
|
|
36
|
+
if (!route) {
|
|
37
|
+
return errorContent(`Unknown tool: ${name}`);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const sessionId = getSessionId(args);
|
|
41
|
+
const body = buildBody(route, args);
|
|
42
|
+
const result = await client.post(route.path, sessionId, body);
|
|
43
|
+
if (result.status < 200 || result.status >= 300) {
|
|
44
|
+
return errorContent(`HTTP ${result.status}\n${result.body}`);
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(result.body);
|
|
48
|
+
return textContent(JSON.stringify(parsed, null, 2));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return textContent(result.body);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
return errorContent(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const transport = new StdioServerTransport();
|
|
60
|
+
await server.connect(transport);
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC;AAEtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACpB,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IA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AAK,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAE9D,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBAChD,OAAO,YAAY,CAAC,QAAQ,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YAC/D,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACvC,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACtD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,YAAY,CACjB,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC7D,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const schemas: Record<string, z.ZodObject<any> | undefined>;
|
|
3
|
+
export declare const descriptions: Record<string, string>;
|
|
4
|
+
export type BodyKind = "agentSkill" | "sessionContext";
|
|
5
|
+
export interface ToolRoute {
|
|
6
|
+
method: "POST";
|
|
7
|
+
path: string;
|
|
8
|
+
bodyKind: BodyKind;
|
|
9
|
+
}
|
|
10
|
+
export declare const toolRoutes: Record<string, ToolRoute>;
|
|
11
|
+
export declare function buildBody(route: ToolRoute, args: Record<string, unknown>): Record<string, unknown>;
|
|
12
|
+
export declare function getSessionId(args: Record<string, unknown>): string;
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as apipath from "./apipath.js";
|
|
3
|
+
const jsonObject = z.record(z.string(), z.unknown());
|
|
4
|
+
const sessionId = z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1)
|
|
7
|
+
.describe("Agent session id. The caller must pass the sessionId received from the server-side Agent invocation.");
|
|
8
|
+
const idempotencyKey = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe("Idempotency key for write or high-risk skills. Reuse the same key only for retrying the same action.");
|
|
12
|
+
const traceFields = {
|
|
13
|
+
messageId: z.string().optional().describe("Agent message id for grouping multiple skill nodes in one turn."),
|
|
14
|
+
traceId: z.string().optional().describe("Agent trace id for runtime trace aggregation."),
|
|
15
|
+
taskId: z.string().optional().describe("Agent task id, for example LangGraph run id."),
|
|
16
|
+
};
|
|
17
|
+
const commonSkillFields = {
|
|
18
|
+
sessionId,
|
|
19
|
+
projectId: z.number().optional().describe("Agent project id"),
|
|
20
|
+
...traceFields,
|
|
21
|
+
accountId: z.number().optional().describe("Product carbon account id"),
|
|
22
|
+
modelId: z.number().optional().describe("Reserved model id"),
|
|
23
|
+
reportId: z.number().optional().describe("Report id"),
|
|
24
|
+
idempotencyKey: z.string().optional().describe("Required for write or high-risk skills"),
|
|
25
|
+
confirmed: z.boolean().optional().describe("Whether the user has confirmed a high-risk or high-cost action"),
|
|
26
|
+
pendingActionId: z.string().optional().describe("Pending action id returned by a confirmation response"),
|
|
27
|
+
};
|
|
28
|
+
const modelingInput = z.object({
|
|
29
|
+
content: z.string().optional().describe("Product description for AI modeling. Required by modeling_execute."),
|
|
30
|
+
message: z.string().optional().describe("Supplemental modeling information from the user or Agent."),
|
|
31
|
+
productName: z.string().optional().describe("Product name or short title."),
|
|
32
|
+
scope: z.union([z.number(), z.string()]).optional().describe("Lifecycle scope. Common values: 0 for partial lifecycle, 1 for full lifecycle."),
|
|
33
|
+
scopeValue: z.string().optional().describe("Lifecycle stage selection for partial lifecycle, for example 0,1,2."),
|
|
34
|
+
factorScope: z.number().optional().describe("Factor preference. Common values: 1 Ecoinvent, 2 domestic factors, 3 any source."),
|
|
35
|
+
userKeys: z.array(z.string()).optional().describe("User-selected custom factor keys."),
|
|
36
|
+
signKeys: z.array(z.string()).optional().describe("Marked factor keys."),
|
|
37
|
+
}).catchall(z.unknown());
|
|
38
|
+
const modelingExecuteInput = modelingInput.extend({
|
|
39
|
+
content: z.string().min(1).describe("Product description for AI modeling. Required by modeling_execute."),
|
|
40
|
+
message: z.string().optional().describe("Supplemental modeling information from the user or Agent."),
|
|
41
|
+
});
|
|
42
|
+
const modelUpdateInput = z.object({
|
|
43
|
+
accountId: z.number().optional().describe("Product carbon account id. Top-level accountId is preferred."),
|
|
44
|
+
userContent: z.string().optional().describe("Natural language update instruction, for example changing transport distance."),
|
|
45
|
+
message: z.string().optional().describe("Supplemental update information from the user or Agent."),
|
|
46
|
+
}).catchall(z.unknown());
|
|
47
|
+
const reportGenerateInput = z.object({
|
|
48
|
+
accountId: z.number().optional().describe("Product carbon account id. Top-level accountId is preferred."),
|
|
49
|
+
reportName: z.string().optional().describe("Report name to generate."),
|
|
50
|
+
standard: z.string().optional().describe("Report standard, for example ISO 14067."),
|
|
51
|
+
message: z.string().optional().describe("Supplemental report generation instruction from the user or Agent."),
|
|
52
|
+
}).catchall(z.unknown());
|
|
53
|
+
const analysisInput = z.object({
|
|
54
|
+
analysisType: z.string().describe("Analysis type, for example hotspot."),
|
|
55
|
+
message: z.string().optional().describe("Supplemental analysis instruction from the user or Agent."),
|
|
56
|
+
}).catchall(z.unknown());
|
|
57
|
+
const factorSearchInput = z.object({
|
|
58
|
+
query: z.string().min(1).describe("Factor search keyword, for example PET granules or electricity."),
|
|
59
|
+
unitName: z.string().optional().describe("Preferred unit name, for example kg or kWh."),
|
|
60
|
+
message: z.string().optional().describe("Supplemental factor matching context from the user or Agent."),
|
|
61
|
+
}).catchall(z.unknown());
|
|
62
|
+
const knowledgeSearchInput = z.object({
|
|
63
|
+
query: z.string().min(1).describe("Knowledge search question or keyword."),
|
|
64
|
+
message: z.string().optional().describe("Supplemental knowledge search context from the user or Agent."),
|
|
65
|
+
}).catchall(z.unknown());
|
|
66
|
+
export const schemas = {
|
|
67
|
+
session_context: z.object({
|
|
68
|
+
sessionId,
|
|
69
|
+
}),
|
|
70
|
+
project_memory_get: z.object({
|
|
71
|
+
sessionId,
|
|
72
|
+
projectId: z.number().optional(),
|
|
73
|
+
...traceFields,
|
|
74
|
+
input: jsonObject.optional(),
|
|
75
|
+
}),
|
|
76
|
+
project_memory_patch: z.object({
|
|
77
|
+
sessionId,
|
|
78
|
+
projectId: z.number().optional(),
|
|
79
|
+
...traceFields,
|
|
80
|
+
idempotencyKey,
|
|
81
|
+
input: jsonObject.describe("Memory patch payload"),
|
|
82
|
+
}),
|
|
83
|
+
project_memory_compress: z.object({
|
|
84
|
+
sessionId,
|
|
85
|
+
projectId: z.number().optional(),
|
|
86
|
+
...traceFields,
|
|
87
|
+
idempotencyKey,
|
|
88
|
+
input: jsonObject.describe("Compressed memory payload"),
|
|
89
|
+
}),
|
|
90
|
+
modeling_preview: z.object({
|
|
91
|
+
...commonSkillFields,
|
|
92
|
+
input: modelingInput,
|
|
93
|
+
}),
|
|
94
|
+
modeling_execute: z.object({
|
|
95
|
+
...commonSkillFields,
|
|
96
|
+
idempotencyKey,
|
|
97
|
+
input: modelingExecuteInput,
|
|
98
|
+
}),
|
|
99
|
+
modeling_update: z.object({
|
|
100
|
+
...commonSkillFields,
|
|
101
|
+
accountId: z.number().describe("Product carbon account id"),
|
|
102
|
+
idempotencyKey,
|
|
103
|
+
input: modelUpdateInput,
|
|
104
|
+
}),
|
|
105
|
+
modeling_detail: z.object({
|
|
106
|
+
sessionId,
|
|
107
|
+
projectId: z.number().optional(),
|
|
108
|
+
...traceFields,
|
|
109
|
+
accountId: z.number().describe("Product carbon account id"),
|
|
110
|
+
input: jsonObject.optional(),
|
|
111
|
+
}),
|
|
112
|
+
report_generate: z.object({
|
|
113
|
+
...commonSkillFields,
|
|
114
|
+
idempotencyKey,
|
|
115
|
+
input: reportGenerateInput.optional(),
|
|
116
|
+
}),
|
|
117
|
+
report_detail: z.object({
|
|
118
|
+
sessionId,
|
|
119
|
+
projectId: z.number().optional(),
|
|
120
|
+
...traceFields,
|
|
121
|
+
reportId: z.number().describe("Report id"),
|
|
122
|
+
input: jsonObject.optional(),
|
|
123
|
+
}),
|
|
124
|
+
analysis_run: z.object({
|
|
125
|
+
...commonSkillFields,
|
|
126
|
+
accountId: z.number().describe("Product carbon account id"),
|
|
127
|
+
input: analysisInput,
|
|
128
|
+
}),
|
|
129
|
+
factor_search: z.object({
|
|
130
|
+
sessionId,
|
|
131
|
+
projectId: z.number().optional(),
|
|
132
|
+
...traceFields,
|
|
133
|
+
accountId: z.number().optional(),
|
|
134
|
+
input: factorSearchInput,
|
|
135
|
+
}),
|
|
136
|
+
knowledge_search: z.object({
|
|
137
|
+
sessionId,
|
|
138
|
+
projectId: z.number().optional(),
|
|
139
|
+
...traceFields,
|
|
140
|
+
input: knowledgeSearchInput,
|
|
141
|
+
}),
|
|
142
|
+
};
|
|
143
|
+
export const descriptions = {
|
|
144
|
+
session_context: "Resolve session ownership and business context for an Agent session.",
|
|
145
|
+
project_memory_get: "Read project memory for the Agent session or project.",
|
|
146
|
+
project_memory_patch: "Patch project memory. Requires idempotencyKey.",
|
|
147
|
+
project_memory_compress: "Save compressed project memory. Requires idempotencyKey.",
|
|
148
|
+
modeling_preview: "Preview product carbon AI modeling before user confirmation.",
|
|
149
|
+
modeling_execute: "Execute product carbon AI modeling after confirmation. Requires idempotencyKey and input.content.",
|
|
150
|
+
modeling_update: "Update an existing product carbon model. Requires accountId and idempotencyKey.",
|
|
151
|
+
modeling_detail: "Get product carbon model details for an account.",
|
|
152
|
+
report_generate: "Generate a product carbon report. Requires idempotencyKey.",
|
|
153
|
+
report_detail: "Get product carbon report detail and latest report URL.",
|
|
154
|
+
analysis_run: "Run product carbon data analysis, such as hotspot analysis.",
|
|
155
|
+
factor_search: "Search and match carbon emission factors for Agent modeling.",
|
|
156
|
+
knowledge_search: "Search carbon knowledge for Agent answers.",
|
|
157
|
+
};
|
|
158
|
+
export const toolRoutes = {
|
|
159
|
+
session_context: {
|
|
160
|
+
method: "POST",
|
|
161
|
+
path: apipath.SessionContext(),
|
|
162
|
+
bodyKind: "sessionContext",
|
|
163
|
+
},
|
|
164
|
+
project_memory_get: {
|
|
165
|
+
method: "POST",
|
|
166
|
+
path: apipath.ProjectMemoryGet(),
|
|
167
|
+
bodyKind: "agentSkill",
|
|
168
|
+
},
|
|
169
|
+
project_memory_patch: {
|
|
170
|
+
method: "POST",
|
|
171
|
+
path: apipath.ProjectMemoryPatch(),
|
|
172
|
+
bodyKind: "agentSkill",
|
|
173
|
+
},
|
|
174
|
+
project_memory_compress: {
|
|
175
|
+
method: "POST",
|
|
176
|
+
path: apipath.ProjectMemoryCompress(),
|
|
177
|
+
bodyKind: "agentSkill",
|
|
178
|
+
},
|
|
179
|
+
modeling_preview: {
|
|
180
|
+
method: "POST",
|
|
181
|
+
path: apipath.ModelingPreview(),
|
|
182
|
+
bodyKind: "agentSkill",
|
|
183
|
+
},
|
|
184
|
+
modeling_execute: {
|
|
185
|
+
method: "POST",
|
|
186
|
+
path: apipath.ModelingExecute(),
|
|
187
|
+
bodyKind: "agentSkill",
|
|
188
|
+
},
|
|
189
|
+
modeling_update: {
|
|
190
|
+
method: "POST",
|
|
191
|
+
path: apipath.ModelingUpdate(),
|
|
192
|
+
bodyKind: "agentSkill",
|
|
193
|
+
},
|
|
194
|
+
modeling_detail: {
|
|
195
|
+
method: "POST",
|
|
196
|
+
path: apipath.ModelingDetail(),
|
|
197
|
+
bodyKind: "agentSkill",
|
|
198
|
+
},
|
|
199
|
+
report_generate: {
|
|
200
|
+
method: "POST",
|
|
201
|
+
path: apipath.ReportGenerate(),
|
|
202
|
+
bodyKind: "agentSkill",
|
|
203
|
+
},
|
|
204
|
+
report_detail: {
|
|
205
|
+
method: "POST",
|
|
206
|
+
path: apipath.ReportDetail(),
|
|
207
|
+
bodyKind: "agentSkill",
|
|
208
|
+
},
|
|
209
|
+
analysis_run: {
|
|
210
|
+
method: "POST",
|
|
211
|
+
path: apipath.AnalysisRun(),
|
|
212
|
+
bodyKind: "agentSkill",
|
|
213
|
+
},
|
|
214
|
+
factor_search: {
|
|
215
|
+
method: "POST",
|
|
216
|
+
path: apipath.FactorSearch(),
|
|
217
|
+
bodyKind: "agentSkill",
|
|
218
|
+
},
|
|
219
|
+
knowledge_search: {
|
|
220
|
+
method: "POST",
|
|
221
|
+
path: apipath.KnowledgeSearch(),
|
|
222
|
+
bodyKind: "agentSkill",
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
export function buildBody(route, args) {
|
|
226
|
+
if (route.bodyKind === "sessionContext") {
|
|
227
|
+
return { sessionId: args.sessionId };
|
|
228
|
+
}
|
|
229
|
+
return args;
|
|
230
|
+
}
|
|
231
|
+
export function getSessionId(args) {
|
|
232
|
+
const value = args.sessionId;
|
|
233
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
234
|
+
throw new Error("sessionId is required");
|
|
235
|
+
}
|
|
236
|
+
return value;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;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,EAAE,MAAM;QACd,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE;QAC5B,QAAQ,EAAE,YAAY;KACvB;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO,CAAC,eAAe,EAAE;QAC/B,QAAQ,EAAE,YAAY;KACvB;CACF,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,KAAgB,EAAE,IAA6B;IACvE,IAAI,KAAK,CAAC,QAAQ,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAA6B;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { encodedBaseURL } from "./baseurl.js";
|
|
2
|
+
export function getBaseURL() {
|
|
3
|
+
if (!encodedBaseURL)
|
|
4
|
+
return "";
|
|
5
|
+
// If it already looks like a URL, return as-is (dev / env override).
|
|
6
|
+
if (encodedBaseURL.includes("://"))
|
|
7
|
+
return encodedBaseURL;
|
|
8
|
+
// Release builds: base64-encoded to hide from strings/grep.
|
|
9
|
+
try {
|
|
10
|
+
return Buffer.from(encodedBaseURL, "base64").toString("utf-8");
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export const Version = "0.1.0";
|
|
17
|
+
export const Commit = "none";
|
|
18
|
+
export const BuildTime = "unknown";
|
|
19
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,UAAU,UAAU;IACxB,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAC/B,qEAAqE;IACrE,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,cAAc,CAAC;IAC1D,4DAA4D;IAC5D,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC;AAC7B,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@carbonstopper/agent-mcp",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "MCP server for Carbonstop Agent internal skill APIs",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"carbonstop-agent-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/carbonstop-hub/carbonstop-agent-mcp.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/carbonstop-hub/carbonstop-agent-mcp#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/carbonstop-hub/carbonstop-agent-mcp/issues"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"AGENTS.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prebuild": "node scripts/build.cjs",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"start": "node dist/index.js",
|
|
27
|
+
"dev": "tsx src/index.ts",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"carbon-footprint",
|
|
33
|
+
"carbonstop",
|
|
34
|
+
"agent",
|
|
35
|
+
"model-context-protocol"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
40
|
+
"zod": "^4.3.6"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^22.0.0",
|
|
44
|
+
"tsx": "^4.0.0",
|
|
45
|
+
"typescript": "^5.0.0"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18"
|
|
49
|
+
}
|
|
50
|
+
}
|