@insforge/mcp 1.2.6-dev.0 → 1.2.6-memory.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 CHANGED
@@ -12,7 +12,9 @@
12
12
 
13
13
  # Insforge MCP Server
14
14
 
15
- Model Context Protocol server for [Insforge](https://github.com/InsForge/insforge).
15
+ InsForge turns your coding agents into full-stack builders, letting them add backend features like auth, databases, file storage, serverless functions, and LLMs to your apps in seconds.
16
+
17
+ This repo is Model Context Protocol server for [Insforge](https://github.com/InsForge/insforge).
16
18
 
17
19
  <a href="https://glama.ai/mcp/servers/@InsForge/insforge-mcp">
18
20
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@InsForge/insforge-mcp/badge" alt="Insforge Server MCP server" />
@@ -90,4 +92,4 @@ Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
90
92
 
91
93
  ---
92
94
 
93
- Part of the [Insforge](https://github.com/InsForge/insforge) project.
95
+ Part of the [Insforge](https://github.com/InsForge/insforge) project.
@@ -1301,12 +1301,11 @@ import FormData from "form-data";
1301
1301
  var execAsync = promisify(exec);
1302
1302
  var TOOL_VERSION_REQUIREMENTS = {
1303
1303
  // Schedule tools - require backend v1.1.1+
1304
- // 'upsert-schedule': { minVersion: '1.1.1' },
1305
- // 'delete-schedule': { minVersion: '1.1.1' },
1304
+ "upsert-schedule": { minVersion: "1.1.1" },
1305
+ "delete-schedule": { minVersion: "1.1.1" },
1306
1306
  // 'get-schedules': { minVersion: '1.1.1' },
1307
1307
  // 'get-schedule-logs': { minVersion: '1.1.1' },
1308
1308
  "create-deployment": { minVersion: "1.4.7" }
1309
- // 'fetch-sdk-docs': { minVersion: '1.4.7' },
1310
1309
  // Example of a deprecated tool (uncomment when needed):
1311
1310
  // 'legacy-tool': { minVersion: '1.0.0', maxVersion: '1.5.0' },
1312
1311
  };
@@ -1408,7 +1407,6 @@ async function registerInsforgeTools(server, config = {}) {
1408
1407
  let content = result.content;
1409
1408
  content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
1410
1409
  content = content.replace(/https:\/\/your-app\.region\.insforge\.app/g, API_BASE_URL);
1411
- content = content.replace(/https:\/\/your-app\.insforge\.app/g, API_BASE_URL);
1412
1410
  return content;
1413
1411
  }
1414
1412
  throw new Error("Invalid response format from documentation endpoint");
@@ -1417,31 +1415,6 @@ async function registerInsforgeTools(server, config = {}) {
1417
1415
  throw new Error(`Unable to retrieve ${docType} documentation: ${errMsg}`);
1418
1416
  }
1419
1417
  };
1420
- const fetchSDKDocumentation = async (feature, language) => {
1421
- try {
1422
- const response = await fetch2(`${API_BASE_URL}/api/docs/${feature}/${language}`, {
1423
- method: "GET",
1424
- headers: {
1425
- "Content-Type": "application/json"
1426
- }
1427
- });
1428
- if (response.status === 404) {
1429
- throw new Error("Documentation not found. This feature may not be supported in your project version. Please contact the Insforge team for assistance.");
1430
- }
1431
- const result = await handleApiResponse(response);
1432
- if (result && typeof result === "object" && "content" in result) {
1433
- let content = result.content;
1434
- content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
1435
- content = content.replace(/https:\/\/your-app\.region\.insforge\.app/g, API_BASE_URL);
1436
- content = content.replace(/https:\/\/your-app\.insforge\.app/g, API_BASE_URL);
1437
- return content;
1438
- }
1439
- throw new Error("Invalid response format from documentation endpoint");
1440
- } catch (error) {
1441
- const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1442
- throw new Error(`Unable to retrieve ${feature}-${language} documentation: ${errMsg}`);
1443
- }
1444
- };
1445
1418
  const fetchInsforgeInstructionsContext = async () => {
1446
1419
  try {
1447
1420
  return await fetchDocumentation("instructions");
@@ -1500,43 +1473,6 @@ ${context}`
1500
1473
  }
1501
1474
  })
1502
1475
  );
1503
- registerTool(
1504
- "fetch-sdk-docs",
1505
- `Fetch Insforge SDK documentation for a specific feature and language combination.
1506
-
1507
- Supported features: ${sdkFeatureSchema.options.join(", ")}
1508
- Supported languages: ${sdkLanguageSchema.options.join(", ")}`,
1509
- {
1510
- sdkFeature: sdkFeatureSchema,
1511
- sdkLanguage: sdkLanguageSchema
1512
- },
1513
- withUsageTracking("fetch-sdk-docs", async ({ sdkFeature, sdkLanguage }) => {
1514
- try {
1515
- const content = await fetchSDKDocumentation(sdkFeature, sdkLanguage);
1516
- return await addBackgroundContext({
1517
- content: [
1518
- {
1519
- type: "text",
1520
- text: content
1521
- }
1522
- ]
1523
- });
1524
- } catch (error) {
1525
- const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
1526
- if (errMsg.includes("404") || errMsg.toLowerCase().includes("not found")) {
1527
- return {
1528
- content: [{
1529
- type: "text",
1530
- text: `Documentation for "${sdkFeature}-${sdkLanguage}" is not available. This is likely because your backend version is too old and doesn't support this documentation endpoint yet. This won't affect the functionality of the tools - they will still work correctly.`
1531
- }]
1532
- };
1533
- }
1534
- return {
1535
- content: [{ type: "text", text: `Error fetching ${sdkFeature}-${sdkLanguage} documentation: ${errMsg}` }]
1536
- };
1537
- }
1538
- })
1539
- );
1540
1476
  registerTool(
1541
1477
  "get-anon-key",
1542
1478
  "Generate an anonymous JWT token that never expires. Requires admin API key. Use this for client-side applications that need public access.",
@@ -2334,6 +2270,110 @@ To: Your current project directory
2334
2270
  }
2335
2271
  })
2336
2272
  );
2273
+ const memoryEnabled = process.env.MEMORY_ENABLED === "true";
2274
+ if (memoryEnabled) {
2275
+ registerTool(
2276
+ "store-conversation",
2277
+ "Store a conversation with messages for semantic similarity search. Messages are embedded using pgvector for later retrieval.",
2278
+ {
2279
+ apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2280
+ title: z23.string().optional().describe("Optional title for the conversation"),
2281
+ metadata: z23.record(z23.unknown()).optional().describe("Optional metadata to associate with the conversation"),
2282
+ messages: z23.array(
2283
+ z23.object({
2284
+ role: z23.enum(["user", "assistant", "system", "tool"]).describe("Message role"),
2285
+ content: z23.string().describe("Message content"),
2286
+ metadata: z23.record(z23.unknown()).optional().describe("Optional message metadata")
2287
+ })
2288
+ ).min(1).describe("Array of messages to store"),
2289
+ embeddingModel: z23.string().optional().describe("Embedding model to use (uses project default if not specified)")
2290
+ },
2291
+ withUsageTracking(
2292
+ "store-conversation",
2293
+ async ({ apiKey, title, metadata, messages, embeddingModel }) => {
2294
+ try {
2295
+ const actualApiKey = getApiKey(apiKey);
2296
+ const response = await fetch2(`${API_BASE_URL}/api/memory/conversations`, {
2297
+ method: "POST",
2298
+ headers: {
2299
+ "x-api-key": actualApiKey,
2300
+ "Content-Type": "application/json"
2301
+ },
2302
+ body: JSON.stringify({ title, metadata, messages, embeddingModel })
2303
+ });
2304
+ const result = await handleApiResponse(response);
2305
+ return await addBackgroundContext({
2306
+ content: [
2307
+ {
2308
+ type: "text",
2309
+ text: formatSuccessMessage("Conversation stored successfully", result)
2310
+ }
2311
+ ]
2312
+ });
2313
+ } catch (error) {
2314
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2315
+ return {
2316
+ content: [
2317
+ {
2318
+ type: "text",
2319
+ text: `Error storing conversation: ${errMsg}`
2320
+ }
2321
+ ],
2322
+ isError: true
2323
+ };
2324
+ }
2325
+ }
2326
+ )
2327
+ );
2328
+ registerTool(
2329
+ "search-conversations",
2330
+ "Search for conversations by semantic similarity using pgvector. Returns conversations ranked by relevance to the query.",
2331
+ {
2332
+ apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2333
+ query: z23.string().describe("Search query to find similar conversations"),
2334
+ limit: z23.number().int().positive().max(100).optional().default(10).describe("Maximum number of results to return (default: 10)"),
2335
+ threshold: z23.number().min(0).max(1).optional().default(0).describe("Minimum similarity threshold 0-1 (default: 0)"),
2336
+ metadataFilter: z23.record(z23.unknown()).optional().describe("Filter conversations by metadata (JSONB containment)"),
2337
+ embeddingModel: z23.string().optional().describe("Embedding model for the query (uses project default if not specified)")
2338
+ },
2339
+ withUsageTracking(
2340
+ "search-conversations",
2341
+ async ({ apiKey, query, limit, threshold, metadataFilter, embeddingModel }) => {
2342
+ try {
2343
+ const actualApiKey = getApiKey(apiKey);
2344
+ const response = await fetch2(`${API_BASE_URL}/api/memory/search`, {
2345
+ method: "POST",
2346
+ headers: {
2347
+ "x-api-key": actualApiKey,
2348
+ "Content-Type": "application/json"
2349
+ },
2350
+ body: JSON.stringify({ query, limit, threshold, metadataFilter, embeddingModel })
2351
+ });
2352
+ const result = await handleApiResponse(response);
2353
+ return await addBackgroundContext({
2354
+ content: [
2355
+ {
2356
+ type: "text",
2357
+ text: formatSuccessMessage("Conversation search completed", result)
2358
+ }
2359
+ ]
2360
+ });
2361
+ } catch (error) {
2362
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2363
+ return {
2364
+ content: [
2365
+ {
2366
+ type: "text",
2367
+ text: `Error searching conversations: ${errMsg}`
2368
+ }
2369
+ ],
2370
+ isError: true
2371
+ };
2372
+ }
2373
+ }
2374
+ )
2375
+ );
2376
+ }
2337
2377
  return {
2338
2378
  apiKey: GLOBAL_API_KEY,
2339
2379
  apiBaseUrl: API_BASE_URL,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-LMIQ5YVT.js";
4
+ } from "./chunk-742PFYYV.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-LMIQ5YVT.js";
4
+ } from "./chunk-742PFYYV.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.6-dev.0",
3
+ "version": "1.2.6-memory.0",
4
4
  "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
5
  "mcpName": "io.github.InsForge/insforge-mcp",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "server.json"
37
37
  ],
38
38
  "dependencies": {
39
- "@insforge/shared-schemas": "1.1.39-dev.0",
39
+ "@insforge/shared-schemas": "1.1.38",
40
40
  "@modelcontextprotocol/sdk": "^1.15.1",
41
41
  "@types/express": "^5.0.3",
42
42
  "archiver": "^7.0.1",