@great-detail/support-mcp 0.1.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/dist/cli.js +2 -0
- package/package.json +47 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{McpServer as p}from"@modelcontextprotocol/sdk/server/mcp.js";import a,{SDK_VERSION as u,SupportError as l}from"@great-detail/support-sdk";import{z as c}from"zod";var m=new a.BasicAuthentication,s=new a(m),o=new p({name:"support",version:u,capabilities:{resources:{},tools:{}}});o.tool("get_contacts","Get a list of contacts",{},async()=>{let t=await s.contact.list().json();return t.data.length<=0?{content:[{type:"text",text:"No contacts could be found"}]}:{content:t.data.map(({contact:e})=>({type:"text",text:e.name??""}))}});o.tool("create_contact","Create a new contact",{type:c.enum(["consumer","assistant","representative"]).optional().default("consumer"),name:c.string().min(1)},async({type:t,name:e})=>{let n;try{n=await s.contact.create({body:{type:t,name:e}}).json()}catch(r){return r instanceof l?{content:[{type:"text",text:"Contact could not be created: "+(await r.response.json()).error.title}]}:{content:[{type:"text",text:"Contact could not be created"}]}}return{content:[{type:"text",text:"New contact created with id: "+n.data.contact.id}]}});var i=o;import{StdioServerTransport as d}from"@modelcontextprotocol/sdk/server/stdio.js";try{let t=new d;await i.connect(t),console.log("GD Support MCP Server running on stdio")}catch(t){console.error("Fatal error in main():",t),process.exit(1)}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@great-detail/support-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "MCP Server for the Great Detail Support System",
|
|
6
|
+
"author": "Great Detail Ltd <info@greatdetail.com>",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Dom Webber <dom.webber@hotmail.com>",
|
|
9
|
+
"Great Detail Ltd <info@greatdetail.com>"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"support-mcp": "dist/cli.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"MCP"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@great-detail/support-sdk": "",
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.16.0",
|
|
27
|
+
"zod": "^4.0.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@great-detail/eslint-config": "^1.1.0",
|
|
31
|
+
"@types/node": "^24.1.0",
|
|
32
|
+
"cobertura": "^1.0.3",
|
|
33
|
+
"publint": "^0.3.12",
|
|
34
|
+
"tsup": "^8.5.0",
|
|
35
|
+
"tsx": "^4.19.4",
|
|
36
|
+
"typescript": "^5.8.3"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"provenance": false
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup src/entrypoint/cli.ts --format esm --minify",
|
|
44
|
+
"test": "node --import tsx --test --experimental-test-coverage src/__tests__/**/*.test.ts src/__tests__/*.test.ts",
|
|
45
|
+
"typecheck": "tsc --noEmit"
|
|
46
|
+
}
|
|
47
|
+
}
|