@lexmanh/shed-mcp-server 0.2.0-beta.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/server.js +59 -0
- package/package.json +35 -0
package/dist/server.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/server.ts
|
|
4
|
+
import { executeToolCall } from "@lexmanh/shed-agent";
|
|
5
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
var server = new McpServer({
|
|
9
|
+
name: "shed",
|
|
10
|
+
version: "0.0.0"
|
|
11
|
+
});
|
|
12
|
+
server.tool(
|
|
13
|
+
"list_projects",
|
|
14
|
+
"List all detected projects under a given path. Returns project type, path, last-modified date, and total cleanable size. Read-only.",
|
|
15
|
+
{
|
|
16
|
+
root: z.string().describe("Absolute path to scan from"),
|
|
17
|
+
maxDepth: z.number().optional().default(5).describe("Max directory depth")
|
|
18
|
+
},
|
|
19
|
+
async ({ root, maxDepth }) => {
|
|
20
|
+
const result = await executeToolCall("list_projects", { root, maxDepth });
|
|
21
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
server.tool(
|
|
25
|
+
"analyze_project",
|
|
26
|
+
"Get detailed analysis of a single project: all cleanable items, risk tiers, git status, last activity. Read-only.",
|
|
27
|
+
{
|
|
28
|
+
path: z.string().describe("Absolute path to the project root")
|
|
29
|
+
},
|
|
30
|
+
async ({ path }) => {
|
|
31
|
+
const result = await executeToolCall("analyze_project", { path });
|
|
32
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
server.tool(
|
|
36
|
+
"estimate_cleanup",
|
|
37
|
+
"Estimate space freed by cleaning a set of items. Runs safety checks and returns what would be allowed vs skipped. Read-only \u2014 never deletes anything.",
|
|
38
|
+
{
|
|
39
|
+
itemIds: z.array(z.string()).describe("Item IDs from list_projects or analyze_project"),
|
|
40
|
+
includeRed: z.boolean().optional().default(false).describe("Include Red-tier items")
|
|
41
|
+
},
|
|
42
|
+
async ({ itemIds, includeRed }) => {
|
|
43
|
+
const result = await executeToolCall("estimate_cleanup", { itemIds, includeRed });
|
|
44
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
server.tool(
|
|
48
|
+
"get_disk_usage",
|
|
49
|
+
"Get current disk usage on the user machine (free / used / total).",
|
|
50
|
+
{
|
|
51
|
+
path: z.string().optional().describe("Path to check (defaults to home directory)")
|
|
52
|
+
},
|
|
53
|
+
async ({ path }) => {
|
|
54
|
+
const result = await executeToolCall("get_disk_usage", { path });
|
|
55
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
var transport = new StdioServerTransport();
|
|
59
|
+
await server.connect(transport);
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lexmanh/shed-mcp-server",
|
|
3
|
+
"version": "0.2.0-beta.1",
|
|
4
|
+
"description": "MCP server for Shed — exposes disk scan and analysis tools to Claude Desktop and Claude Code",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"shed-mcp": "./dist/server.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/server.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
15
|
+
"zod": "^4.3.6",
|
|
16
|
+
"@lexmanh/shed-core": "^0.2.0-beta.1",
|
|
17
|
+
"@lexmanh/shed-agent": "^0.2.0-beta.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^22.10.0",
|
|
21
|
+
"tsup": "^8.3.0",
|
|
22
|
+
"typescript": "^5.7.0",
|
|
23
|
+
"vitest": "^2.1.0"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsup src/server.ts --format esm --clean",
|
|
30
|
+
"dev": "tsup src/server.ts --format esm --watch",
|
|
31
|
+
"test": "vitest run --passWithNoTests",
|
|
32
|
+
"test:watch": "vitest",
|
|
33
|
+
"typecheck": "tsc --noEmit"
|
|
34
|
+
}
|
|
35
|
+
}
|