@gainable.dev/mcp-server 0.1.2 → 0.1.4

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.
@@ -36,19 +36,22 @@ export class GainableHttpRunner extends StreamableHttpRunner {
36
36
  if (agentId) {
37
37
  agentCollections = await this.getAgentScopes(agentId);
38
38
  }
39
- console.log(`[MCP Session] agent=${agentId ?? '(none)'} | scoped=${agentCollections ? 'yes' : 'no'}`);
39
+ console.log(`[MCP Session] agent=${agentId ?? '(none)'} | scoped=${agentCollections ? 'yes' : 'no'}${agentCollections ? ` | collections=${JSON.stringify(agentCollections)}` : ''}`);
40
40
  // Build per-agent scoping config
41
41
  const agentConfig = {
42
42
  ...this.baseConfig,
43
43
  agentCollections,
44
44
  };
45
45
  // Create a per-session connection manager with agent-specific scoping
46
+ console.log('[MCP Session] Creating connection manager...');
46
47
  const connectionManager = await createScopedConnectionManagerFactory(agentConfig)({
47
48
  logger: this.logger,
48
49
  deviceId: this.deviceId,
49
50
  userConfig: this.userConfig,
50
51
  });
51
- return this.createServer({
52
+ console.log('[MCP Session] Connection manager created');
53
+ console.log('[MCP Session] Creating server...');
54
+ const server = await this.createServer({
52
55
  userConfig: this.userConfig,
53
56
  logger: undefined,
54
57
  serverOptions: {
@@ -60,6 +63,8 @@ export class GainableHttpRunner extends StreamableHttpRunner {
60
63
  connectionManager,
61
64
  },
62
65
  });
66
+ console.log('[MCP Session] Server created successfully');
67
+ return server;
63
68
  }
64
69
  }
65
70
  function extractAgentId(request) {
package/dist/index.js CHANGED
@@ -20,6 +20,9 @@ const userConfig = UserConfigSchema.parse({
20
20
  // 24h idle timeout — sessions are long-lived (Weavy agent conversations)
21
21
  idleTimeoutMs: 86400000,
22
22
  notificationTimeoutMs: 82800000,
23
+ // Weavy manages session IDs externally — accept any session ID without requiring initialize
24
+ // This prevents 404 "session not found" after sidecar restarts
25
+ externallyManagedSessions: true,
23
26
  disabledTools: [
24
27
  'drop-database', 'drop-collection', 'create-collection',
25
28
  'list-databases', 'rename-collection', 'drop-index',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainable.dev/mcp-server",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Scoped MCP server for Gainable in-app copilot agents — wraps mongodb-mcp-server with per-app data isolation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",