From c8716813af6dbeb292fe3c81c95221923ede2d04 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 21 Oct 2026 07:58:32 +0200 Subject: [PATCH 1/4] Update @rekog/mcp-nest to version 2.0.8 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4aa91be806..93438d63a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "@openrouter/ai-sdk-provider": "3.1.0", "@prisma/adapter-pg": "7.10.0", "@prisma/client": "7.10.0", - "@rekog/mcp-nest": "2.0.7", + "@rekog/mcp-nest": "2.0.8", "@simplewebauthn/browser": "14.0.0", "@simplewebauthn/server": "14.0.3", "ai": "7.0.127", @@ -12758,9 +12758,9 @@ } }, "node_modules/@rekog/mcp-nest": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@rekog/mcp-nest/-/mcp-nest-2.0.7.tgz", - "integrity": "sha512-8DWrSapEA9Z/YJL9dFmj7sSbemmeQmf0VkGkW6Sn1itwKFf0n9hzTiwWt8XBtZvV5JVDNCtvRZKYYKgNjDcYPg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@rekog/mcp-nest/-/mcp-nest-2.0.8.tgz", + "integrity": "sha512-CDqzT1RBdvCNsRkDthcNPG3nxoy0GbRCrdrK+TjL+90ElL+j65lquBhUQcR37csGyeLa8uLnj/2unLqlKZRzoA==", "license": "MIT", "dependencies": { "multer": "^2.3.0", diff --git a/package.json b/package.json index 305d8fb12a..abae3dc241 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@openrouter/ai-sdk-provider": "3.1.0", "@prisma/adapter-pg": "7.10.0", "@prisma/client": "7.10.0", - "@rekog/mcp-nest": "2.0.7", + "@rekog/mcp-nest": "2.0.8", "@simplewebauthn/browser": "14.0.0", "@simplewebauthn/server": "14.0.3", "ai": "7.0.127", From aab85f086d8a61c0daaeac7600ae4c7a6aa9e44f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 21 Oct 2026 07:58:50 +0200 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f011708ef3..973af1fad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Upgraded `@rekog/mcp-nest` from version `2.0.7` to `2.0.8` + ## 3.89.0 - 2026-10-20 ### Added From 63f0ab61ae044147a1422930ff1c62d8699d29a3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 21 Oct 2026 08:05:39 +0200 Subject: [PATCH 3/4] Improve instructions of MCP server --- apps/api/src/app/endpoints/mcp/mcp.module.ts | 36 +++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/apps/api/src/app/endpoints/mcp/mcp.module.ts b/apps/api/src/app/endpoints/mcp/mcp.module.ts index c1e2885b7f..5c7d50baa7 100644 --- a/apps/api/src/app/endpoints/mcp/mcp.module.ts +++ b/apps/api/src/app/endpoints/mcp/mcp.module.ts @@ -4,13 +4,17 @@ import { ImportModule } from '@ghostfolio/api/app/import/import.module'; import { SymbolModule } from '@ghostfolio/api/app/symbol/symbol.module'; import { UserModule } from '@ghostfolio/api/app/user/user.module'; import { environment } from '@ghostfolio/api/environments/environment'; -import { getMcpUserOfBearerToken } from '@ghostfolio/api/helper/bearer-token.helper'; +import { + getActiveImpersonationOfBearerToken, + getMcpUserOfBearerToken +} from '@ghostfolio/api/helper/bearer-token.helper'; import { ApiModule } from '@ghostfolio/api/services/api/api.module'; import { ConfigurationModule } from '@ghostfolio/api/services/configuration/configuration.module'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { PortfolioTableModule } from '@ghostfolio/api/services/portfolio-table/portfolio-table.module'; import { PortfolioTableService } from '@ghostfolio/api/services/portfolio-table/portfolio-table.service'; import { MCP_ENDPOINT } from '@ghostfolio/common/config'; +import { SubscriptionType } from '@ghostfolio/common/enums'; import { Module } from '@nestjs/common'; import { @@ -43,20 +47,28 @@ import { McpService } from './mcp.service'; useFactory: (configurationService: ConfigurationService) => { const { hostname } = new URL(configurationService.get('ROOT_URL')); - const instructions = [ - 'Ghostfolio is a wealth management application. The tools read the portfolio and the watchlist of the user who granted the access, import activities into the portfolio and update the cash balances of the accounts. They give the quantities and the monetary values only if the access has the permission "View" or "View and manage", otherwise no quantity and no monetary value (except the unit price of an activity). Only the tools which the permission of the access covers are listed. To import activities or to update a cash balance, the access needs the permission "Restricted view and manage" or "View and manage".' - ]; + const instructions = + 'Ghostfolio is a wealth management application. The tools read the portfolio and the watchlist of the user who granted the access, import activities into the portfolio and update the cash balances of the accounts. They give the quantities and the monetary values only if the access has the permission "View" or "View and manage", otherwise no quantity and no monetary value (except the unit price of an activity). Only the tools which the permission of the access covers are listed. To import activities or to update a cash balance, the access needs the permission "Restricted view and manage" or "View and manage".'; - if (configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { - instructions.push( - `With the Basic subscription, the tool get-performance does not give these columns: ${PortfolioTableService.getAssetPerformanceInBaseCurrencyColumnNames().join( - ', ' - )}.` - ); - } + const instructionsOfBasicSubscription = [ + instructions, + `The user who granted the access has the Basic subscription, hence the tool get-performance does not give these columns: ${PortfolioTableService.getAssetPerformanceInBaseCurrencyColumnNames().join( + ', ' + )}.` + ].join(' '); return new McpStrategy({ - instructions: instructions.join(' '), + // The instructions are resolved for each request, hence only a user + // with the Basic subscription gets the note on its limits + instructions: ({ request }) => { + const isBasicSubscription = + getActiveImpersonationOfBearerToken(request)?.userSubscription + ?.type === SubscriptionType.Basic; + + return isBasicSubscription + ? instructionsOfBasicSubscription + : instructions; + }, name: 'ghostfolio', resolveUser: getMcpUserOfBearerToken, title: 'Ghostfolio', From 03455475c844a57de01828644d2ca1a594a8d744 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 21 Oct 2026 08:05:43 +0200 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 973af1fad9..c63e0ff0ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the instructions of the server of the Model Context Protocol (MCP) to give the limits of the Basic subscription only to a user with the Basic subscription (experimental) - Upgraded `@rekog/mcp-nest` from version `2.0.7` to `2.0.8` ## 3.89.0 - 2026-10-20