mcp-erp 1.0.6
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 +107 -0
- package/docs.md +1425 -0
- package/index.js +70 -0
- package/package.json +40 -0
package/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// import { readFileSync, existsSync } from "node:fs";
|
|
3
|
+
// import { fileURLToPath } from "node:url";
|
|
4
|
+
// import { dirname, join } from "node:path";
|
|
5
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
|
+
|
|
8
|
+
// const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
// const DOCS_PATH = join(__dirname, "docs.md");
|
|
10
|
+
|
|
11
|
+
// ================================================================================================================= //
|
|
12
|
+
// INITIALIZE MCP SERVER
|
|
13
|
+
// ================================================================================================================= //
|
|
14
|
+
const server = new McpServer(
|
|
15
|
+
{
|
|
16
|
+
name: "mcp-erps",
|
|
17
|
+
version: "1.0.1",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
capabilities: {
|
|
21
|
+
tools: { listChanged: true },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// ================================================================================================================= //
|
|
27
|
+
// TOOLS
|
|
28
|
+
// ================================================================================================================= //
|
|
29
|
+
|
|
30
|
+
const contentResult = (text) => ({
|
|
31
|
+
content: [{ type: "text", text }],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
server.registerTool(
|
|
35
|
+
"fetch_docs",
|
|
36
|
+
{
|
|
37
|
+
title: "Fetch Query Documentation",
|
|
38
|
+
inputSchema: undefined,
|
|
39
|
+
description:
|
|
40
|
+
"Fetch documentation about GraphQL query and sample response from ERSPO Shopify CMS (docs.md).",
|
|
41
|
+
},
|
|
42
|
+
async () => {
|
|
43
|
+
// if (!existsSync(DOCS_PATH)) {
|
|
44
|
+
// return contentResult(`Error: docs.md not found at ${DOCS_PATH}`);
|
|
45
|
+
// }
|
|
46
|
+
// const docs = readFileSync(DOCS_PATH, "utf-8");
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: "Hello, world! You connected me",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// ================================================================================================================= //
|
|
59
|
+
// START SERVER
|
|
60
|
+
// ================================================================================================================= //
|
|
61
|
+
async function main() {
|
|
62
|
+
const transport = new StdioServerTransport();
|
|
63
|
+
await server.connect(transport);
|
|
64
|
+
// Notify client that tools are available (helps Cursor/Claude detect tools)
|
|
65
|
+
server.sendToolListChanged();
|
|
66
|
+
}
|
|
67
|
+
main().catch((err) => {
|
|
68
|
+
console.error("[mcp-erps]", err);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-erp",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "MCP server: GraphQL Storefront query documentation for ERSP Shopify CMS (fetch_docs from docs.md)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mcp-erps": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node index.js",
|
|
12
|
+
"test": "node test-client.js",
|
|
13
|
+
"test:client": "node test-client.js",
|
|
14
|
+
"dev": "node index.js"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"shopify",
|
|
20
|
+
"graphql",
|
|
21
|
+
"storefront",
|
|
22
|
+
"erspo",
|
|
23
|
+
"cms",
|
|
24
|
+
"documentation"
|
|
25
|
+
],
|
|
26
|
+
"author": "Laskar",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/laskar-ksatria/mcp-erp.git"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"index.js",
|
|
34
|
+
"docs.md"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.20.1",
|
|
38
|
+
"dotenv": "^16.3.1"
|
|
39
|
+
}
|
|
40
|
+
}
|