Browse Source

Setup MCP

pull/7703/head
Thomas Kaul 6 days ago
parent
commit
f781776d06
  1. 1
      apps/api/src/filters/mcp-tool-exception.filter.ts
  2. 4
      libs/common/src/lib/scopes.spec.ts
  3. 3
      libs/common/src/lib/scopes.ts

1
apps/api/src/filters/mcp-tool-exception.filter.ts

@ -22,7 +22,6 @@ export class McpToolExceptionFilter implements RpcExceptionFilter {
public catch(exception: unknown): Observable<never> {
this.logger.error(exception);
// The payload is written for the caller already
if (exception instanceof RpcException) {
return throwError(() => {
return exception.getError();

4
libs/common/src/lib/scopes.spec.ts

@ -70,8 +70,8 @@ describe('Scopes', () => {
it('Without the scope to read the values', () => {
expect(
getScopesOfAccess({
type: 'PRIVATE',
scopes: [scopes.portfolioRead]
scopes: [scopes.portfolioRead],
type: 'PRIVATE'
})
).not.toContain(scopes.portfolioReadValues);
});

3
libs/common/src/lib/scopes.ts

@ -94,8 +94,7 @@ export function getScopesOfAccess({
}): string[] {
const scopesToEvaluate = scopesOfAccess ?? [];
// An unknown scope is dropped, so that a scope which has been removed from
// the vocabulary cannot stay effective
// An unknown scope is dropped
return SCOPES_OF_TYPE[type].filter((scope) => {
return scopesToEvaluate.includes(scope);
});

Loading…
Cancel
Save