@pairsystems/goodmem-mcp 0.1.8 → 0.1.9
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 +41 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21023,7 +21023,7 @@ async function callApi(method, path, body, query) {
|
|
|
21023
21023
|
}
|
|
21024
21024
|
return resp.text();
|
|
21025
21025
|
}
|
|
21026
|
-
async function callApiNdjson(method, path, body, query) {
|
|
21026
|
+
async function callApiNdjson(method, path, body, query, timeoutSec) {
|
|
21027
21027
|
if (!isConfigured()) {
|
|
21028
21028
|
throw new Error("GoodMem is not configured. Call the goodmem_configure tool first with your base_url and api_key, or set GOODMEM_BASE_URL and GOODMEM_API_KEY environment variables.");
|
|
21029
21029
|
}
|
|
@@ -21042,7 +21042,7 @@ async function callApiNdjson(method, path, body, query) {
|
|
|
21042
21042
|
const resp = await fetch(url.toString(), {
|
|
21043
21043
|
method,
|
|
21044
21044
|
headers,
|
|
21045
|
-
signal: AbortSignal.timeout(
|
|
21045
|
+
signal: AbortSignal.timeout((timeoutSec ?? 200) * 1e3),
|
|
21046
21046
|
...body ? { body: JSON.stringify(body) } : {}
|
|
21047
21047
|
});
|
|
21048
21048
|
if (!resp.ok) {
|
|
@@ -21920,7 +21920,7 @@ function autoInferFromRegistry(registryType, args) {
|
|
|
21920
21920
|
}
|
|
21921
21921
|
var server = new McpServer({
|
|
21922
21922
|
name: "goodmem",
|
|
21923
|
-
version: "0.1.
|
|
21923
|
+
version: "0.1.9"
|
|
21924
21924
|
});
|
|
21925
21925
|
server.tool("goodmem_configure", "Configure GoodMem server connection. Call this before using other GoodMem tools if GOODMEM_BASE_URL and GOODMEM_API_KEY environment variables are not set. Session credentials override environment variables.", {
|
|
21926
21926
|
base_url: external_exports.string().describe("GoodMem server URL (e.g., https://your-server.example.com)"),
|
|
@@ -21944,7 +21944,12 @@ server.tool("goodmem_configure", "Configure GoodMem server connection. Call this
|
|
|
21944
21944
|
const info = await resp.json();
|
|
21945
21945
|
return { content: [{ type: "text", text: `Connected to GoodMem at ${goodmemBaseUrl}. Server version: ${info.version ?? "unknown"}.` }] };
|
|
21946
21946
|
} catch (err) {
|
|
21947
|
-
|
|
21947
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
21948
|
+
let hint = "Check your base_url.";
|
|
21949
|
+
if (msg.includes("CERT") || msg.includes("certificate") || msg.includes("self-signed") || msg.includes("self signed") || msg.includes("UNABLE_TO_VERIFY")) {
|
|
21950
|
+
hint = "TLS certificate error. If using self-signed certs, set NODE_TLS_REJECT_UNAUTHORIZED=0 (dev only) or NODE_EXTRA_CA_CERTS=/path/to/rootCA.pem in your MCP server env config.";
|
|
21951
|
+
}
|
|
21952
|
+
return { content: [{ type: "text", text: `Could not connect to ${args.base_url}: ${msg}. Credentials were NOT saved. ${hint}` }] };
|
|
21948
21953
|
}
|
|
21949
21954
|
});
|
|
21950
21955
|
server.tool("goodmem_lookup_model", "Look up a model in the registry to see its provider, endpoint, dimensions, and other auto-inferred fields. Use this to check what models are available before creating an embedder, LLM, or reranker.", {
|
|
@@ -21970,7 +21975,7 @@ ${allModels.join("\n")}` }] };
|
|
|
21970
21975
|
});
|
|
21971
21976
|
server.tool("goodmem_client_info", "Return the MCP client package version and the goodmem server commit it was built against. No server connection required.", {}, async () => {
|
|
21972
21977
|
return { content: [{ type: "text", text: JSON.stringify({
|
|
21973
|
-
mcpVersion: "0.1.
|
|
21978
|
+
mcpVersion: "0.1.9",
|
|
21974
21979
|
basedOnGoodmemCommit: BASED_ON_GOODMEM_COMMIT
|
|
21975
21980
|
}, null, 2) }] };
|
|
21976
21981
|
});
|
|
@@ -22419,7 +22424,34 @@ function registerTools() {
|
|
|
22419
22424
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
22420
22425
|
});
|
|
22421
22426
|
server.tool("goodmem_memories_batch_create", "Create multiple memories in a batch", {
|
|
22422
|
-
requests: external_exports.array(external_exports.
|
|
22427
|
+
requests: external_exports.array(external_exports.object({
|
|
22428
|
+
memoryId: external_exports.string().describe("Optional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use.").optional(),
|
|
22429
|
+
spaceId: external_exports.string().describe("ID of the space where this memory will be stored"),
|
|
22430
|
+
originalContent: external_exports.string().describe("Original content as plain text (use either this or originalContentB64)").optional(),
|
|
22431
|
+
originalContentB64: external_exports.string().describe("Original content as base64-encoded binary data (use either this or originalContent)").optional(),
|
|
22432
|
+
originalContentRef: external_exports.string().describe("Reference to external content location").optional(),
|
|
22433
|
+
contentType: external_exports.string().describe("MIME type of the content"),
|
|
22434
|
+
metadata: external_exports.any().describe("Additional metadata for the memory").optional(),
|
|
22435
|
+
chunkingConfig: external_exports.object({
|
|
22436
|
+
none: external_exports.any().describe("No chunking strategy - preserve original content as single unit").optional(),
|
|
22437
|
+
recursive: external_exports.object({
|
|
22438
|
+
chunkSize: external_exports.number().int().describe("Maximum size of a chunk (should be \u2264 context window)"),
|
|
22439
|
+
chunkOverlap: external_exports.number().int().describe("Sliding overlap between chunks"),
|
|
22440
|
+
separators: external_exports.any().describe("Hierarchical separator list (order = preference)").optional(),
|
|
22441
|
+
keepStrategy: external_exports.enum(["KEEP_NONE", "KEEP_START", "KEEP_END"]).describe("How to handle separators after splitting. KEEP_NONE is deprecated and behaves as KEEP_END."),
|
|
22442
|
+
separatorIsRegex: external_exports.boolean().describe("Whether separators are regex patterns").optional(),
|
|
22443
|
+
lengthMeasurement: external_exports.enum(["CHARACTER_COUNT", "TOKEN_COUNT", "CUSTOM"]).describe("How to measure chunk length")
|
|
22444
|
+
}).passthrough().describe("Recursive hierarchical chunking strategy with configurable separators").optional(),
|
|
22445
|
+
sentence: external_exports.object({
|
|
22446
|
+
maxChunkSize: external_exports.number().int().describe("Maximum size of a chunk"),
|
|
22447
|
+
minChunkSize: external_exports.number().int().describe("Minimum size before creating a new chunk"),
|
|
22448
|
+
enableLanguageDetection: external_exports.boolean().describe("Whether to detect language for better segmentation").optional(),
|
|
22449
|
+
lengthMeasurement: external_exports.enum(["CHARACTER_COUNT", "TOKEN_COUNT", "CUSTOM"]).describe("How to measure chunk length")
|
|
22450
|
+
}).passthrough().describe("Sentence-based chunking strategy with language detection").optional()
|
|
22451
|
+
}).passthrough().describe("Chunking strategy for this memory (if not provided, uses space default)").optional(),
|
|
22452
|
+
extractPageImages: external_exports.boolean().describe("Optional hint to extract page images for eligible document types (for example, PDFs)").optional(),
|
|
22453
|
+
fileField: external_exports.string().describe("Optional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request.").optional()
|
|
22454
|
+
}).passthrough()).describe("Array of memory creation requests.")
|
|
22423
22455
|
}, async (args) => {
|
|
22424
22456
|
const body = {};
|
|
22425
22457
|
if (args.requests !== void 0)
|
|
@@ -22608,7 +22640,8 @@ function registerTools() {
|
|
|
22608
22640
|
post_processor: external_exports.object({
|
|
22609
22641
|
name: external_exports.string().describe("Fully qualified factory class name of the post-processor to apply."),
|
|
22610
22642
|
config: external_exports.any().describe("Configuration parameters for the post-processor. Fields depend on the selected processor; see the linked documentation for the built-in ChatPostProcessor schema.").optional()
|
|
22611
|
-
}).passthrough().describe("Optional post-processor configuration to transform retrieval results.").optional()
|
|
22643
|
+
}).passthrough().describe("Optional post-processor configuration to transform retrieval results.").optional(),
|
|
22644
|
+
timeout_sec: external_exports.number().int().describe("Maximum seconds to wait for the streaming response (default: 200).").optional()
|
|
22612
22645
|
}, async (args) => {
|
|
22613
22646
|
const body = {};
|
|
22614
22647
|
if (args.message !== void 0)
|
|
@@ -22627,7 +22660,7 @@ function registerTools() {
|
|
|
22627
22660
|
body["hnsw"] = args.hnsw;
|
|
22628
22661
|
if (args.post_processor !== void 0)
|
|
22629
22662
|
body["postProcessor"] = args.post_processor;
|
|
22630
|
-
const result = await callApiNdjson("POST", `/v1/memories:retrieve`, body);
|
|
22663
|
+
const result = await callApiNdjson("POST", `/v1/memories:retrieve`, body, void 0, args.timeout_sec);
|
|
22631
22664
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
22632
22665
|
});
|
|
22633
22666
|
server.tool("goodmem_ocr_document", "Run OCR on a document or image", {
|