@dotlab-hq/vector-store-mcp 1.0.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 +225 -0
- package/dist/client.d.ts +11 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/index.d.ts +492 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +300 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +99 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio.d.ts +3 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +30 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tools/files.d.ts +9 -0
- package/dist/tools/files.d.ts.map +1 -0
- package/dist/tools/files.js +153 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/index.d.ts +40 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +47 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/upload-file.d.ts +20 -0
- package/dist/tools/upload-file.d.ts.map +1 -0
- package/dist/tools/upload-file.js +60 -0
- package/dist/tools/upload-file.js.map +1 -0
- package/dist/tools/vector-stores.d.ts +8 -0
- package/dist/tools/vector-stores.d.ts.map +1 -0
- package/dist/tools/vector-stores.js +267 -0
- package/dist/tools/vector-stores.js.map +1 -0
- package/dist/tools/vs-file-batches.d.ts +8 -0
- package/dist/tools/vs-file-batches.d.ts.map +1 -0
- package/dist/tools/vs-file-batches.js +157 -0
- package/dist/tools/vs-file-batches.js.map +1 -0
- package/dist/tools/vs-files.d.ts +8 -0
- package/dist/tools/vs-files.d.ts.map +1 -0
- package/dist/tools/vs-files.js +222 -0
- package/dist/tools/vs-files.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ──────────────────────────────────────────────
|
|
3
|
+
// Shared Enums
|
|
4
|
+
// ──────────────────────────────────────────────
|
|
5
|
+
export const ResponseFormat = {
|
|
6
|
+
MARKDOWN: "markdown",
|
|
7
|
+
JSON: "json",
|
|
8
|
+
};
|
|
9
|
+
export const SortOrder = {
|
|
10
|
+
ASC: "asc",
|
|
11
|
+
DESC: "desc",
|
|
12
|
+
};
|
|
13
|
+
export const FileStatus = {
|
|
14
|
+
IN_PROGRESS: "in_progress",
|
|
15
|
+
COMPLETED: "completed",
|
|
16
|
+
FAILED: "failed",
|
|
17
|
+
CANCELLED: "cancelled",
|
|
18
|
+
};
|
|
19
|
+
// ──────────────────────────────────────────────
|
|
20
|
+
// Vector Store Schemas
|
|
21
|
+
// ──────────────────────────────────────────────
|
|
22
|
+
export const CreateVectorStoreSchema = z.object({
|
|
23
|
+
name: z.string().min(1).max(256).describe("The name of the vector store."),
|
|
24
|
+
file_ids: z
|
|
25
|
+
.array(z.string())
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("A list of File IDs that the vector store should use. Useful for tools like `file_search`."),
|
|
28
|
+
expires_after: z
|
|
29
|
+
.object({
|
|
30
|
+
anchor: z.literal("last_active_at"),
|
|
31
|
+
days: z.number().int().min(1).max(365),
|
|
32
|
+
})
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("The expiration policy for the vector store."),
|
|
35
|
+
metadata: z
|
|
36
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Set of 16 key-value pairs attached to the object. Keys max 64 chars, values max 512 chars."),
|
|
39
|
+
chunking_strategy: z
|
|
40
|
+
.object({
|
|
41
|
+
type: z.union([z.literal("auto"), z.literal("static")]),
|
|
42
|
+
static: z
|
|
43
|
+
.object({
|
|
44
|
+
max_chunk_size_tokens: z.number().int().min(100).max(4096).default(800),
|
|
45
|
+
chunk_overlap_tokens: z.number().int().min(0).default(400),
|
|
46
|
+
})
|
|
47
|
+
.optional(),
|
|
48
|
+
})
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Chunking strategy for files. Default is auto (800 tokens, 400 overlap)."),
|
|
51
|
+
});
|
|
52
|
+
export const UpdateVectorStoreSchema = z.object({
|
|
53
|
+
vector_store_id: z.string().describe("The ID of the vector store to modify."),
|
|
54
|
+
name: z.string().min(1).max(256).optional().describe("The new name of the vector store."),
|
|
55
|
+
expires_after: z
|
|
56
|
+
.object({
|
|
57
|
+
anchor: z.literal("last_active_at"),
|
|
58
|
+
days: z.number().int().min(1).max(365),
|
|
59
|
+
})
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("New expiration policy for the vector store."),
|
|
62
|
+
metadata: z
|
|
63
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Updated set of 16 key-value pairs attached to the object."),
|
|
66
|
+
});
|
|
67
|
+
export const RetrieveVectorStoreSchema = z.object({
|
|
68
|
+
vector_store_id: z.string().describe("The ID of the vector store to retrieve."),
|
|
69
|
+
});
|
|
70
|
+
export const DeleteVectorStoreSchema = z.object({
|
|
71
|
+
vector_store_id: z.string().describe("The ID of the vector store to delete."),
|
|
72
|
+
});
|
|
73
|
+
export const ListVectorStoresSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
after: z
|
|
76
|
+
.string()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("Cursor for pagination. Pass the ID of the last object."),
|
|
79
|
+
before: z
|
|
80
|
+
.string()
|
|
81
|
+
.optional()
|
|
82
|
+
.describe("Cursor for pagination. Pass the ID of the first object."),
|
|
83
|
+
limit: z
|
|
84
|
+
.number()
|
|
85
|
+
.int()
|
|
86
|
+
.min(1)
|
|
87
|
+
.max(100)
|
|
88
|
+
.default(20)
|
|
89
|
+
.describe("Maximum number of vector stores to return (1–100, default 20)."),
|
|
90
|
+
order: z
|
|
91
|
+
.nativeEnum(SortOrder)
|
|
92
|
+
.default(SortOrder.DESC)
|
|
93
|
+
.describe("Sort order by created_at timestamp."),
|
|
94
|
+
response_format: z
|
|
95
|
+
.nativeEnum(ResponseFormat)
|
|
96
|
+
.default(ResponseFormat.MARKDOWN)
|
|
97
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable."),
|
|
98
|
+
})
|
|
99
|
+
.strict();
|
|
100
|
+
export const SearchVectorStoreSchema = z.object({
|
|
101
|
+
vector_store_id: z.string().describe("The ID of the vector store to search."),
|
|
102
|
+
query: z
|
|
103
|
+
.union([z.string(), z.array(z.string())])
|
|
104
|
+
.describe("A query string or array of query strings for search."),
|
|
105
|
+
max_num_results: z
|
|
106
|
+
.number()
|
|
107
|
+
.int()
|
|
108
|
+
.min(1)
|
|
109
|
+
.max(50)
|
|
110
|
+
.default(10)
|
|
111
|
+
.describe("Maximum number of results to return (1–50, default 10)."),
|
|
112
|
+
rewrite_query: z
|
|
113
|
+
.boolean()
|
|
114
|
+
.default(false)
|
|
115
|
+
.describe("Whether to rewrite the query for better search results."),
|
|
116
|
+
filters: z
|
|
117
|
+
.object({
|
|
118
|
+
type: z.union([
|
|
119
|
+
z.literal("eq"),
|
|
120
|
+
z.literal("ne"),
|
|
121
|
+
z.literal("gt"),
|
|
122
|
+
z.literal("gte"),
|
|
123
|
+
z.literal("lt"),
|
|
124
|
+
z.literal("lte"),
|
|
125
|
+
z.literal("in"),
|
|
126
|
+
z.literal("nin"),
|
|
127
|
+
]),
|
|
128
|
+
key: z.string().describe("Attribute key to compare."),
|
|
129
|
+
value: z
|
|
130
|
+
.union([z.string(), z.number(), z.boolean(), z.array(z.string())])
|
|
131
|
+
.describe("Value to compare against."),
|
|
132
|
+
})
|
|
133
|
+
.optional()
|
|
134
|
+
.describe("Filter to apply based on file attributes."),
|
|
135
|
+
response_format: z
|
|
136
|
+
.nativeEnum(ResponseFormat)
|
|
137
|
+
.default(ResponseFormat.MARKDOWN)
|
|
138
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable."),
|
|
139
|
+
});
|
|
140
|
+
// ──────────────────────────────────────────────
|
|
141
|
+
// File Schemas (Global)
|
|
142
|
+
// ──────────────────────────────────────────────
|
|
143
|
+
export const ListFilesSchema = z
|
|
144
|
+
.object({
|
|
145
|
+
after: z.string().optional().describe("Cursor for pagination."),
|
|
146
|
+
limit: z
|
|
147
|
+
.number()
|
|
148
|
+
.int()
|
|
149
|
+
.min(1)
|
|
150
|
+
.max(10000)
|
|
151
|
+
.default(10000)
|
|
152
|
+
.describe("Maximum number of files to return (1–10000, default 10000)."),
|
|
153
|
+
order: z
|
|
154
|
+
.nativeEnum(SortOrder)
|
|
155
|
+
.default(SortOrder.DESC)
|
|
156
|
+
.describe("Sort order by created_at timestamp."),
|
|
157
|
+
purpose: z.string().optional().describe("Only return files with the given purpose."),
|
|
158
|
+
response_format: z
|
|
159
|
+
.nativeEnum(ResponseFormat)
|
|
160
|
+
.default(ResponseFormat.MARKDOWN)
|
|
161
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable."),
|
|
162
|
+
})
|
|
163
|
+
.strict();
|
|
164
|
+
export const RetrieveFileSchema = z.object({
|
|
165
|
+
file_id: z.string().describe("The ID of the file to retrieve."),
|
|
166
|
+
});
|
|
167
|
+
export const DeleteFileSchema = z.object({
|
|
168
|
+
file_id: z.string().describe("The ID of the file to delete."),
|
|
169
|
+
});
|
|
170
|
+
export const RetrieveFileContentSchema = z.object({
|
|
171
|
+
file_id: z.string().describe("The ID of the file whose content to retrieve."),
|
|
172
|
+
});
|
|
173
|
+
// ──────────────────────────────────────────────
|
|
174
|
+
// Vector Store File Schemas
|
|
175
|
+
// ──────────────────────────────────────────────
|
|
176
|
+
export const CreateVectorStoreFileSchema = z.object({
|
|
177
|
+
vector_store_id: z.string().describe("The ID of the vector store to attach the file to."),
|
|
178
|
+
file_id: z.string().describe("The ID of the previously uploaded file."),
|
|
179
|
+
attributes: z
|
|
180
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
181
|
+
.optional()
|
|
182
|
+
.describe("Up to 16 key-value pairs for filtering and search."),
|
|
183
|
+
chunking_strategy: z
|
|
184
|
+
.object({
|
|
185
|
+
type: z.union([z.literal("auto"), z.literal("static")]),
|
|
186
|
+
static: z
|
|
187
|
+
.object({
|
|
188
|
+
max_chunk_size_tokens: z.number().int().min(100).max(4096).default(800),
|
|
189
|
+
chunk_overlap_tokens: z.number().int().min(0).default(400),
|
|
190
|
+
})
|
|
191
|
+
.optional(),
|
|
192
|
+
})
|
|
193
|
+
.optional()
|
|
194
|
+
.describe("Chunking strategy for the file."),
|
|
195
|
+
});
|
|
196
|
+
export const ListVectorStoreFilesSchema = z
|
|
197
|
+
.object({
|
|
198
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
199
|
+
after: z.string().optional().describe("Cursor for pagination."),
|
|
200
|
+
before: z.string().optional().describe("Cursor for pagination."),
|
|
201
|
+
filter: z
|
|
202
|
+
.nativeEnum(FileStatus)
|
|
203
|
+
.optional()
|
|
204
|
+
.describe("Filter by file status."),
|
|
205
|
+
limit: z
|
|
206
|
+
.number()
|
|
207
|
+
.int()
|
|
208
|
+
.min(1)
|
|
209
|
+
.max(100)
|
|
210
|
+
.default(20)
|
|
211
|
+
.describe("Maximum number of files to return (1–100, default 20)."),
|
|
212
|
+
order: z
|
|
213
|
+
.nativeEnum(SortOrder)
|
|
214
|
+
.default(SortOrder.DESC)
|
|
215
|
+
.describe("Sort order by created_at timestamp."),
|
|
216
|
+
response_format: z
|
|
217
|
+
.nativeEnum(ResponseFormat)
|
|
218
|
+
.default(ResponseFormat.MARKDOWN)
|
|
219
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable."),
|
|
220
|
+
})
|
|
221
|
+
.strict();
|
|
222
|
+
export const RetrieveVectorStoreFileSchema = z.object({
|
|
223
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
224
|
+
file_id: z.string().describe("The ID of the vector store file to retrieve."),
|
|
225
|
+
});
|
|
226
|
+
export const DeleteVectorStoreFileSchema = z.object({
|
|
227
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
228
|
+
file_id: z.string().describe("The ID of the vector store file to delete."),
|
|
229
|
+
});
|
|
230
|
+
export const RetrieveVectorStoreFileContentSchema = z.object({
|
|
231
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
232
|
+
file_id: z.string().describe("The ID of the vector store file whose content to retrieve."),
|
|
233
|
+
});
|
|
234
|
+
export const UpdateVectorStoreFileAttributesSchema = z.object({
|
|
235
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
236
|
+
file_id: z.string().describe("The ID of the vector store file to update."),
|
|
237
|
+
attributes: z
|
|
238
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
239
|
+
.nullable()
|
|
240
|
+
.describe("Updated set of up to 16 key-value pairs, or null to clear attributes."),
|
|
241
|
+
});
|
|
242
|
+
// ──────────────────────────────────────────────
|
|
243
|
+
// Vector Store File Batch Schemas
|
|
244
|
+
// ──────────────────────────────────────────────
|
|
245
|
+
export const CreateVectorStoreFileBatchSchema = z.object({
|
|
246
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
247
|
+
file_ids: z.array(z.string()).min(1).describe("A list of File IDs to attach."),
|
|
248
|
+
attributes: z
|
|
249
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
250
|
+
.optional()
|
|
251
|
+
.describe("Up to 16 key-value pairs for filtering and search."),
|
|
252
|
+
chunking_strategy: z
|
|
253
|
+
.object({
|
|
254
|
+
type: z.union([z.literal("auto"), z.literal("static")]),
|
|
255
|
+
static: z
|
|
256
|
+
.object({
|
|
257
|
+
max_chunk_size_tokens: z.number().int().min(100).max(4096).default(800),
|
|
258
|
+
chunk_overlap_tokens: z.number().int().min(0).default(400),
|
|
259
|
+
})
|
|
260
|
+
.optional(),
|
|
261
|
+
})
|
|
262
|
+
.optional()
|
|
263
|
+
.describe("Chunking strategy for the files."),
|
|
264
|
+
});
|
|
265
|
+
export const RetrieveVectorStoreFileBatchSchema = z.object({
|
|
266
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
267
|
+
batch_id: z.string().describe("The ID of the file batch to retrieve."),
|
|
268
|
+
});
|
|
269
|
+
export const CancelVectorStoreFileBatchSchema = z.object({
|
|
270
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
271
|
+
batch_id: z.string().describe("The ID of the file batch to cancel."),
|
|
272
|
+
});
|
|
273
|
+
export const ListVectorStoreFileBatchFilesSchema = z
|
|
274
|
+
.object({
|
|
275
|
+
vector_store_id: z.string().describe("The ID of the vector store."),
|
|
276
|
+
batch_id: z.string().describe("The ID of the file batch."),
|
|
277
|
+
after: z.string().optional().describe("Cursor for pagination."),
|
|
278
|
+
before: z.string().optional().describe("Cursor for pagination."),
|
|
279
|
+
filter: z
|
|
280
|
+
.nativeEnum(FileStatus)
|
|
281
|
+
.optional()
|
|
282
|
+
.describe("Filter by file status."),
|
|
283
|
+
limit: z
|
|
284
|
+
.number()
|
|
285
|
+
.int()
|
|
286
|
+
.min(1)
|
|
287
|
+
.max(100)
|
|
288
|
+
.default(20)
|
|
289
|
+
.describe("Maximum number of files to return (1–100, default 20)."),
|
|
290
|
+
order: z
|
|
291
|
+
.nativeEnum(SortOrder)
|
|
292
|
+
.default(SortOrder.DESC)
|
|
293
|
+
.describe("Sort order by created_at timestamp."),
|
|
294
|
+
response_format: z
|
|
295
|
+
.nativeEnum(ResponseFormat)
|
|
296
|
+
.default(ResponseFormat.MARKDOWN)
|
|
297
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable."),
|
|
298
|
+
})
|
|
299
|
+
.strict();
|
|
300
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,E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/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vector Store MCP Server — Streamable HTTP transport.
|
|
3
|
+
*
|
|
4
|
+
* This entry point starts an HTTP server that exposes the MCP tools
|
|
5
|
+
* over the Streamable HTTP protocol (stateless JSON mode).
|
|
6
|
+
*
|
|
7
|
+
* Environment variables:
|
|
8
|
+
* OPENAI_API_KEY (required) — Your OpenAI API key.
|
|
9
|
+
* OPENAI_API_BASE (optional) — Custom OpenAI-compatible base URL.
|
|
10
|
+
* PORT (optional) — HTTP port (default: 3000).
|
|
11
|
+
* HOST (optional) — Bind host (default: 127.0.0.1).
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
15
|
+
import { registerAllTools } from "./tools/index.js";
|
|
16
|
+
import http from "node:http";
|
|
17
|
+
const PORT = Number(process.env["PORT"] ?? 3000);
|
|
18
|
+
const HOST = process.env["HOST"] ?? "127.0.0.1";
|
|
19
|
+
function readBody(req) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const chunks = [];
|
|
22
|
+
req.on("data", (chunk) => chunks.push(chunk));
|
|
23
|
+
req.on("end", () => {
|
|
24
|
+
const raw = Buffer.concat(chunks).toString();
|
|
25
|
+
if (!raw) {
|
|
26
|
+
resolve(undefined);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
resolve(JSON.parse(raw));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
resolve(undefined);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
req.on("error", reject);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function main() {
|
|
40
|
+
const server = http.createServer(async (req, res) => {
|
|
41
|
+
// CORS headers
|
|
42
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
43
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
44
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Accept, Mcp-Session-Id");
|
|
45
|
+
res.setHeader("Access-Control-Expose-Headers", "Mcp-Session-Id");
|
|
46
|
+
if (req.method === "OPTIONS") {
|
|
47
|
+
res.writeHead(204);
|
|
48
|
+
res.end();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Health check
|
|
52
|
+
if (req.method === "GET" && req.url === "/health") {
|
|
53
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
54
|
+
res.end(JSON.stringify({ status: "ok", service: "vector-store-mcp" }));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// MCP endpoint
|
|
58
|
+
if (req.url === "/mcp") {
|
|
59
|
+
const mcpServer = new McpServer({
|
|
60
|
+
name: "vector-store-mcp",
|
|
61
|
+
version: "1.0.0",
|
|
62
|
+
});
|
|
63
|
+
registerAllTools(mcpServer);
|
|
64
|
+
const transport = new StreamableHTTPServerTransport({
|
|
65
|
+
sessionIdGenerator: undefined, // stateless mode
|
|
66
|
+
enableJsonResponse: true,
|
|
67
|
+
});
|
|
68
|
+
res.on("close", () => {
|
|
69
|
+
transport.close().catch(() => { });
|
|
70
|
+
mcpServer.close().catch(() => { });
|
|
71
|
+
});
|
|
72
|
+
try {
|
|
73
|
+
await mcpServer.connect(transport);
|
|
74
|
+
const body = await readBody(req);
|
|
75
|
+
await transport.handleRequest(req, res, body);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (!res.headersSent) {
|
|
79
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
80
|
+
res.end(JSON.stringify({ error: String(error) }));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// 404
|
|
86
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
87
|
+
res.end(JSON.stringify({ error: "Not found. Use POST /mcp or GET /health" }));
|
|
88
|
+
});
|
|
89
|
+
server.listen(PORT, HOST, () => {
|
|
90
|
+
console.log(`[vector-store-mcp] HTTP server listening on http://${HOST}:${PORT}`);
|
|
91
|
+
console.log(`[vector-store-mcp] MCP endpoint: http://${HOST}:${PORT}/mcp`);
|
|
92
|
+
console.log(`[vector-store-mcp] Health check: http://${HOST}:${PORT}/health`);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
main().catch((error) => {
|
|
96
|
+
console.error(`[vector-store-mcp] Fatal error:`, error);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;AACjD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC;AAEhD,SAAS,QAAQ,CAAC,GAAyB;IACzC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAA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AAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM;QACN,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAC3D,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,sDAAsD,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,2CAA2C,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,IAAI,IAAI,SAAS,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/stdio.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":""}
|
package/dist/stdio.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Vector Store MCP Server — stdio transport (local, no server).
|
|
4
|
+
*
|
|
5
|
+
* This entry point is used when running as a local MCP server via stdio,
|
|
6
|
+
* e.g. as a subprocess of Claude Desktop, VS Code Copilot, or any
|
|
7
|
+
* MCP-compatible client.
|
|
8
|
+
*
|
|
9
|
+
* Environment variables:
|
|
10
|
+
* OPENAI_API_KEY (required) — Your OpenAI API key.
|
|
11
|
+
* OPENAI_API_BASE (optional) — Custom OpenAI-compatible base URL.
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { registerAllTools } from "./tools/index.js";
|
|
16
|
+
async function main() {
|
|
17
|
+
const server = new McpServer({
|
|
18
|
+
name: "vector-store-mcp",
|
|
19
|
+
version: "1.0.0",
|
|
20
|
+
});
|
|
21
|
+
registerAllTools(server);
|
|
22
|
+
const transport = new StdioServerTransport();
|
|
23
|
+
await server.connect(transport);
|
|
24
|
+
process.stderr.write("[vector-store-mcp] Server started via stdio transport.\n");
|
|
25
|
+
}
|
|
26
|
+
main().catch((error) => {
|
|
27
|
+
process.stderr.write(`[vector-store-mcp] Fatal error: ${error}\n`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=stdio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../src/stdio.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AACnF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,KAAK,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI File tools for MCP (global file management).
|
|
3
|
+
*
|
|
4
|
+
* Covers: list, retrieve, delete files, and retrieve file content.
|
|
5
|
+
* Note: Upload (create) requires multipart — see file creation tool in VS files module.
|
|
6
|
+
*/
|
|
7
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
export declare function registerFileTools(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/tools/files.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA2BpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmJzD"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { getClient } from "../client.js";
|
|
2
|
+
import { ListFilesSchema, RetrieveFileSchema, DeleteFileSchema, RetrieveFileContentSchema, } from "../schemas/index.js";
|
|
3
|
+
function formatFile(f, format) {
|
|
4
|
+
if (format === "json")
|
|
5
|
+
return JSON.stringify(f, null, 2);
|
|
6
|
+
const lines = [
|
|
7
|
+
`### File: ${f.filename ?? "Unknown"}`,
|
|
8
|
+
"",
|
|
9
|
+
`- **ID**: \`${f.id}\``,
|
|
10
|
+
`- **Object**: ${f.object}`,
|
|
11
|
+
`- **Bytes**: ${f.bytes}`,
|
|
12
|
+
`- **Purpose**: ${f.purpose}`,
|
|
13
|
+
`- **Created**: ${new Date(f.created_at * 1000).toISOString()}`,
|
|
14
|
+
];
|
|
15
|
+
if (f.status)
|
|
16
|
+
lines.push(`- **Status**: ${f.status}`);
|
|
17
|
+
if (f.status_details)
|
|
18
|
+
lines.push(`- **Status Details**: ${f.status_details}`);
|
|
19
|
+
lines.push("");
|
|
20
|
+
return lines.join("\n");
|
|
21
|
+
}
|
|
22
|
+
export function registerFileTools(server) {
|
|
23
|
+
server.registerTool("openai_list_files", {
|
|
24
|
+
title: "List Files",
|
|
25
|
+
description: `List all files in your OpenAI project with pagination and optional purpose filter.
|
|
26
|
+
|
|
27
|
+
Returns metadata about each uploaded file including its ID, filename, size, purpose, and creation timestamp. Use the 'purpose' parameter to filter by type (e.g., "assistants", "fine-tune", "batch").`,
|
|
28
|
+
inputSchema: ListFilesSchema.shape,
|
|
29
|
+
annotations: {
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
idempotentHint: true,
|
|
33
|
+
openWorldHint: true,
|
|
34
|
+
},
|
|
35
|
+
}, async (params) => {
|
|
36
|
+
try {
|
|
37
|
+
const client = getClient();
|
|
38
|
+
const page = await client.files.list({
|
|
39
|
+
after: params.after,
|
|
40
|
+
limit: params.limit,
|
|
41
|
+
order: params.order,
|
|
42
|
+
purpose: params.purpose,
|
|
43
|
+
});
|
|
44
|
+
const data = page.data;
|
|
45
|
+
const format = params.response_format;
|
|
46
|
+
if (format === "json") {
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: JSON.stringify({ total: data.length, files: data }, null, 2) }],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const lines = [
|
|
52
|
+
`# Files (${data.length} results)`,
|
|
53
|
+
"",
|
|
54
|
+
];
|
|
55
|
+
for (const f of data) {
|
|
56
|
+
lines.push(formatFile(f, "markdown"));
|
|
57
|
+
}
|
|
58
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return {
|
|
62
|
+
isError: true,
|
|
63
|
+
content: [{ type: "text", text: `Error listing files: ${error instanceof Error ? error.message : String(error)}` }],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
server.registerTool("openai_retrieve_file", {
|
|
68
|
+
title: "Retrieve File",
|
|
69
|
+
description: `Retrieve metadata about a specific file by its ID, including filename, size, purpose, and status.`,
|
|
70
|
+
inputSchema: RetrieveFileSchema.shape,
|
|
71
|
+
annotations: {
|
|
72
|
+
readOnlyHint: true,
|
|
73
|
+
destructiveHint: false,
|
|
74
|
+
idempotentHint: true,
|
|
75
|
+
openWorldHint: true,
|
|
76
|
+
},
|
|
77
|
+
}, async (params) => {
|
|
78
|
+
try {
|
|
79
|
+
const client = getClient();
|
|
80
|
+
const file = await client.files.retrieve(params.file_id);
|
|
81
|
+
return {
|
|
82
|
+
content: [{ type: "text", text: formatFile(file, "json") }],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
isError: true,
|
|
88
|
+
content: [{ type: "text", text: `Error retrieving file: ${error instanceof Error ? error.message : String(error)}` }],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
server.registerTool("openai_delete_file", {
|
|
93
|
+
title: "Delete File",
|
|
94
|
+
description: `Permanently delete a file and remove it from all vector stores.
|
|
95
|
+
|
|
96
|
+
This action cannot be undone. The file will be deleted from OpenAI's storage.`,
|
|
97
|
+
inputSchema: DeleteFileSchema.shape,
|
|
98
|
+
annotations: {
|
|
99
|
+
readOnlyHint: false,
|
|
100
|
+
destructiveHint: true,
|
|
101
|
+
idempotentHint: true,
|
|
102
|
+
openWorldHint: true,
|
|
103
|
+
},
|
|
104
|
+
}, async (params) => {
|
|
105
|
+
try {
|
|
106
|
+
const client = getClient();
|
|
107
|
+
const result = await client.files.del(params.file_id);
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
return {
|
|
114
|
+
isError: true,
|
|
115
|
+
content: [{ type: "text", text: `Error deleting file: ${error instanceof Error ? error.message : String(error)}` }],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
server.registerTool("openai_retrieve_file_content", {
|
|
120
|
+
title: "Retrieve File Content",
|
|
121
|
+
description: `Retrieve the raw content of a file by its ID.
|
|
122
|
+
|
|
123
|
+
Returns the file content as-is (text, JSON, JSONL, etc. depending on the file type). For large files, consider using the file's metadata first to check its size.`,
|
|
124
|
+
inputSchema: RetrieveFileContentSchema.shape,
|
|
125
|
+
annotations: {
|
|
126
|
+
readOnlyHint: true,
|
|
127
|
+
destructiveHint: false,
|
|
128
|
+
idempotentHint: true,
|
|
129
|
+
openWorldHint: true,
|
|
130
|
+
},
|
|
131
|
+
}, async (params) => {
|
|
132
|
+
try {
|
|
133
|
+
const client = getClient();
|
|
134
|
+
const response = await client.files.content(params.file_id);
|
|
135
|
+
const text = await response.text();
|
|
136
|
+
// Truncate if very large
|
|
137
|
+
const maxLen = 50000;
|
|
138
|
+
const display = text.length > maxLen
|
|
139
|
+
? text.substring(0, maxLen) + `\n\n... [truncated, ${text.length} total chars]`
|
|
140
|
+
: text;
|
|
141
|
+
return {
|
|
142
|
+
content: [{ type: "text", text: display }],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return {
|
|
147
|
+
isError: true,
|
|
148
|
+
content: [{ type: "text", text: `Error retrieving file content: ${error instanceof Error ? error.message : String(error)}` }],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|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