@allourthings/mcp-server 0.2.0 → 0.3.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/index.js +85 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11168,6 +11168,15 @@ class NativeBackend {
|
|
|
11168
11168
|
async searchItems(query) {
|
|
11169
11169
|
return this.store.searchItems(query);
|
|
11170
11170
|
}
|
|
11171
|
+
async addAttachment(itemId, filename, kind, data, label) {
|
|
11172
|
+
return this.store.addAttachment(itemId, filename, kind, data, label ?? null);
|
|
11173
|
+
}
|
|
11174
|
+
async getAttachment(itemId, filename) {
|
|
11175
|
+
return this.store.getAttachment(itemId, filename);
|
|
11176
|
+
}
|
|
11177
|
+
async deleteAttachment(itemId, filename) {
|
|
11178
|
+
return this.store.deleteAttachment(itemId, filename);
|
|
11179
|
+
}
|
|
11171
11180
|
}
|
|
11172
11181
|
|
|
11173
11182
|
// ../../node_modules/zod/v3/external.js
|
|
@@ -17913,6 +17922,61 @@ ${summary}` }]
|
|
|
17913
17922
|
};
|
|
17914
17923
|
}
|
|
17915
17924
|
|
|
17925
|
+
// src/tools/add-attachment.ts
|
|
17926
|
+
var addAttachmentInputSchema = exports_external.object({
|
|
17927
|
+
item_id: exports_external.string().describe("ID of the item to attach the file to"),
|
|
17928
|
+
filename: exports_external.string().describe("Filename to store the attachment as (e.g. manual.pdf)"),
|
|
17929
|
+
kind: exports_external.enum(["manual", "receipt", "photo", "warranty", "other"]).describe("Type of attachment"),
|
|
17930
|
+
data_base64: exports_external.string().describe("Base64-encoded file contents"),
|
|
17931
|
+
label: exports_external.string().optional().describe("Human-readable label (e.g. 'Washing machine manual')")
|
|
17932
|
+
});
|
|
17933
|
+
async function addAttachment(backend, input) {
|
|
17934
|
+
const data = Buffer.from(input.data_base64, "base64");
|
|
17935
|
+
const item = await backend.addAttachment(input.item_id, input.filename, input.kind, data, input.label);
|
|
17936
|
+
return {
|
|
17937
|
+
content: [
|
|
17938
|
+
{
|
|
17939
|
+
type: "text",
|
|
17940
|
+
text: JSON.stringify(item, null, 2)
|
|
17941
|
+
}
|
|
17942
|
+
]
|
|
17943
|
+
};
|
|
17944
|
+
}
|
|
17945
|
+
|
|
17946
|
+
// src/tools/get-attachment.ts
|
|
17947
|
+
var getAttachmentInputSchema = exports_external.object({
|
|
17948
|
+
item_id: exports_external.string().describe("ID of the item"),
|
|
17949
|
+
filename: exports_external.string().describe("Filename of the attachment to retrieve")
|
|
17950
|
+
});
|
|
17951
|
+
async function getAttachment(backend, input) {
|
|
17952
|
+
const data = await backend.getAttachment(input.item_id, input.filename);
|
|
17953
|
+
return {
|
|
17954
|
+
content: [
|
|
17955
|
+
{
|
|
17956
|
+
type: "text",
|
|
17957
|
+
text: data.toString("base64")
|
|
17958
|
+
}
|
|
17959
|
+
]
|
|
17960
|
+
};
|
|
17961
|
+
}
|
|
17962
|
+
|
|
17963
|
+
// src/tools/delete-attachment.ts
|
|
17964
|
+
var deleteAttachmentInputSchema = exports_external.object({
|
|
17965
|
+
item_id: exports_external.string().describe("ID of the item"),
|
|
17966
|
+
filename: exports_external.string().describe("Filename of the attachment to delete")
|
|
17967
|
+
});
|
|
17968
|
+
async function deleteAttachment(backend, input) {
|
|
17969
|
+
const item = await backend.deleteAttachment(input.item_id, input.filename);
|
|
17970
|
+
return {
|
|
17971
|
+
content: [
|
|
17972
|
+
{
|
|
17973
|
+
type: "text",
|
|
17974
|
+
text: item ? JSON.stringify(item, null, 2) : "Attachment deleted (item not found)"
|
|
17975
|
+
}
|
|
17976
|
+
]
|
|
17977
|
+
};
|
|
17978
|
+
}
|
|
17979
|
+
|
|
17916
17980
|
// src/server.ts
|
|
17917
17981
|
function createServer(backend) {
|
|
17918
17982
|
const server = new Server({ name: "allourthings", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
@@ -17947,6 +18011,21 @@ function createServer(backend) {
|
|
|
17947
18011
|
name: "search_items",
|
|
17948
18012
|
description: "Full-text search across all item fields",
|
|
17949
18013
|
inputSchema: zodToJsonSchema(searchItemsInputSchema)
|
|
18014
|
+
},
|
|
18015
|
+
{
|
|
18016
|
+
name: "add_attachment",
|
|
18017
|
+
description: "Attach a file (manual, receipt, photo, warranty, etc.) to an item. File contents must be base64-encoded.",
|
|
18018
|
+
inputSchema: zodToJsonSchema(addAttachmentInputSchema)
|
|
18019
|
+
},
|
|
18020
|
+
{
|
|
18021
|
+
name: "get_attachment",
|
|
18022
|
+
description: "Retrieve an attachment's contents as a base64-encoded string",
|
|
18023
|
+
inputSchema: zodToJsonSchema(getAttachmentInputSchema)
|
|
18024
|
+
},
|
|
18025
|
+
{
|
|
18026
|
+
name: "delete_attachment",
|
|
18027
|
+
description: "Delete an attachment from an item",
|
|
18028
|
+
inputSchema: zodToJsonSchema(deleteAttachmentInputSchema)
|
|
17950
18029
|
}
|
|
17951
18030
|
]
|
|
17952
18031
|
}));
|
|
@@ -17965,6 +18044,12 @@ function createServer(backend) {
|
|
|
17965
18044
|
return deleteItem(backend, deleteItemInputSchema.parse(args));
|
|
17966
18045
|
case "search_items":
|
|
17967
18046
|
return searchItems(backend, searchItemsInputSchema.parse(args));
|
|
18047
|
+
case "add_attachment":
|
|
18048
|
+
return addAttachment(backend, addAttachmentInputSchema.parse(args));
|
|
18049
|
+
case "get_attachment":
|
|
18050
|
+
return getAttachment(backend, getAttachmentInputSchema.parse(args));
|
|
18051
|
+
case "delete_attachment":
|
|
18052
|
+
return deleteAttachment(backend, deleteAttachmentInputSchema.parse(args));
|
|
17968
18053
|
default:
|
|
17969
18054
|
throw new Error(`Unknown tool: ${name}`);
|
|
17970
18055
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allourthings/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"mcpName": "io.allourthings/mcp-server",
|
|
5
5
|
"description": "MCP server for All Our Things — AI-powered household inventory",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
27
|
-
"@allourthings/core": "^0.1.
|
|
27
|
+
"@allourthings/core": "^0.1.10",
|
|
28
28
|
"zod": "^3.24.0",
|
|
29
29
|
"zod-to-json-schema": "^3.25.1"
|
|
30
30
|
},
|