bach-box-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/README.md +28 -0
- package/index.js +98 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# bach-box-mcp
|
|
2
|
+
|
|
3
|
+
Mock Box content MCP server. List folders, search and fetch document content.
|
|
4
|
+
|
|
5
|
+
> **Note:** This is a MOCK MCP server by **bachstudio**. It returns sample/fake data and does not connect to Box. Intended for prototyping and demos.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
- `list_folder` — List items in a folder
|
|
10
|
+
- `search_files` — Search files by keyword
|
|
11
|
+
- `get_file` — Get extracted text of a file
|
|
12
|
+
|
|
13
|
+
## Usage (stdio MCP)
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"box": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "bach-box-mcp"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## License
|
|
27
|
+
|
|
28
|
+
MIT © bachstudio
|
package/index.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
|
|
6
|
+
const TOOLS = [
|
|
7
|
+
{
|
|
8
|
+
"name": "list_folder",
|
|
9
|
+
"description": "List items in a folder",
|
|
10
|
+
"inputSchema": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"folder_id": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"result": {
|
|
19
|
+
"folder": "Contracts",
|
|
20
|
+
"items": [
|
|
21
|
+
{
|
|
22
|
+
"id": "f1",
|
|
23
|
+
"name": "Acme_MSA.pdf"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "f2",
|
|
27
|
+
"name": "Acme_DPA.pdf"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "search_files",
|
|
34
|
+
"description": "Search files by keyword",
|
|
35
|
+
"inputSchema": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"properties": {
|
|
38
|
+
"query": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": [
|
|
43
|
+
"query"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"result": {
|
|
47
|
+
"results": [
|
|
48
|
+
{
|
|
49
|
+
"id": "f1",
|
|
50
|
+
"name": "Acme_MSA.pdf",
|
|
51
|
+
"path": "/Contracts/Acme_MSA.pdf"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "get_file",
|
|
58
|
+
"description": "Get extracted text of a file",
|
|
59
|
+
"inputSchema": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"file_id": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"file_id"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"result": {
|
|
71
|
+
"id": "f1",
|
|
72
|
+
"name": "Acme_MSA.pdf",
|
|
73
|
+
"text": "MASTER SERVICES AGREEMENT ... Term: 24 months ... Liability cap: 12 months fees ..."
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
const server = new Server(
|
|
79
|
+
{ name: "bach-box-mcp", version: "0.1.0" },
|
|
80
|
+
{ capabilities: { tools: {} } }
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
84
|
+
tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
88
|
+
const tool = TOOLS.find((t) => t.name === req.params.name);
|
|
89
|
+
if (!tool) {
|
|
90
|
+
return { isError: true, content: [{ type: "text", text: "Unknown tool: " + req.params.name }] };
|
|
91
|
+
}
|
|
92
|
+
const payload = { tool: tool.name, args: req.params.arguments || {}, data: tool.result, _note: "MOCK DATA from Box (mock)" };
|
|
93
|
+
return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const transport = new StdioServerTransport();
|
|
97
|
+
await server.connect(transport);
|
|
98
|
+
console.error("Box (mock)" + " MCP server (mock) running on stdio");
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bach-box-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Mock Box content MCP server. List folders, search and fetch document content.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"bach-box-mcp": "index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=18"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"mcp",
|
|
19
|
+
"modelcontextprotocol",
|
|
20
|
+
"bach",
|
|
21
|
+
"bachstudio",
|
|
22
|
+
"mock",
|
|
23
|
+
"box"
|
|
24
|
+
],
|
|
25
|
+
"author": "bachstudio",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
29
|
+
}
|
|
30
|
+
}
|