@gainable.dev/mcp-server 0.1.3 → 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
|
-
|
|
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/package.json
CHANGED