@autonomys/auto-mcp-servers 0.1.1 → 0.1.2
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 +8 -2
- package/dist/auto-drive/handlers.d.ts.map +1 -1
- package/dist/auto-drive/handlers.js +2 -3
- package/dist/auto-drive/index.d.ts.map +1 -1
- package/dist/auto-drive/index.js +1 -1
- package/package.json +1 -1
- package/src/auto-drive/handlers.ts +8 -3
- package/src/auto-drive/index.ts +1 -2
package/README.md
CHANGED
|
@@ -12,7 +12,9 @@ The Auto Drive server exposes functionality from the `@autonomys/auto-drive` pac
|
|
|
12
12
|
|
|
13
13
|
The Auto Drive server provides the following tools:
|
|
14
14
|
|
|
15
|
-
- `
|
|
15
|
+
- `upload-object`: Upload an object (as JSON data) to the Autonomys network.
|
|
16
|
+
- `download-object`: Download a text-based object (`text/*` or `application/json`) from the Autonomys network using its CID.
|
|
17
|
+
- `search-objects`: Search for objects on the Autonomys network by name or CID fragment. Returns a JSON object containing an array of results, each including the object's name, CID, type, size, and mimeType (for files).
|
|
16
18
|
|
|
17
19
|
More servers and tools will be coming soon!
|
|
18
20
|
|
|
@@ -29,7 +31,11 @@ More servers and tools will be coming soon!
|
|
|
29
31
|
"auto-drive": {
|
|
30
32
|
"command": "npx",
|
|
31
33
|
"args": ["-y", "@autonomys/auto-mcp-servers", "auto-drive"],
|
|
32
|
-
"env": {
|
|
34
|
+
"env": {
|
|
35
|
+
"AUTO_DRIVE_API_KEY": "your-api-key",
|
|
36
|
+
"ENCRYPTION_PASSWORD": "my-password (optional)",
|
|
37
|
+
"NETWORK": "mainnet or taurus (optional, defaults to mainnet)"
|
|
38
|
+
}
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/auto-drive/handlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAEnE,eAAO,MAAM,uBAAuB,GAClC,QAAQ,MAAM,EACd,SAAS,QAAQ,GAAG,SAAS,EAC7B,qBAAqB,MAAM;+CAWtB;QACD,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC1B,KAAG,OAAO,CAAC,cAAc,CAAC;qCAIY;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,cAAc,CAAC;sCAsExC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/auto-drive/handlers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAEnE,eAAO,MAAM,uBAAuB,GAClC,QAAQ,MAAM,EACd,SAAS,QAAQ,GAAG,SAAS,EAC7B,qBAAqB,MAAM;+CAWtB;QACD,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAC1B,KAAG,OAAO,CAAC,cAAc,CAAC;qCAIY;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,cAAc,CAAC;sCAsExC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,cAAc,CAAC;CActF,CAAA"}
|
|
@@ -108,10 +108,9 @@ export const createAutoDriveHandlers = (apiKey, network, encryptionPassword) =>
|
|
|
108
108
|
}),
|
|
109
109
|
searchObjectsHandler: (_a) => __awaiter(void 0, [_a], void 0, function* ({ query }) {
|
|
110
110
|
const summaries = yield autoDriveApi.searchByNameOrCID(query);
|
|
111
|
+
const results = summaries.map((s) => (Object.assign({ name: s.name, cid: s.headCid, type: s.type, size: s.size }, (s.type === 'file' && { mimeType: s.mimeType }))));
|
|
111
112
|
return {
|
|
112
|
-
content: [
|
|
113
|
-
{ type: 'text', text: `Objects found: ${summaries.map((s) => s.name).join(', ')}` },
|
|
114
|
-
],
|
|
113
|
+
content: [{ type: 'text', text: JSON.stringify({ results }, null, 2) }],
|
|
115
114
|
};
|
|
116
115
|
}),
|
|
117
116
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auto-drive/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auto-drive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAgBnE,eAAO,MAAM,eAAe,WAA0D,CAAA"}
|
package/dist/auto-drive/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const AUTO_DRIVE_API_KEY = (_a = process.env.AUTO_DRIVE_API_KEY) !== null && _a
|
|
|
17
17
|
const NETWORK = process.env.NETWORK === 'taurus' ? 'taurus' : 'mainnet';
|
|
18
18
|
const ENCRYPTION_PASSWORD = process.env.ENCRYPTION_PASSWORD;
|
|
19
19
|
const { uploadObjectHandler, downloadObjectHandler, searchObjectsHandler } = createAutoDriveHandlers(AUTO_DRIVE_API_KEY, NETWORK, ENCRYPTION_PASSWORD);
|
|
20
|
-
export const autoDriveServer = new McpServer({ name: 'Auto Drive', version: '0.1.
|
|
20
|
+
export const autoDriveServer = new McpServer({ name: 'Auto Drive', version: '0.1.2' });
|
|
21
21
|
autoDriveServer.tool('upload-object', 'Upload an object permanently to the Autonomys Network using Auto Drive, any objects uploaded here will be permanently available onchain. This is useful for storing data that you want to keep forever.', {
|
|
22
22
|
filename: z.string().describe('The filename to save the object as.'),
|
|
23
23
|
data: z.record(z.string(), z.any()).describe(`
|
package/package.json
CHANGED
|
@@ -95,10 +95,15 @@ export const createAutoDriveHandlers = (
|
|
|
95
95
|
},
|
|
96
96
|
searchObjectsHandler: async ({ query }: { query: string }): Promise<CallToolResult> => {
|
|
97
97
|
const summaries = await autoDriveApi.searchByNameOrCID(query)
|
|
98
|
+
const results = summaries.map((s) => ({
|
|
99
|
+
name: s.name,
|
|
100
|
+
cid: s.headCid,
|
|
101
|
+
type: s.type,
|
|
102
|
+
size: s.size,
|
|
103
|
+
...(s.type === 'file' && { mimeType: s.mimeType }),
|
|
104
|
+
}))
|
|
98
105
|
return {
|
|
99
|
-
content: [
|
|
100
|
-
{ type: 'text', text: `Objects found: ${summaries.map((s) => s.name).join(', ')}` },
|
|
101
|
-
],
|
|
106
|
+
content: [{ type: 'text', text: JSON.stringify({ results }, null, 2) }],
|
|
102
107
|
}
|
|
103
108
|
},
|
|
104
109
|
}
|
package/src/auto-drive/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createAutoDriveApi } from '@autonomys/auto-drive'
|
|
2
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
3
2
|
import { CallToolResult } from '@modelcontextprotocol/sdk/types.js'
|
|
4
3
|
import { z } from 'zod'
|
|
@@ -15,7 +14,7 @@ const ENCRYPTION_PASSWORD = process.env.ENCRYPTION_PASSWORD
|
|
|
15
14
|
const { uploadObjectHandler, downloadObjectHandler, searchObjectsHandler } =
|
|
16
15
|
createAutoDriveHandlers(AUTO_DRIVE_API_KEY, NETWORK, ENCRYPTION_PASSWORD)
|
|
17
16
|
|
|
18
|
-
export const autoDriveServer = new McpServer({ name: 'Auto Drive', version: '0.1.
|
|
17
|
+
export const autoDriveServer = new McpServer({ name: 'Auto Drive', version: '0.1.2' })
|
|
19
18
|
|
|
20
19
|
autoDriveServer.tool(
|
|
21
20
|
'upload-object',
|