@gainable.dev/mcp-server 0.1.4 → 0.1.5
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.
|
@@ -28,7 +28,9 @@ export class GainableHttpRunner extends StreamableHttpRunner {
|
|
|
28
28
|
const agent = await db.collection('agents').findOne({ appId: this.baseConfig.appName, uid: agentUid }, { projection: { scopes: 1 } });
|
|
29
29
|
if (!agent?.scopes || agent.scopes.length === 0)
|
|
30
30
|
return undefined;
|
|
31
|
-
|
|
31
|
+
// Normalize scopes: strip app prefix if present (e.g. "my-app_deals" → "deals")
|
|
32
|
+
const appPrefix = `${this.baseConfig.appName}_`;
|
|
33
|
+
return agent.scopes.map((s) => s.startsWith(appPrefix) ? s.slice(appPrefix.length) : s);
|
|
32
34
|
}
|
|
33
35
|
async createServerForRequest({ request, serverOptions, sessionOptions, }) {
|
|
34
36
|
const agentId = extractAgentId(request);
|
package/package.json
CHANGED