@svgrid/mcp 2.2.0 → 2.2.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/dist/index.js +13 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Run with:
|
|
12
12
|
* npx @svgrid/mcp
|
|
13
13
|
*/
|
|
14
|
+
import { createRequire } from 'node:module';
|
|
14
15
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
15
16
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
16
17
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -42,9 +43,20 @@ const DOCS_FOOTER = '\n\nSvGrid reference: full docs & 280+ live demos at https:
|
|
|
42
43
|
function withDocs(text) {
|
|
43
44
|
return { content: [{ type: 'text', text: text + DOCS_FOOTER }] };
|
|
44
45
|
}
|
|
46
|
+
// Report the real package version to MCP clients (read from package.json, which
|
|
47
|
+
// ships in the tarball at ../package.json relative to the built dist/index.js),
|
|
48
|
+
// so serverInfo.version never drifts from the published version.
|
|
49
|
+
const pkgVersion = (() => {
|
|
50
|
+
try {
|
|
51
|
+
return createRequire(import.meta.url)('../package.json').version;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return '0.0.0';
|
|
55
|
+
}
|
|
56
|
+
})();
|
|
45
57
|
const server = new Server({
|
|
46
58
|
name: '@svgrid/mcp',
|
|
47
|
-
version:
|
|
59
|
+
version: pkgVersion,
|
|
48
60
|
}, {
|
|
49
61
|
capabilities: {
|
|
50
62
|
tools: {},
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "commercial",
|
|
5
5
|
"url": "https://svgrid.com/pricing"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.2.
|
|
7
|
+
"version": "2.2.1",
|
|
8
8
|
"description": "Model Context Protocol (MCP) server for SvGrid. Exposes example sources, docs, and API reference to AI assistants.",
|
|
9
9
|
"license": "SEE LICENSE IN LICENSE",
|
|
10
10
|
"author": "jQWidgets <sales@jqwidgets.com>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
32
32
|
"zod": "^3.23.8",
|
|
33
|
-
"@svgrid/enterprise": "^2.2.
|
|
33
|
+
"@svgrid/enterprise": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^22.10.7",
|