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> { public catch(exception: unknown): Observable<never> {
this.logger.error(exception); this.logger.error(exception);
// The payload is written for the caller already
if (exception instanceof RpcException) { if (exception instanceof RpcException) {
return throwError(() => { return throwError(() => {
return exception.getError(); 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', () => { it('Without the scope to read the values', () => {
expect( expect(
getScopesOfAccess({ getScopesOfAccess({
type: 'PRIVATE', scopes: [scopes.portfolioRead],
scopes: [scopes.portfolioRead] type: 'PRIVATE'
}) })
).not.toContain(scopes.portfolioReadValues); ).not.toContain(scopes.portfolioReadValues);
}); });

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

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

Loading…
Cancel
Save