@cloudgrid-io/mcp 0.3.0 → 0.3.1
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/package.json +1 -1
- package/src/index.js +4 -1
- package/src/web.js +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudgrid-io/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "MCP server for CloudGrid. Two editions: a local stdio server (full toolset) and a hosted web server (light, CLI-free toolset) over MCP Streamable HTTP.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// Desktop). Full toolset, including the CLI-wrapping tools. Identity comes from
|
|
6
6
|
// the shared ~/.cloudgrid/credentials file, so it interoperates with the CLI.
|
|
7
7
|
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
8
9
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
10
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
11
|
import { registerTools } from "./tools.js";
|
|
@@ -15,6 +16,8 @@ import {
|
|
|
15
16
|
credentialsPath,
|
|
16
17
|
} from "./auth.js";
|
|
17
18
|
|
|
19
|
+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url)));
|
|
20
|
+
|
|
18
21
|
const ctx = {
|
|
19
22
|
edition: "local",
|
|
20
23
|
state: { pendingLoginCode: null, lastAnonClaim: null, lastDrop: null, anonCookie: null },
|
|
@@ -25,7 +28,7 @@ const ctx = {
|
|
|
25
28
|
savedLocationNote: () => `Credentials saved to ${credentialsPath()}.`,
|
|
26
29
|
};
|
|
27
30
|
|
|
28
|
-
const server = new McpServer({ name: "cloudgrid-mcp", version
|
|
31
|
+
const server = new McpServer({ name: "cloudgrid-mcp", version });
|
|
29
32
|
registerTools(server, ctx);
|
|
30
33
|
|
|
31
34
|
const transport = new StdioServerTransport();
|
package/src/web.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
//
|
|
15
15
|
// Run: PORT=8080 node src/web.js Health: GET /healthz
|
|
16
16
|
|
|
17
|
+
import { readFileSync } from "node:fs";
|
|
17
18
|
import { randomUUID } from "node:crypto";
|
|
18
19
|
import express from "express";
|
|
19
20
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -22,6 +23,8 @@ import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
|
22
23
|
import { registerTools, decodeJwt } from "./tools.js";
|
|
23
24
|
import { mountOAuth, bearerChallenge } from "./oauth.js";
|
|
24
25
|
|
|
26
|
+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url)));
|
|
27
|
+
|
|
25
28
|
const PORT = Number(process.env.PORT || 8080);
|
|
26
29
|
|
|
27
30
|
// This server's public origin — used in OAuth metadata and the interstitial.
|
|
@@ -128,7 +131,7 @@ app.post("/mcp", async (req, res) => {
|
|
|
128
131
|
delete sessionAuth[transport.sessionId];
|
|
129
132
|
}
|
|
130
133
|
};
|
|
131
|
-
const server = new McpServer({ name: "cloudgrid-mcp-web", version
|
|
134
|
+
const server = new McpServer({ name: "cloudgrid-mcp-web", version });
|
|
132
135
|
registerTools(server, makeWebContext(newSessionId));
|
|
133
136
|
await server.connect(transport);
|
|
134
137
|
await transport.handleRequest(req, res, req.body);
|