Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/sample-servers/src/whoami/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ if (!MCP_AUTH_ISSUER) {
throw new Error('MCP_AUTH_ISSUER environment variable is required');
}

const authServerConfig = await fetchServerConfig(MCP_AUTH_ISSUER, { type: 'oidc' });

const mcpAuth = new MCPAuth({
server: await fetchServerConfig(MCP_AUTH_ISSUER, { type: 'oidc' }),
server: authServerConfig,
});

/**
Expand All @@ -47,7 +49,7 @@ const mcpAuth = new MCPAuth({
* @type {(token: string) => Promise<AuthInfo>}
*/
const verifyToken = async (token) => {
const { issuer, userinfoEndpoint } = mcpAuth.config.server.metadata;
const { issuer, userinfoEndpoint } = authServerConfig.metadata;

if (!userinfoEndpoint) {
throw new Error('Userinfo endpoint is not configured in the server metadata');
Expand Down
3 changes: 2 additions & 1 deletion packages/sample-servers/tsup.todo-manager.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { config as baseConfig } from './tsup.config.js';

export default defineConfig({
...baseConfig,
watch: ['src/**/*.ts', '.env', '../../.env', '*.config.ts'],
entry: { 'todo-manager/index': 'src/todo-manager/index.ts' },
watch: ['src/todo-manager/**/*.ts', '.env'],
onSuccess: 'node ./dist/todo-manager/index.js',
});
6 changes: 3 additions & 3 deletions packages/sample-servers/tsup.whoami.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config as baseConfig } from './tsup.config.js';

export default defineConfig({
...baseConfig,
entry: { 'todo-manager/index': 'src/todo-manager/todo-service/index.ts' },
watch: ['src/todo-manager/**/*.ts', '.env', '../../.env'],
onSuccess: 'node ./dist/todo-manager/index.js',
entry: { 'whoami/index': 'src/whoami/index.ts' },
watch: ['src/whoami/**/*.ts', '.env'],
onSuccess: 'node ./dist/whoami/index.js',
});