;
+}
+export declare const setupAuthServer: ({ authServerUrl, mcpServerUrl, strictResource }: {
+ authServerUrl: URL;
+ mcpServerUrl: URL;
+ strictResource: boolean;
+}) => OAuthMetadata;
+//# sourceMappingURL=demoInMemoryOAuthProvider.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8a4a43fe8d30aed981260bdc2eff5988142767ed
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"demoInMemoryOAuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAgB,EAAW,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAKtD,qBAAa,wBAAyB,YAAW,2BAA2B;IACxE,OAAO,CAAC,OAAO,CAAiD;IAE1D,SAAS,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;IAI1B,cAAc,CAAC,cAAc,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;CAIlE;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAWpD,OAAO,CAAC,gBAAgB,CAAC;IAVrC,YAAY,2BAAkC;IAC9C,OAAO,CAAC,KAAK,CAMT;IACJ,OAAO,CAAC,MAAM,CAA+B;gBAEzB,gBAAgB,CAAC,GAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,OAAO,aAAA;IAE5D,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCxG,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAU7G,yBAAyB,CAC3B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EAGzB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,WAAW,CAAC;IAoCjB,oBAAoB,CACtB,OAAO,EAAE,0BAA0B,EACnC,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,SAAS,CAAC,EAAE,GAAG,GAChB,OAAO,CAAC,WAAW,CAAC;IAIjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAc5D;AAED,eAAO,MAAM,eAAe,oDAIzB;IACC,aAAa,EAAE,GAAG,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CAC3B,KAAG,aA+EH,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js
new file mode 100644
index 0000000000000000000000000000000000000000..c439a34039ed17822a7256856b67851cee4d1335
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js
@@ -0,0 +1,205 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.setupAuthServer = exports.DemoInMemoryAuthProvider = exports.DemoInMemoryClientsStore = void 0;
+const node_crypto_1 = require("node:crypto");
+const express_1 = __importDefault(require("express"));
+const router_js_1 = require("../../server/auth/router.js");
+const auth_utils_js_1 = require("../../shared/auth-utils.js");
+const errors_js_1 = require("../../server/auth/errors.js");
+class DemoInMemoryClientsStore {
+ constructor() {
+ this.clients = new Map();
+ }
+ async getClient(clientId) {
+ return this.clients.get(clientId);
+ }
+ async registerClient(clientMetadata) {
+ this.clients.set(clientMetadata.client_id, clientMetadata);
+ return clientMetadata;
+ }
+}
+exports.DemoInMemoryClientsStore = DemoInMemoryClientsStore;
+/**
+ * 🚨 DEMO ONLY - NOT FOR PRODUCTION
+ *
+ * This example demonstrates MCP OAuth flow but lacks some of the features required for production use,
+ * for example:
+ * - Persistent token storage
+ * - Rate limiting
+ */
+class DemoInMemoryAuthProvider {
+ constructor(validateResource) {
+ this.validateResource = validateResource;
+ this.clientsStore = new DemoInMemoryClientsStore();
+ this.codes = new Map();
+ this.tokens = new Map();
+ }
+ async authorize(client, params, res) {
+ const code = (0, node_crypto_1.randomUUID)();
+ const searchParams = new URLSearchParams({
+ code
+ });
+ if (params.state !== undefined) {
+ searchParams.set('state', params.state);
+ }
+ this.codes.set(code, {
+ client,
+ params
+ });
+ // Simulate a user login
+ // Set a secure HTTP-only session cookie with authorization info
+ if (res.cookie) {
+ const authCookieData = {
+ userId: 'demo_user',
+ name: 'Demo User',
+ timestamp: Date.now()
+ };
+ res.cookie('demo_session', JSON.stringify(authCookieData), {
+ httpOnly: true,
+ secure: false, // In production, this should be true
+ sameSite: 'lax',
+ maxAge: 24 * 60 * 60 * 1000, // 24 hours - for demo purposes
+ path: '/' // Available to all routes
+ });
+ }
+ if (!client.redirect_uris.includes(params.redirectUri)) {
+ throw new errors_js_1.InvalidRequestError('Unregistered redirect_uri');
+ }
+ const targetUrl = new URL(params.redirectUri);
+ targetUrl.search = searchParams.toString();
+ res.redirect(targetUrl.toString());
+ }
+ async challengeForAuthorizationCode(client, authorizationCode) {
+ // Store the challenge with the code data
+ const codeData = this.codes.get(authorizationCode);
+ if (!codeData) {
+ throw new Error('Invalid authorization code');
+ }
+ return codeData.params.codeChallenge;
+ }
+ async exchangeAuthorizationCode(client, authorizationCode,
+ // Note: code verifier is checked in token.ts by default
+ // it's unused here for that reason.
+ _codeVerifier) {
+ const codeData = this.codes.get(authorizationCode);
+ if (!codeData) {
+ throw new Error('Invalid authorization code');
+ }
+ if (codeData.client.client_id !== client.client_id) {
+ throw new Error(`Authorization code was not issued to this client, ${codeData.client.client_id} != ${client.client_id}`);
+ }
+ if (this.validateResource && !this.validateResource(codeData.params.resource)) {
+ throw new Error(`Invalid resource: ${codeData.params.resource}`);
+ }
+ this.codes.delete(authorizationCode);
+ const token = (0, node_crypto_1.randomUUID)();
+ const tokenData = {
+ token,
+ clientId: client.client_id,
+ scopes: codeData.params.scopes || [],
+ expiresAt: Date.now() + 3600000, // 1 hour
+ resource: codeData.params.resource,
+ type: 'access'
+ };
+ this.tokens.set(token, tokenData);
+ return {
+ access_token: token,
+ token_type: 'bearer',
+ expires_in: 3600,
+ scope: (codeData.params.scopes || []).join(' ')
+ };
+ }
+ async exchangeRefreshToken(_client, _refreshToken, _scopes, _resource) {
+ throw new Error('Not implemented for example demo');
+ }
+ async verifyAccessToken(token) {
+ const tokenData = this.tokens.get(token);
+ if (!tokenData || !tokenData.expiresAt || tokenData.expiresAt < Date.now()) {
+ throw new Error('Invalid or expired token');
+ }
+ return {
+ token,
+ clientId: tokenData.clientId,
+ scopes: tokenData.scopes,
+ expiresAt: Math.floor(tokenData.expiresAt / 1000),
+ resource: tokenData.resource
+ };
+ }
+}
+exports.DemoInMemoryAuthProvider = DemoInMemoryAuthProvider;
+const setupAuthServer = ({ authServerUrl, mcpServerUrl, strictResource }) => {
+ // Create separate auth server app
+ // NOTE: This is a separate app on a separate port to illustrate
+ // how to separate an OAuth Authorization Server from a Resource
+ // server in the SDK. The SDK is not intended to be provide a standalone
+ // authorization server.
+ const validateResource = strictResource
+ ? (resource) => {
+ if (!resource)
+ return false;
+ const expectedResource = (0, auth_utils_js_1.resourceUrlFromServerUrl)(mcpServerUrl);
+ return resource.toString() === expectedResource.toString();
+ }
+ : undefined;
+ const provider = new DemoInMemoryAuthProvider(validateResource);
+ const authApp = (0, express_1.default)();
+ authApp.use(express_1.default.json());
+ // For introspection requests
+ authApp.use(express_1.default.urlencoded());
+ // Add OAuth routes to the auth server
+ // NOTE: this will also add a protected resource metadata route,
+ // but it won't be used, so leave it.
+ authApp.use((0, router_js_1.mcpAuthRouter)({
+ provider,
+ issuerUrl: authServerUrl,
+ scopesSupported: ['mcp:tools']
+ }));
+ authApp.post('/introspect', async (req, res) => {
+ try {
+ const { token } = req.body;
+ if (!token) {
+ res.status(400).json({ error: 'Token is required' });
+ return;
+ }
+ const tokenInfo = await provider.verifyAccessToken(token);
+ res.json({
+ active: true,
+ client_id: tokenInfo.clientId,
+ scope: tokenInfo.scopes.join(' '),
+ exp: tokenInfo.expiresAt,
+ aud: tokenInfo.resource
+ });
+ return;
+ }
+ catch (error) {
+ res.status(401).json({
+ active: false,
+ error: 'Unauthorized',
+ error_description: `Invalid token: ${error}`
+ });
+ }
+ });
+ const auth_port = authServerUrl.port;
+ // Start the auth server
+ authApp.listen(auth_port, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`OAuth Authorization Server listening on port ${auth_port}`);
+ });
+ // Note: we could fetch this from the server, but then we end up
+ // with some top level async which gets annoying.
+ const oauthMetadata = (0, router_js_1.createOAuthMetadata)({
+ provider,
+ issuerUrl: authServerUrl,
+ scopesSupported: ['mcp:tools']
+ });
+ oauthMetadata.introspection_endpoint = new URL('/introspect', authServerUrl).href;
+ return oauthMetadata;
+};
+exports.setupAuthServer = setupAuthServer;
+//# sourceMappingURL=demoInMemoryOAuthProvider.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..e19a20db90b988679011058194b3d685e9cf5b34
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/demoInMemoryOAuthProvider.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"demoInMemoryOAuthProvider.js","sourceRoot":"","sources":["../../../../src/examples/server/demoInMemoryOAuthProvider.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AAIzC,sDAAqD;AAErD,2DAAiF;AACjF,8DAAsE;AACtE,2DAAkE;AAElE,MAAa,wBAAwB;IAArC;QACY,YAAO,GAAG,IAAI,GAAG,EAAsC,CAAC;IAUpE,CAAC;IARG,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,cAA0C;QAC3D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ;AAXD,4DAWC;AAED;;;;;;;GAOG;AACH,MAAa,wBAAwB;IAWjC,YAAoB,gBAA8C;QAA9C,qBAAgB,GAAhB,gBAAgB,CAA8B;QAVlE,iBAAY,GAAG,IAAI,wBAAwB,EAAE,CAAC;QACtC,UAAK,GAAG,IAAI,GAAG,EAMpB,CAAC;QACI,WAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEwB,CAAC;IAEtE,KAAK,CAAC,SAA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AAC;AACzB,CAAC,CAAC;AAvFW,QAAA,eAAe,mBAuF1B"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e4b736e0f23237bd316cea8e668f2cb2fe912102
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=elicitationFormExample.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c569df428def5c02d3326d69249c90f540d14564
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"elicitationFormExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js
new file mode 100644
index 0000000000000000000000000000000000000000..4c2f4e134101867c1fd7b946215ca2d9de194b40
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js
@@ -0,0 +1,460 @@
+"use strict";
+// Run with: npx tsx src/examples/server/elicitationFormExample.ts
+//
+// This example demonstrates how to use form elicitation to collect structured user input
+// with JSON Schema validation via a local HTTP server with SSE streaming.
+// Form elicitation allows servers to request *non-sensitive* user input through the client
+// with schema-based validation.
+// Note: See also elicitationUrlExample.ts for an example of using URL elicitation
+// to collect *sensitive* user input via a browser.
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const types_js_1 = require("../../types.js");
+const express_js_1 = require("../../server/express.js");
+// Factory to create a new MCP server per session.
+// Each session needs its own server+transport pair to avoid cross-session contamination.
+const getServer = () => {
+ // Create MCP server - it will automatically use AjvJsonSchemaValidator with sensible defaults
+ // The validator supports format validation (email, date, etc.) if ajv-formats is installed
+ const mcpServer = new mcp_js_1.McpServer({
+ name: 'form-elicitation-example-server',
+ version: '1.0.0'
+ }, {
+ capabilities: {}
+ });
+ /**
+ * Example 1: Simple user registration tool
+ * Collects username, email, and password from the user
+ */
+ mcpServer.registerTool('register_user', {
+ description: 'Register a new user account by collecting their information',
+ inputSchema: {}
+ }, async () => {
+ try {
+ // Request user information through form elicitation
+ const result = await mcpServer.server.elicitInput({
+ mode: 'form',
+ message: 'Please provide your registration information:',
+ requestedSchema: {
+ type: 'object',
+ properties: {
+ username: {
+ type: 'string',
+ title: 'Username',
+ description: 'Your desired username (3-20 characters)',
+ minLength: 3,
+ maxLength: 20
+ },
+ email: {
+ type: 'string',
+ title: 'Email',
+ description: 'Your email address',
+ format: 'email'
+ },
+ password: {
+ type: 'string',
+ title: 'Password',
+ description: 'Your password (min 8 characters)',
+ minLength: 8
+ },
+ newsletter: {
+ type: 'boolean',
+ title: 'Newsletter',
+ description: 'Subscribe to newsletter?',
+ default: false
+ },
+ role: {
+ type: 'string',
+ title: 'Role',
+ description: 'Your primary role',
+ oneOf: [
+ { const: 'developer', title: 'Developer' },
+ { const: 'designer', title: 'Designer' },
+ { const: 'manager', title: 'Manager' },
+ { const: 'other', title: 'Other' }
+ ],
+ default: 'developer'
+ },
+ interests: {
+ type: 'array',
+ title: 'Interests',
+ description: 'Select your areas of interest',
+ items: {
+ type: 'string',
+ enum: ['frontend', 'backend', 'mobile', 'devops', 'ai']
+ },
+ minItems: 1,
+ maxItems: 3
+ }
+ },
+ required: ['username', 'email', 'password']
+ }
+ });
+ // Handle the different possible actions
+ if (result.action === 'accept' && result.content) {
+ const { username, email, newsletter } = result.content;
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Registration successful!\n\nUsername: ${username}\nEmail: ${email}\nNewsletter: ${newsletter ? 'Yes' : 'No'}`
+ }
+ ]
+ };
+ }
+ else if (result.action === 'decline') {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: 'Registration cancelled by user.'
+ }
+ ]
+ };
+ }
+ else {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: 'Registration was cancelled.'
+ }
+ ]
+ };
+ }
+ }
+ catch (error) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Registration failed: ${error instanceof Error ? error.message : String(error)}`
+ }
+ ],
+ isError: true
+ };
+ }
+ });
+ /**
+ * Example 2: Multi-step workflow with multiple form elicitation requests
+ * Demonstrates how to collect information in multiple steps
+ */
+ mcpServer.registerTool('create_event', {
+ description: 'Create a calendar event by collecting event details',
+ inputSchema: {}
+ }, async () => {
+ try {
+ // Step 1: Collect basic event information
+ const basicInfo = await mcpServer.server.elicitInput({
+ mode: 'form',
+ message: 'Step 1: Enter basic event information',
+ requestedSchema: {
+ type: 'object',
+ properties: {
+ title: {
+ type: 'string',
+ title: 'Event Title',
+ description: 'Name of the event',
+ minLength: 1
+ },
+ description: {
+ type: 'string',
+ title: 'Description',
+ description: 'Event description (optional)'
+ }
+ },
+ required: ['title']
+ }
+ });
+ if (basicInfo.action !== 'accept' || !basicInfo.content) {
+ return {
+ content: [{ type: 'text', text: 'Event creation cancelled.' }]
+ };
+ }
+ // Step 2: Collect date and time
+ const dateTime = await mcpServer.server.elicitInput({
+ mode: 'form',
+ message: 'Step 2: Enter date and time',
+ requestedSchema: {
+ type: 'object',
+ properties: {
+ date: {
+ type: 'string',
+ title: 'Date',
+ description: 'Event date',
+ format: 'date'
+ },
+ startTime: {
+ type: 'string',
+ title: 'Start Time',
+ description: 'Event start time (HH:MM)'
+ },
+ duration: {
+ type: 'integer',
+ title: 'Duration',
+ description: 'Duration in minutes',
+ minimum: 15,
+ maximum: 480
+ }
+ },
+ required: ['date', 'startTime', 'duration']
+ }
+ });
+ if (dateTime.action !== 'accept' || !dateTime.content) {
+ return {
+ content: [{ type: 'text', text: 'Event creation cancelled.' }]
+ };
+ }
+ // Combine all collected information
+ const event = {
+ ...basicInfo.content,
+ ...dateTime.content
+ };
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Event created successfully!\n\n${JSON.stringify(event, null, 2)}`
+ }
+ ]
+ };
+ }
+ catch (error) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Event creation failed: ${error instanceof Error ? error.message : String(error)}`
+ }
+ ],
+ isError: true
+ };
+ }
+ });
+ /**
+ * Example 3: Collecting address information
+ * Demonstrates validation with patterns and optional fields
+ */
+ mcpServer.registerTool('update_shipping_address', {
+ description: 'Update shipping address with validation',
+ inputSchema: {}
+ }, async () => {
+ try {
+ const result = await mcpServer.server.elicitInput({
+ mode: 'form',
+ message: 'Please provide your shipping address:',
+ requestedSchema: {
+ type: 'object',
+ properties: {
+ name: {
+ type: 'string',
+ title: 'Full Name',
+ description: 'Recipient name',
+ minLength: 1
+ },
+ street: {
+ type: 'string',
+ title: 'Street Address',
+ minLength: 1
+ },
+ city: {
+ type: 'string',
+ title: 'City',
+ minLength: 1
+ },
+ state: {
+ type: 'string',
+ title: 'State/Province',
+ minLength: 2,
+ maxLength: 2
+ },
+ zipCode: {
+ type: 'string',
+ title: 'ZIP/Postal Code',
+ description: '5-digit ZIP code'
+ },
+ phone: {
+ type: 'string',
+ title: 'Phone Number (optional)',
+ description: 'Contact phone number'
+ }
+ },
+ required: ['name', 'street', 'city', 'state', 'zipCode']
+ }
+ });
+ if (result.action === 'accept' && result.content) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Address updated successfully!\n\n${JSON.stringify(result.content, null, 2)}`
+ }
+ ]
+ };
+ }
+ else if (result.action === 'decline') {
+ return {
+ content: [{ type: 'text', text: 'Address update cancelled by user.' }]
+ };
+ }
+ else {
+ return {
+ content: [{ type: 'text', text: 'Address update was cancelled.' }]
+ };
+ }
+ }
+ catch (error) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Address update failed: ${error instanceof Error ? error.message : String(error)}`
+ }
+ ],
+ isError: true
+ };
+ }
+ });
+ return mcpServer;
+};
+async function main() {
+ const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
+ const app = (0, express_js_1.createMcpExpressApp)();
+ // Map to store transports by session ID
+ const transports = {};
+ // MCP POST endpoint
+ const mcpPostHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (sessionId) {
+ console.log(`Received MCP request for session: ${sessionId}`);
+ }
+ try {
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Reuse existing transport for this session
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
+ // New initialization request - create new transport
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ console.log(`Session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ }
+ });
+ // Set up onclose handler to clean up transport when closed
+ transport.onclose = () => {
+ const sid = transport.sessionId;
+ if (sid && transports[sid]) {
+ console.log(`Transport closed for session ${sid}, removing from transports map`);
+ delete transports[sid];
+ }
+ };
+ // Create a new server per session and connect it to the transport
+ const mcpServer = getServer();
+ await mcpServer.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ return;
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with existing transport
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+ };
+ app.post('/mcp', mcpPostHandler);
+ // Handle GET requests for SSE streams
+ const mcpGetHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Establishing SSE stream for session ${sessionId}`);
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+ };
+ app.get('/mcp', mcpGetHandler);
+ // Handle DELETE requests for session termination
+ const mcpDeleteHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Received session termination request for session ${sessionId}`);
+ try {
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+ }
+ catch (error) {
+ console.error('Error handling session termination:', error);
+ if (!res.headersSent) {
+ res.status(500).send('Error processing session termination');
+ }
+ }
+ };
+ app.delete('/mcp', mcpDeleteHandler);
+ // Start listening
+ app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`Form elicitation example server is running on http://localhost:${PORT}/mcp`);
+ console.log('Available tools:');
+ console.log(' - register_user: Collect user registration information');
+ console.log(' - create_event: Multi-step event creation');
+ console.log(' - update_shipping_address: Collect and validate address');
+ console.log('\nConnect your MCP client to this server using the HTTP transport.');
+ });
+ // Handle server shutdown
+ process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ // Close all active transports to properly clean up resources
+ for (const sessionId in transports) {
+ try {
+ console.log(`Closing transport for session ${sessionId}`);
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing transport for session ${sessionId}:`, error);
+ }
+ }
+ console.log('Server shutdown complete');
+ process.exit(0);
+ });
+}
+main().catch(error => {
+ console.error('Server error:', error);
+ process.exit(1);
+});
+//# sourceMappingURL=elicitationFormExample.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..4056a05bc3667ef4f2cf0b3e07ffa752afadb3e3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationFormExample.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"elicitationFormExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationFormExample.ts"],"names":[],"mappings":";AAAA,kEAAkE;AAClE,EAAE;AACF,yFAAyF;AACzF,0EAA0E;AAC1E,2FAA2F;AAC3F,gCAAgC;AAChC,kFAAkF;AAClF,mDAAmD;;AAEnD,6CAAyC;AAEzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAqD;AACrD,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,8FAA8F;IAC9F,2FAA2F;IAC3F,MAAM,SAAS,GAAG,IAAI,kBAAS,CAC3B;QACI,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE;KACnB,CACJ,CAAC;IAEF;;;OAGG;IACH,SAAS,CAAC,YAAY,CAClB,eAAe,EACf;QACI,WAAW,EAAE,6DAA6D;QAC1E,WAAW,EAAE,EAAE;KAClB,EACD,KAA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AAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..611f6eba22a2d5eb50e98ccba5ddcd5460828d5f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=elicitationUrlExample.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..04acd6664dfff27f1dc75e2c6aca00bbaa535aaa
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"elicitationUrlExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js
new file mode 100644
index 0000000000000000000000000000000000000000..53c860bf9fc9238541af457f9f26ea13dd060d85
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js
@@ -0,0 +1,656 @@
+"use strict";
+// Run with: npx tsx src/examples/server/elicitationUrlExample.ts
+//
+// This example demonstrates how to use URL elicitation to securely collect
+// *sensitive* user input in a remote (HTTP) server.
+// URL elicitation allows servers to prompt the end-user to open a URL in their browser
+// to collect sensitive information.
+// Note: See also elicitationFormExample.ts for an example of using form (not URL) elicitation
+// to collect *non-sensitive* user input with a structured schema.
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const express_1 = __importDefault(require("express"));
+const node_crypto_1 = require("node:crypto");
+const zod_1 = require("zod");
+const mcp_js_1 = require("../../server/mcp.js");
+const express_js_1 = require("../../server/express.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const router_js_1 = require("../../server/auth/router.js");
+const bearerAuth_js_1 = require("../../server/auth/middleware/bearerAuth.js");
+const types_js_1 = require("../../types.js");
+const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js");
+const demoInMemoryOAuthProvider_js_1 = require("./demoInMemoryOAuthProvider.js");
+const auth_utils_js_1 = require("../../shared/auth-utils.js");
+const cors_1 = __importDefault(require("cors"));
+// Create an MCP server with implementation details
+const getServer = () => {
+ const mcpServer = new mcp_js_1.McpServer({
+ name: 'url-elicitation-http-server',
+ version: '1.0.0'
+ }, {
+ capabilities: { logging: {} }
+ });
+ mcpServer.registerTool('payment-confirm', {
+ description: 'A tool that confirms a payment directly with a user',
+ inputSchema: {
+ cartId: zod_1.z.string().describe('The ID of the cart to confirm')
+ }
+ }, async ({ cartId }, extra) => {
+ /*
+ In a real world scenario, there would be some logic here to check if the user has the provided cartId.
+ For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to confirm payment)
+ */
+ const sessionId = extra.sessionId;
+ if (!sessionId) {
+ throw new Error('Expected a Session ID');
+ }
+ // Create and track the elicitation
+ const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId));
+ throw new types_js_1.UrlElicitationRequiredError([
+ {
+ mode: 'url',
+ message: 'This tool requires a payment confirmation. Open the link to confirm payment!',
+ url: `http://localhost:${MCP_PORT}/confirm-payment?session=${sessionId}&elicitation=${elicitationId}&cartId=${encodeURIComponent(cartId)}`,
+ elicitationId
+ }
+ ]);
+ });
+ mcpServer.registerTool('third-party-auth', {
+ description: 'A demo tool that requires third-party OAuth credentials',
+ inputSchema: {
+ param1: zod_1.z.string().describe('First parameter')
+ }
+ }, async (_, extra) => {
+ /*
+ In a real world scenario, there would be some logic here to check if we already have a valid access token for the user.
+ Auth info (with a subject or `sub` claim) can be typically be found in `extra.authInfo`.
+ If we do, we can just return the result of the tool call.
+ If we don't, we can throw an ElicitationRequiredError to request the user to authenticate.
+ For the purposes of this example, we'll throw an error (-> elicits the client to open a URL to authenticate).
+ */
+ const sessionId = extra.sessionId;
+ if (!sessionId) {
+ throw new Error('Expected a Session ID');
+ }
+ // Create and track the elicitation
+ const elicitationId = generateTrackedElicitation(sessionId, elicitationId => mcpServer.server.createElicitationCompletionNotifier(elicitationId));
+ // Simulate OAuth callback and token exchange after 5 seconds
+ // In a real app, this would be called from your OAuth callback handler
+ setTimeout(() => {
+ console.log(`Simulating OAuth token received for elicitation ${elicitationId}`);
+ completeURLElicitation(elicitationId);
+ }, 5000);
+ throw new types_js_1.UrlElicitationRequiredError([
+ {
+ mode: 'url',
+ message: 'This tool requires access to your example.com account. Open the link to authenticate!',
+ url: 'https://www.example.com/oauth/authorize',
+ elicitationId
+ }
+ ]);
+ });
+ return mcpServer;
+};
+const elicitationsMap = new Map();
+// Clean up old elicitations after 1 hour to prevent memory leaks
+const ELICITATION_TTL_MS = 60 * 60 * 1000; // 1 hour
+const CLEANUP_INTERVAL_MS = 10 * 60 * 1000; // 10 minutes
+function cleanupOldElicitations() {
+ const now = new Date();
+ for (const [id, metadata] of elicitationsMap.entries()) {
+ if (now.getTime() - metadata.createdAt.getTime() > ELICITATION_TTL_MS) {
+ elicitationsMap.delete(id);
+ console.log(`Cleaned up expired elicitation: ${id}`);
+ }
+ }
+}
+setInterval(cleanupOldElicitations, CLEANUP_INTERVAL_MS);
+/**
+ * Elicitation IDs must be unique strings within the MCP session
+ * UUIDs are used in this example for simplicity
+ */
+function generateElicitationId() {
+ return (0, node_crypto_1.randomUUID)();
+}
+/**
+ * Helper function to create and track a new elicitation.
+ */
+function generateTrackedElicitation(sessionId, createCompletionNotifier) {
+ const elicitationId = generateElicitationId();
+ // Create a Promise and its resolver for tracking completion
+ let completeResolver;
+ const completedPromise = new Promise(resolve => {
+ completeResolver = resolve;
+ });
+ const completionNotifier = createCompletionNotifier ? createCompletionNotifier(elicitationId) : undefined;
+ // Store the elicitation in our map
+ elicitationsMap.set(elicitationId, {
+ status: 'pending',
+ completedPromise,
+ completeResolver: completeResolver,
+ createdAt: new Date(),
+ sessionId,
+ completionNotifier
+ });
+ return elicitationId;
+}
+/**
+ * Helper function to complete an elicitation.
+ */
+function completeURLElicitation(elicitationId) {
+ const elicitation = elicitationsMap.get(elicitationId);
+ if (!elicitation) {
+ console.warn(`Attempted to complete unknown elicitation: ${elicitationId}`);
+ return;
+ }
+ if (elicitation.status === 'complete') {
+ console.warn(`Elicitation already complete: ${elicitationId}`);
+ return;
+ }
+ // Update metadata
+ elicitation.status = 'complete';
+ // Send completion notification to the client
+ if (elicitation.completionNotifier) {
+ console.log(`Sending notifications/elicitation/complete notification for elicitation ${elicitationId}`);
+ elicitation.completionNotifier().catch(error => {
+ console.error(`Failed to send completion notification for elicitation ${elicitationId}:`, error);
+ });
+ }
+ // Resolve the promise to unblock any waiting code
+ elicitation.completeResolver();
+}
+const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000;
+const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001;
+const app = (0, express_js_1.createMcpExpressApp)();
+// Allow CORS all domains, expose the Mcp-Session-Id header
+app.use((0, cors_1.default)({
+ origin: '*', // Allow all origins
+ exposedHeaders: ['Mcp-Session-Id'],
+ credentials: true // Allow cookies to be sent cross-origin
+}));
+// Set up OAuth (required for this example)
+let authMiddleware = null;
+// Create auth middleware for MCP endpoints
+const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`);
+const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`);
+const oauthMetadata = (0, demoInMemoryOAuthProvider_js_1.setupAuthServer)({ authServerUrl, mcpServerUrl, strictResource: true });
+const tokenVerifier = {
+ verifyAccessToken: async (token) => {
+ const endpoint = oauthMetadata.introspection_endpoint;
+ if (!endpoint) {
+ throw new Error('No token verification endpoint available in metadata');
+ }
+ const response = await fetch(endpoint, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ body: new URLSearchParams({
+ token: token
+ }).toString()
+ });
+ if (!response.ok) {
+ const text = await response.text().catch(() => null);
+ throw new Error(`Invalid or expired token: ${text}`);
+ }
+ const data = await response.json();
+ if (!data.aud) {
+ throw new Error(`Resource Indicator (RFC8707) missing`);
+ }
+ if (!(0, auth_utils_js_1.checkResourceAllowed)({ requestedResource: data.aud, configuredResource: mcpServerUrl })) {
+ throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`);
+ }
+ // Convert the response to AuthInfo format
+ return {
+ token,
+ clientId: data.client_id,
+ scopes: data.scope ? data.scope.split(' ') : [],
+ expiresAt: data.exp
+ };
+ }
+};
+// Add metadata routes to the main MCP server
+app.use((0, router_js_1.mcpAuthMetadataRouter)({
+ oauthMetadata,
+ resourceServerUrl: mcpServerUrl,
+ scopesSupported: ['mcp:tools'],
+ resourceName: 'MCP Demo Server'
+}));
+authMiddleware = (0, bearerAuth_js_1.requireBearerAuth)({
+ verifier: tokenVerifier,
+ requiredScopes: [],
+ resourceMetadataUrl: (0, router_js_1.getOAuthProtectedResourceMetadataUrl)(mcpServerUrl)
+});
+/**
+ * API Key Form Handling
+ *
+ * Many servers today require an API key to operate, but there's no scalable way to do this dynamically for remote servers within MCP protocol.
+ * URL-mode elicitation enables the server to host a simple form and get the secret data securely from the user without involving the LLM or client.
+ **/
+async function sendApiKeyElicitation(sessionId, sender, createCompletionNotifier) {
+ if (!sessionId) {
+ console.error('No session ID provided');
+ throw new Error('Expected a Session ID to track elicitation');
+ }
+ console.log('🔑 URL elicitation demo: Requesting API key from client...');
+ const elicitationId = generateTrackedElicitation(sessionId, createCompletionNotifier);
+ try {
+ const result = await sender({
+ mode: 'url',
+ message: 'Please provide your API key to authenticate with this server',
+ // Host the form on the same server. In a real app, you might coordinate passing these state variables differently.
+ url: `http://localhost:${MCP_PORT}/api-key-form?session=${sessionId}&elicitation=${elicitationId}`,
+ elicitationId
+ });
+ switch (result.action) {
+ case 'accept':
+ console.log('🔑 URL elicitation demo: Client accepted the API key elicitation (now pending form submission)');
+ // Wait for the API key to be submitted via the form
+ // The form submission will complete the elicitation
+ break;
+ default:
+ console.log('🔑 URL elicitation demo: Client declined to provide an API key');
+ // In a real app, this might close the connection, but for the demo, we'll continue
+ break;
+ }
+ }
+ catch (error) {
+ console.error('Error during API key elicitation:', error);
+ }
+}
+// API Key Form endpoint - serves a simple HTML form
+app.get('/api-key-form', (req, res) => {
+ const mcpSessionId = req.query.session;
+ const elicitationId = req.query.elicitation;
+ if (!mcpSessionId || !elicitationId) {
+ res.status(400).send('Error
Missing required parameters
');
+ return;
+ }
+ // Check for user session cookie
+ // In production, this is often handled by some user auth middleware to ensure the user has a valid session
+ // This session is different from the MCP session.
+ // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in.
+ const userSession = getUserSessionCookie(req.headers.cookie);
+ if (!userSession) {
+ res.status(401).send('Error
Unauthorized - please reconnect to login again
');
+ return;
+ }
+ // Serve a simple HTML form
+ res.send(`
+
+
+
+ Submit Your API Key
+
+
+
+ API Key Required
+ ✓ Logged in as: ${userSession.name}
+
+ This is a demo showing how a server can securely elicit sensitive data from a user using a URL.
+
+
+ `);
+});
+// Handle API key form submission
+app.post('/api-key-form', express_1.default.urlencoded(), (req, res) => {
+ const { session: sessionId, apiKey, elicitation: elicitationId } = req.body;
+ if (!sessionId || !apiKey || !elicitationId) {
+ res.status(400).send('Error
Missing required parameters
');
+ return;
+ }
+ // Check for user session cookie here too
+ const userSession = getUserSessionCookie(req.headers.cookie);
+ if (!userSession) {
+ res.status(401).send('Error
Unauthorized - please reconnect to login again
');
+ return;
+ }
+ // A real app might store this API key to be used later for the user.
+ console.log(`🔑 Received API key \x1b[32m${apiKey}\x1b[0m for session ${sessionId}`);
+ // If we have an elicitationId, complete the elicitation
+ completeURLElicitation(elicitationId);
+ // Send a success response
+ res.send(`
+
+
+
+ Success
+
+
+
+
+
Success ✓
+
API key received.
+
+ You can close this window and return to your MCP client.
+
+
+ `);
+});
+// Helper to get the user session from the demo_session cookie
+function getUserSessionCookie(cookieHeader) {
+ if (!cookieHeader)
+ return null;
+ const cookies = cookieHeader.split(';');
+ for (const cookie of cookies) {
+ const [name, value] = cookie.trim().split('=');
+ if (name === 'demo_session' && value) {
+ try {
+ return JSON.parse(decodeURIComponent(value));
+ }
+ catch (error) {
+ console.error('Failed to parse demo_session cookie:', error);
+ return null;
+ }
+ }
+ }
+ return null;
+}
+/**
+ * Payment Confirmation Form Handling
+ *
+ * This demonstrates how a server can use URL-mode elicitation to get user confirmation
+ * for sensitive operations like payment processing.
+ **/
+// Payment Confirmation Form endpoint - serves a simple HTML form
+app.get('/confirm-payment', (req, res) => {
+ const mcpSessionId = req.query.session;
+ const elicitationId = req.query.elicitation;
+ const cartId = req.query.cartId;
+ if (!mcpSessionId || !elicitationId) {
+ res.status(400).send('Error
Missing required parameters
');
+ return;
+ }
+ // Check for user session cookie
+ // In production, this is often handled by some user auth middleware to ensure the user has a valid session
+ // This session is different from the MCP session.
+ // This userSession is the cookie that the MCP Server's Authorization Server sets for the user when they log in.
+ const userSession = getUserSessionCookie(req.headers.cookie);
+ if (!userSession) {
+ res.status(401).send('Error
Unauthorized - please reconnect to login again
');
+ return;
+ }
+ // Serve a simple HTML form
+ res.send(`
+
+
+
+ Confirm Payment
+
+
+
+ Confirm Payment
+ ✓ Logged in as: ${userSession.name}
+ ${cartId ? `Cart ID: ${cartId}
` : ''}
+
+ ⚠️ Please review your order before confirming.
+
+
+ This is a demo showing how a server can securely get user confirmation for sensitive operations using URL-mode elicitation.
+
+
+ `);
+});
+// Handle Payment Confirmation form submission
+app.post('/confirm-payment', express_1.default.urlencoded(), (req, res) => {
+ const { session: sessionId, elicitation: elicitationId, cartId, action } = req.body;
+ if (!sessionId || !elicitationId) {
+ res.status(400).send('Error
Missing required parameters
');
+ return;
+ }
+ // Check for user session cookie here too
+ const userSession = getUserSessionCookie(req.headers.cookie);
+ if (!userSession) {
+ res.status(401).send('Error
Unauthorized - please reconnect to login again
');
+ return;
+ }
+ if (action === 'confirm') {
+ // A real app would process the payment here
+ console.log(`💳 Payment confirmed for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`);
+ // Complete the elicitation
+ completeURLElicitation(elicitationId);
+ // Send a success response
+ res.send(`
+
+
+
+ Payment Confirmed
+
+
+
+
+
Payment Confirmed ✓
+
Your payment has been successfully processed.
+ ${cartId ? `
Cart ID: ${cartId}
` : ''}
+
+ You can close this window and return to your MCP client.
+
+
+ `);
+ }
+ else if (action === 'cancel') {
+ console.log(`💳 Payment cancelled for cart ${cartId || 'unknown'} by user ${userSession.name} (session ${sessionId})`);
+ // The client will still receive a notifications/elicitation/complete notification,
+ // which indicates that the out-of-band interaction is complete (but not necessarily successful)
+ completeURLElicitation(elicitationId);
+ res.send(`
+
+
+
+ Payment Cancelled
+
+
+
+
+
Payment Cancelled
+
Your payment has been cancelled.
+
+ You can close this window and return to your MCP client.
+
+
+ `);
+ }
+ else {
+ res.status(400).send('Error
Invalid action
');
+ }
+});
+// Map to store transports by session ID
+const transports = {};
+const sessionsNeedingElicitation = {};
+// MCP POST endpoint
+const mcpPostHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ console.debug(`Received MCP POST for session: ${sessionId || 'unknown'}`);
+ try {
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Reuse existing transport
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
+ const server = getServer();
+ // New initialization request
+ const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore();
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ eventStore, // Enable resumability
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ // This avoids race conditions where requests might come in before the session is stored
+ console.log(`Session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ sessionsNeedingElicitation[sessionId] = {
+ elicitationSender: params => server.server.elicitInput(params),
+ createCompletionNotifier: elicitationId => server.server.createElicitationCompletionNotifier(elicitationId)
+ };
+ }
+ });
+ // Set up onclose handler to clean up transport when closed
+ transport.onclose = () => {
+ const sid = transport.sessionId;
+ if (sid && transports[sid]) {
+ console.log(`Transport closed for session ${sid}, removing from transports map`);
+ delete transports[sid];
+ delete sessionsNeedingElicitation[sid];
+ }
+ };
+ // Connect the transport to the MCP server BEFORE handling the request
+ // so responses can flow back through the same transport
+ await server.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ return; // Already handled
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with existing transport - no need to reconnect
+ // The existing transport is already connected to the server
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+};
+// Set up routes with auth middleware
+app.post('/mcp', authMiddleware, mcpPostHandler);
+// Handle GET requests for SSE streams (using built-in support from StreamableHTTP)
+const mcpGetHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ // Check for Last-Event-ID header for resumability
+ const lastEventId = req.headers['last-event-id'];
+ if (lastEventId) {
+ console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`);
+ }
+ else {
+ console.log(`Establishing new SSE stream for session ${sessionId}`);
+ }
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+ if (sessionsNeedingElicitation[sessionId]) {
+ const { elicitationSender, createCompletionNotifier } = sessionsNeedingElicitation[sessionId];
+ // Send an elicitation request to the client in the background
+ sendApiKeyElicitation(sessionId, elicitationSender, createCompletionNotifier)
+ .then(() => {
+ // Only delete on successful send for this demo
+ delete sessionsNeedingElicitation[sessionId];
+ console.log(`🔑 URL elicitation demo: Finished sending API key elicitation request for session ${sessionId}`);
+ })
+ .catch(error => {
+ console.error('Error sending API key elicitation:', error);
+ // Keep in map to potentially retry on next reconnect
+ });
+ }
+};
+// Set up GET route with conditional auth middleware
+app.get('/mcp', authMiddleware, mcpGetHandler);
+// Handle DELETE requests for session termination (according to MCP spec)
+const mcpDeleteHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Received session termination request for session ${sessionId}`);
+ try {
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+ }
+ catch (error) {
+ console.error('Error handling session termination:', error);
+ if (!res.headersSent) {
+ res.status(500).send('Error processing session termination');
+ }
+ }
+};
+// Set up DELETE route with auth middleware
+app.delete('/mcp', authMiddleware, mcpDeleteHandler);
+app.listen(MCP_PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ // Close all active transports to properly clean up resources
+ for (const sessionId in transports) {
+ try {
+ console.log(`Closing transport for session ${sessionId}`);
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ delete sessionsNeedingElicitation[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing transport for session ${sessionId}:`, error);
+ }
+ }
+ console.log('Server shutdown complete');
+ process.exit(0);
+});
+//# sourceMappingURL=elicitationUrlExample.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a37e1960a9898dea1fad42358826eba10210fc66
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/elicitationUrlExample.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"elicitationUrlExample.js","sourceRoot":"","sources":["../../../../src/examples/server/elicitationUrlExample.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,oDAAoD;AACpD,uFAAuF;AACvF,oCAAoC;AACpC,8FAA8F;AAC9F,kEAAkE;;;;;AAElE,sDAAqD;AACrD,6CAAyC;AACzC,6BAAwB;AACxB,gDAAgD;AAChD,wDAA8D;AAC9D,sEAA+E;AAC/E,2DAA0G;AAC1G,8EAA+E;AAC/E,6CAAwI;AACxI,2EAAqE;AACrE,iFAAiE;AAEjE,8DAAkE;AAElE,gDAAwB;AAExB,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,SAAS,GAAG,IAAI,kBAAS,CAC3B;QACI,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CAC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honoWebStandardStreamableHttp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..bc6abddea925f817fffa20d9f56c29e31ab60f4f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts
@@ -0,0 +1,10 @@
+/**
+ * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport
+ *
+ * This example demonstrates using the Web Standard transport directly with Hono,
+ * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc.
+ *
+ * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts
+ */
+export {};
+//# sourceMappingURL=honoWebStandardStreamableHttp.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a6a6199d6cb97299852ca5129c00a0cb8e64c307
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"honoWebStandardStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/honoWebStandardStreamableHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js
new file mode 100644
index 0000000000000000000000000000000000000000..b45127e72518bf1be73f1addf9c9f7be1a0c321a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js
@@ -0,0 +1,85 @@
+"use strict";
+/**
+ * Example MCP server using Hono with WebStandardStreamableHTTPServerTransport
+ *
+ * This example demonstrates using the Web Standard transport directly with Hono,
+ * which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc.
+ *
+ * Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const hono_1 = require("hono");
+const cors_1 = require("hono/cors");
+const node_server_1 = require("@hono/node-server");
+const z = __importStar(require("zod/v4"));
+const mcp_js_1 = require("../../server/mcp.js");
+const webStandardStreamableHttp_js_1 = require("../../server/webStandardStreamableHttp.js");
+// Factory function to create a new MCP server per request (stateless mode)
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'hono-webstandard-mcp-server',
+ version: '1.0.0'
+ });
+ // Register a simple greeting tool
+ server.registerTool('greet', {
+ title: 'Greeting Tool',
+ description: 'A simple greeting tool',
+ inputSchema: { name: z.string().describe('Name to greet') }
+ }, async ({ name }) => {
+ return {
+ content: [{ type: 'text', text: `Hello, ${name}! (from Hono + WebStandard transport)` }]
+ };
+ });
+ return server;
+};
+// Create the Hono app
+const app = new hono_1.Hono();
+// Enable CORS for all origins
+app.use('*', (0, cors_1.cors)({
+ origin: '*',
+ allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'],
+ allowHeaders: ['Content-Type', 'mcp-session-id', 'Last-Event-ID', 'mcp-protocol-version'],
+ exposeHeaders: ['mcp-session-id', 'mcp-protocol-version']
+}));
+// Health check endpoint
+app.get('/health', c => c.json({ status: 'ok' }));
+// MCP endpoint - create a fresh transport and server per request (stateless)
+app.all('/mcp', async (c) => {
+ const transport = new webStandardStreamableHttp_js_1.WebStandardStreamableHTTPServerTransport();
+ const server = getServer();
+ await server.connect(transport);
+ return transport.handleRequest(c.req.raw);
+});
+// Start the server
+const PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000;
+console.log(`Starting Hono MCP server on port ${PORT}`);
+console.log(`Health check: http://localhost:${PORT}/health`);
+console.log(`MCP endpoint: http://localhost:${PORT}/mcp`);
+(0, node_server_1.serve)({
+ fetch: app.fetch,
+ port: PORT
+});
+//# sourceMappingURL=honoWebStandardStreamableHttp.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..8c23f2714da667105f72a5d280253af9aba1af98
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/honoWebStandardStreamableHttp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"honoWebStandardStreamableHttp.js","sourceRoot":"","sources":["../../../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AE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAElD,6EAA6E;AAC7E,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAC,CAAC,EAAC,EAAE;IACtB,MAAM,SAAS,GAAG,IAAI,uEAAwC,EAAE,CAAC;IACjE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9E,OAAO,CAAC,GAAG,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;AACxD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,SAAS,CAAC,CAAC;AAC7D,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,MAAM,CAAC,CAAC;AAE1D,IAAA,mBAAK,EAAC;IACF,KAAK,EAAE,GAAG,CAAC,KAAK;IAChB,IAAI,EAAE,IAAI;CACb,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..477fa6bae78ab4762d7e4f41113fad8bf9d517a4
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=jsonResponseStreamableHttp.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ee8117ee2ea212d9edbd0da8ebabe662dd2458c1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"jsonResponseStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js
new file mode 100644
index 0000000000000000000000000000000000000000..ecd769b06d7e1d10e4daa4ffd210c7b2c94098c3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js
@@ -0,0 +1,171 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const z = __importStar(require("zod/v4"));
+const types_js_1 = require("../../types.js");
+const express_js_1 = require("../../server/express.js");
+// Create an MCP server with implementation details
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'json-response-streamable-http-server',
+ version: '1.0.0'
+ }, {
+ capabilities: {
+ logging: {}
+ }
+ });
+ // Register a simple tool that returns a greeting
+ server.registerTool('greet', {
+ description: 'A simple greeting tool',
+ inputSchema: {
+ name: z.string().describe('Name to greet')
+ }
+ }, async ({ name }) => {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Hello, ${name}!`
+ }
+ ]
+ };
+ });
+ // Register a tool that sends multiple greetings with notifications
+ server.registerTool('multi-greet', {
+ description: 'A tool that sends different greetings with delays between them',
+ inputSchema: {
+ name: z.string().describe('Name to greet')
+ }
+ }, async ({ name }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ await server.sendLoggingMessage({
+ level: 'debug',
+ data: `Starting multi-greet for ${name}`
+ }, extra.sessionId);
+ await sleep(1000); // Wait 1 second before first greeting
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Sending first greeting to ${name}`
+ }, extra.sessionId);
+ await sleep(1000); // Wait another second before second greeting
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Sending second greeting to ${name}`
+ }, extra.sessionId);
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Good morning, ${name}!`
+ }
+ ]
+ };
+ });
+ return server;
+};
+const app = (0, express_js_1.createMcpExpressApp)();
+// Map to store transports by session ID
+const transports = {};
+app.post('/mcp', async (req, res) => {
+ console.log('Received MCP request:', req.body);
+ try {
+ // Check for existing session ID
+ const sessionId = req.headers['mcp-session-id'];
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Reuse existing transport
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
+ // New initialization request - use JSON response mode
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ enableJsonResponse: true, // Enable JSON response mode
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ // This avoids race conditions where requests might come in before the session is stored
+ console.log(`Session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ }
+ });
+ // Connect the transport to the MCP server BEFORE handling the request
+ const server = getServer();
+ await server.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ return; // Already handled
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with existing transport - no need to reconnect
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+});
+// Handle GET requests for SSE streams according to spec
+app.get('/mcp', async (req, res) => {
+ // Since this is a very simple example, we don't support GET requests for this server
+ // The spec requires returning 405 Method Not Allowed in this case
+ res.status(405).set('Allow', 'POST').send('Method Not Allowed');
+});
+// Start the server
+const PORT = 3000;
+app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`MCP Streamable HTTP Server listening on port ${PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ process.exit(0);
+});
+//# sourceMappingURL=jsonResponseStreamableHttp.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..dd8782c1f1990815c4a4b7f72b982c86b1971938
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/jsonResponseStreamableHttp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"jsonResponseStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/jsonResponseStreamableHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,0CAA4B;AAC5B,6CAAqE;AACrE,wDAA8D;AAE9D,mDAAmD;AACnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,sCAAsC;QAC5C,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE;YACV,OAAO,EAAE,EAAE;SACd;KACJ,CACJ,CAAC;IAEF,iDAAiD;IACjD,MAAM,CAAC,YAAY,CACf,OAAO,EACP;QACI,WAAW,EAAE,wBAAwB;QACrC,WAAW,EAAE;YACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;SAC7C;KACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAA2B,EAAE;QACxC,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,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AC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gDAAgD,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a6cb49747339241967e4c3e2112ea2f187210692
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+/**
+ * Example MCP server using the high-level McpServer API with outputSchema
+ * This demonstrates how to easily create tools with structured output
+ */
+export {};
+//# sourceMappingURL=mcpServerOutputSchema.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bd3abdcc26440490239e5098117ebdbf4c520bbc
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mcpServerOutputSchema.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";AACA;;;GAGG"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js
new file mode 100644
index 0000000000000000000000000000000000000000..4ac7e5cdaecfbd7eddef1c78b9dda6d16a8432af
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js
@@ -0,0 +1,95 @@
+#!/usr/bin/env node
+"use strict";
+/**
+ * Example MCP server using the high-level McpServer API with outputSchema
+ * This demonstrates how to easily create tools with structured output
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mcp_js_1 = require("../../server/mcp.js");
+const stdio_js_1 = require("../../server/stdio.js");
+const z = __importStar(require("zod/v4"));
+const server = new mcp_js_1.McpServer({
+ name: 'mcp-output-schema-high-level-example',
+ version: '1.0.0'
+});
+// Define a tool with structured output - Weather data
+server.registerTool('get_weather', {
+ description: 'Get weather information for a city',
+ inputSchema: {
+ city: z.string().describe('City name'),
+ country: z.string().describe('Country code (e.g., US, UK)')
+ },
+ outputSchema: {
+ temperature: z.object({
+ celsius: z.number(),
+ fahrenheit: z.number()
+ }),
+ conditions: z.enum(['sunny', 'cloudy', 'rainy', 'stormy', 'snowy']),
+ humidity: z.number().min(0).max(100),
+ wind: z.object({
+ speed_kmh: z.number(),
+ direction: z.string()
+ })
+ }
+}, async ({ city, country }) => {
+ // Parameters are available but not used in this example
+ void city;
+ void country;
+ // Simulate weather API call
+ const temp_c = Math.round((Math.random() * 35 - 5) * 10) / 10;
+ const conditions = ['sunny', 'cloudy', 'rainy', 'stormy', 'snowy'][Math.floor(Math.random() * 5)];
+ const structuredContent = {
+ temperature: {
+ celsius: temp_c,
+ fahrenheit: Math.round(((temp_c * 9) / 5 + 32) * 10) / 10
+ },
+ conditions,
+ humidity: Math.round(Math.random() * 100),
+ wind: {
+ speed_kmh: Math.round(Math.random() * 50),
+ direction: ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'][Math.floor(Math.random() * 8)]
+ }
+ };
+ return {
+ content: [
+ {
+ type: 'text',
+ text: JSON.stringify(structuredContent, null, 2)
+ }
+ ],
+ structuredContent
+ };
+});
+async function main() {
+ const transport = new stdio_js_1.StdioServerTransport();
+ await server.connect(transport);
+ console.error('High-level Output Schema Example Server running on stdio');
+}
+main().catch(error => {
+ console.error('Server error:', error);
+ process.exit(1);
+});
+//# sourceMappingURL=mcpServerOutputSchema.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ba0f8b24c43abb17fb5b594656bd1847e52b6054
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/mcpServerOutputSchema.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mcpServerOutputSchema.js","sourceRoot":"","sources":["../../../../src/examples/server/mcpServerOutputSchema.ts"],"names":[],"mappings":";;AACA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAgD;AAChD,oDAA6D;AAC7D,0CAA4B;AAE5B,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IACzB,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,sDAAsD;AACtD,MAAM,CAAC,YAAY,CACf,aAAa,EACb;IACI,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC9D;IACD,YAAY,EAAE;QACV,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;YACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;SACzB,CAAC;QACF,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACpC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YACX,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;SACxB,CAAC;KACL;CACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACxB,wDAAwD;IACxD,KAAK,IAAI,CAAC;IACV,KAAK,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B,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b97c202898f532150e14e80fe7caf8539ce70fb
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts
@@ -0,0 +1,12 @@
+/**
+ * Example: Progress notifications over stdio.
+ *
+ * Demonstrates a tool that reports progress to the client while processing.
+ *
+ * Run:
+ * npx tsx src/examples/server/progressExample.ts
+ *
+ * Then connect a client with an `onprogress` callback (see docs/protocol.md).
+ */
+export {};
+//# sourceMappingURL=progressExample.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..590e57d7cc1b373ca6c8affa3fa3a03077fa6b36
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"progressExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/progressExample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js
new file mode 100644
index 0000000000000000000000000000000000000000..041f2139a783d1ef90ec1aa844b0e2fb352b055c
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js
@@ -0,0 +1,49 @@
+"use strict";
+/**
+ * Example: Progress notifications over stdio.
+ *
+ * Demonstrates a tool that reports progress to the client while processing.
+ *
+ * Run:
+ * npx tsx src/examples/server/progressExample.ts
+ *
+ * Then connect a client with an `onprogress` callback (see docs/protocol.md).
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+const mcp_js_1 = require("../../server/mcp.js");
+const stdio_js_1 = require("../../server/stdio.js");
+const zod_1 = require("zod");
+const server = new mcp_js_1.McpServer({ name: 'progress-example', version: '1.0.0' }, { capabilities: { logging: {} } });
+server.registerTool('count', {
+ description: 'Count to N with progress updates',
+ inputSchema: { n: zod_1.z.number().int().min(1).max(100) }
+}, async ({ n }, extra) => {
+ for (let i = 1; i <= n; i++) {
+ if (extra.signal.aborted) {
+ return { content: [{ type: 'text', text: `Cancelled at ${i}` }], isError: true };
+ }
+ if (extra._meta?.progressToken !== undefined) {
+ await extra.sendNotification({
+ method: 'notifications/progress',
+ params: {
+ progressToken: extra._meta.progressToken,
+ progress: i,
+ total: n,
+ message: `Counting: ${i}/${n}`
+ }
+ });
+ }
+ // Simulate work
+ await new Promise(resolve => setTimeout(resolve, 100));
+ }
+ return { content: [{ type: 'text', text: `Counted to ${n}` }] };
+});
+async function main() {
+ const transport = new stdio_js_1.StdioServerTransport();
+ await server.connect(transport);
+}
+main().catch(error => {
+ console.error('Server error:', error);
+ process.exit(1);
+});
+//# sourceMappingURL=progressExample.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..e8475e90d22a1b726ebdf1063cd444622e35085b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/progressExample.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"progressExample.js","sourceRoot":"","sources":["../../../../src/examples/server/progressExample.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAEH,gDAAgD;AAChD,oDAA6D;AAC7D,6BAAwB;AAExB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAEhH,MAAM,CAAC,YAAY,CACf,OAAO,EACP;IACI,WAAW,EAAE,kCAAkC;IAC/C,WAAW,EAAE,EAAE,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;CACvD,EACD,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACvB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACrF,CAAC;QAED,IAAI,KAAK,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;YAC3C,MAAM,KAAK,CAAC,gBAAgB,CAAC;gBACzB,MAAM,EAAE,wBAAwB;gBAChC,MAAM,EAAE;oBACJ,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa;oBACxC,QAAQ,EAAE,CAAC;oBACX,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE;iBACjC;aACJ,CAAC,CAAC;QACP,CAAC;QAED,gBAAgB;QAChB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpE,CAAC,CACJ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4269b7814f9af770ca78c5cf27f8e852320bc9b2
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=simpleSseServer.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..08a1b450215d665ccafe7b987b62dfa17c95f281
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleSseServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js
new file mode 100644
index 0000000000000000000000000000000000000000..ed1efd5e3cc9e2276aee7590f45c594fb558460b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js
@@ -0,0 +1,168 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mcp_js_1 = require("../../server/mcp.js");
+const sse_js_1 = require("../../server/sse.js");
+const z = __importStar(require("zod/v4"));
+const express_js_1 = require("../../server/express.js");
+/**
+ * This example server demonstrates the deprecated HTTP+SSE transport
+ * (protocol version 2024-11-05). It mainly used for testing backward compatible clients.
+ *
+ * The server exposes two endpoints:
+ * - /mcp: For establishing the SSE stream (GET)
+ * - /messages: For receiving client messages (POST)
+ *
+ */
+// Create an MCP server instance
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'simple-sse-server',
+ version: '1.0.0'
+ }, { capabilities: { logging: {} } });
+ server.registerTool('start-notification-stream', {
+ description: 'Starts sending periodic notifications',
+ inputSchema: {
+ interval: z.number().describe('Interval in milliseconds between notifications').default(1000),
+ count: z.number().describe('Number of notifications to send').default(10)
+ }
+ }, async ({ interval, count }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ let counter = 0;
+ // Send the initial notification
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Starting notification stream with ${count} messages every ${interval}ms`
+ }, extra.sessionId);
+ // Send periodic notifications
+ while (counter < count) {
+ counter++;
+ await sleep(interval);
+ try {
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Notification #${counter} at ${new Date().toISOString()}`
+ }, extra.sessionId);
+ }
+ catch (error) {
+ console.error('Error sending notification:', error);
+ }
+ }
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Completed sending ${count} notifications every ${interval}ms`
+ }
+ ]
+ };
+ });
+ return server;
+};
+const app = (0, express_js_1.createMcpExpressApp)();
+// Store transports by session ID
+const transports = {};
+// SSE endpoint for establishing the stream
+app.get('/mcp', async (req, res) => {
+ console.log('Received GET request to /sse (establishing SSE stream)');
+ try {
+ // Create a new SSE transport for the client
+ // The endpoint for POST messages is '/messages'
+ const transport = new sse_js_1.SSEServerTransport('/messages', res);
+ // Store the transport by session ID
+ const sessionId = transport.sessionId;
+ transports[sessionId] = transport;
+ // Set up onclose handler to clean up transport when closed
+ transport.onclose = () => {
+ console.log(`SSE transport closed for session ${sessionId}`);
+ delete transports[sessionId];
+ };
+ // Connect the transport to the MCP server
+ const server = getServer();
+ await server.connect(transport);
+ console.log(`Established SSE stream with session ID: ${sessionId}`);
+ }
+ catch (error) {
+ console.error('Error establishing SSE stream:', error);
+ if (!res.headersSent) {
+ res.status(500).send('Error establishing SSE stream');
+ }
+ }
+});
+// Messages endpoint for receiving client JSON-RPC requests
+app.post('/messages', async (req, res) => {
+ console.log('Received POST request to /messages');
+ // Extract session ID from URL query parameter
+ // In the SSE protocol, this is added by the client based on the endpoint event
+ const sessionId = req.query.sessionId;
+ if (!sessionId) {
+ console.error('No session ID provided in request URL');
+ res.status(400).send('Missing sessionId parameter');
+ return;
+ }
+ const transport = transports[sessionId];
+ if (!transport) {
+ console.error(`No active transport found for session ID: ${sessionId}`);
+ res.status(404).send('Session not found');
+ return;
+ }
+ try {
+ // Handle the POST message with the transport
+ await transport.handlePostMessage(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling request:', error);
+ if (!res.headersSent) {
+ res.status(500).send('Error handling request');
+ }
+ }
+});
+// Start the server
+const PORT = 3000;
+app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ // Close all active transports to properly clean up resources
+ for (const sessionId in transports) {
+ try {
+ console.log(`Closing transport for session ${sessionId}`);
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing transport for session ${sessionId}:`, error);
+ }
+ }
+ console.log('Server shutdown complete');
+ process.exit(0);
+});
+//# sourceMappingURL=simpleSseServer.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..e3a334c735d1d3a5d887b55bd33ec9880e80e9d7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleSseServer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleSseServer.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleSseServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAgD;AAChD,gDAAyD;AACzD,0CAA4B;AAE5B,wDAA8D;AAE9D;;;;;;;;GAQG;AAEH,gCAAgC;AAChC,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,OAAO;KACnB,EACD,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CACpC,CAAC;IAEF,MAAM,CAAC,YAAY,CACf,2BAA2B,EAC3B;QACI,WAAW,EAAE,uCAAuC;QACpD,WAAW,EAAE;YACT,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;YAC7F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;SAC5E;KACJ,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAA2B,EAAE;QAC1D,MAAM,KAAK,GAAG,CAAC,EAAU,EAA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AM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0aa4ad243947efc51b6a3a17883629d40858de58
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=simpleStatelessStreamableHttp.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..92deb06ecbca3ab1d8edadc4dfc9c7c2da096d41
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleStatelessStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js
new file mode 100644
index 0000000000000000000000000000000000000000..87601ab9712274ed4767731563f0660f12c5c5e6
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js
@@ -0,0 +1,166 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const z = __importStar(require("zod/v4"));
+const express_js_1 = require("../../server/express.js");
+const getServer = () => {
+ // Create an MCP server with implementation details
+ const server = new mcp_js_1.McpServer({
+ name: 'stateless-streamable-http-server',
+ version: '1.0.0'
+ }, { capabilities: { logging: {} } });
+ // Register a simple prompt
+ server.registerPrompt('greeting-template', {
+ description: 'A simple greeting prompt template',
+ argsSchema: {
+ name: z.string().describe('Name to include in greeting')
+ }
+ }, async ({ name }) => {
+ return {
+ messages: [
+ {
+ role: 'user',
+ content: {
+ type: 'text',
+ text: `Please greet ${name} in a friendly manner.`
+ }
+ }
+ ]
+ };
+ });
+ // Register a tool specifically for testing resumability
+ server.registerTool('start-notification-stream', {
+ description: 'Starts sending periodic notifications for testing resumability',
+ inputSchema: {
+ interval: z.number().describe('Interval in milliseconds between notifications').default(100),
+ count: z.number().describe('Number of notifications to send (0 for 100)').default(10)
+ }
+ }, async ({ interval, count }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ let counter = 0;
+ while (count === 0 || counter < count) {
+ counter++;
+ try {
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Periodic notification #${counter} at ${new Date().toISOString()}`
+ }, extra.sessionId);
+ }
+ catch (error) {
+ console.error('Error sending notification:', error);
+ }
+ // Wait for the specified interval
+ await sleep(interval);
+ }
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Started sending periodic notifications every ${interval}ms`
+ }
+ ]
+ };
+ });
+ // Create a simple resource at a fixed URI
+ server.registerResource('greeting-resource', 'https://example.com/greetings/default', { mimeType: 'text/plain' }, async () => {
+ return {
+ contents: [
+ {
+ uri: 'https://example.com/greetings/default',
+ text: 'Hello, world!'
+ }
+ ]
+ };
+ });
+ return server;
+};
+const app = (0, express_js_1.createMcpExpressApp)();
+app.post('/mcp', async (req, res) => {
+ const server = getServer();
+ try {
+ const transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: undefined
+ });
+ await server.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ res.on('close', () => {
+ console.log('Request closed');
+ transport.close();
+ server.close();
+ });
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+});
+app.get('/mcp', async (req, res) => {
+ console.log('Received GET MCP request');
+ res.writeHead(405).end(JSON.stringify({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Method not allowed.'
+ },
+ id: null
+ }));
+});
+app.delete('/mcp', async (req, res) => {
+ console.log('Received DELETE MCP request');
+ res.writeHead(405).end(JSON.stringify({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Method not allowed.'
+ },
+ id: null
+ }));
+});
+// Start the server
+const PORT = 3000;
+app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ process.exit(0);
+});
+//# sourceMappingURL=simpleStatelessStreamableHttp.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..e87774a9a97ea87deb8b3d2a2c77aca1d1005157
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStatelessStreamableHttp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleStatelessStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleStatelessStreamableHttp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAAgD;AAChD,sEAA+E;AAC/E,0CAA4B;AAE5B,wDAA8D;AAE9D,MAAM,SAAS,GAAG,GAA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6BAA6B,CAAC,CAAC;IAC3C,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAClB,IAAI,CAAC,SAAS,CAAC;QACX,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACH,IAAI,EAAE,CAAC,KAAK;YACZ,OAAO,EAAE,qBAAqB;SACjC;QACD,EAAE,EAAE,IAAI;KACX,CAAC,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0DAA0D,IAAI,EAAE,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a20be42ca4eae044a65c32eb9927534a94a51972
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=simpleStreamableHttp.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e3cf042241ab68638698bd75ba7d386da08226b7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleStreamableHttp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js
new file mode 100644
index 0000000000000000000000000000000000000000..5e79893b23003ff07a6673ca813551507a6ee5a1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js
@@ -0,0 +1,750 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const z = __importStar(require("zod/v4"));
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const router_js_1 = require("../../server/auth/router.js");
+const bearerAuth_js_1 = require("../../server/auth/middleware/bearerAuth.js");
+const express_js_1 = require("../../server/express.js");
+const types_js_1 = require("../../types.js");
+const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js");
+const in_memory_js_1 = require("../../experimental/tasks/stores/in-memory.js");
+const demoInMemoryOAuthProvider_js_1 = require("./demoInMemoryOAuthProvider.js");
+const auth_utils_js_1 = require("../../shared/auth-utils.js");
+// Check for OAuth flag
+const useOAuth = process.argv.includes('--oauth');
+const strictOAuth = process.argv.includes('--oauth-strict');
+// Create shared task store for demonstration
+const taskStore = new in_memory_js_1.InMemoryTaskStore();
+// Create an MCP server with implementation details
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'simple-streamable-http-server',
+ version: '1.0.0',
+ icons: [{ src: './mcp.svg', sizes: ['512x512'], mimeType: 'image/svg+xml' }],
+ websiteUrl: 'https://github.com/modelcontextprotocol/typescript-sdk'
+ }, {
+ capabilities: { logging: {}, tasks: { requests: { tools: { call: {} } } } },
+ taskStore, // Enable task support
+ taskMessageQueue: new in_memory_js_1.InMemoryTaskMessageQueue()
+ });
+ // Register a simple tool that returns a greeting
+ server.registerTool('greet', {
+ title: 'Greeting Tool', // Display name for UI
+ description: 'A simple greeting tool',
+ inputSchema: {
+ name: z.string().describe('Name to greet')
+ }
+ }, async ({ name }) => {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Hello, ${name}!`
+ }
+ ]
+ };
+ });
+ // Register a tool that sends multiple greetings with notifications (with annotations)
+ server.registerTool('multi-greet', {
+ description: 'A tool that sends different greetings with delays between them',
+ inputSchema: {
+ name: z.string().describe('Name to greet')
+ },
+ annotations: {
+ title: 'Multiple Greeting Tool',
+ readOnlyHint: true,
+ openWorldHint: false
+ }
+ }, async ({ name }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ await server.sendLoggingMessage({
+ level: 'debug',
+ data: `Starting multi-greet for ${name}`
+ }, extra.sessionId);
+ await sleep(1000); // Wait 1 second before first greeting
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Sending first greeting to ${name}`
+ }, extra.sessionId);
+ await sleep(1000); // Wait another second before second greeting
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Sending second greeting to ${name}`
+ }, extra.sessionId);
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Good morning, ${name}!`
+ }
+ ]
+ };
+ });
+ // Register a tool that demonstrates form elicitation (user input collection with a schema)
+ // This creates a closure that captures the server instance
+ server.registerTool('collect-user-info', {
+ description: 'A tool that collects user information through form elicitation',
+ inputSchema: {
+ infoType: z.enum(['contact', 'preferences', 'feedback']).describe('Type of information to collect')
+ }
+ }, async ({ infoType }, extra) => {
+ let message;
+ let requestedSchema;
+ switch (infoType) {
+ case 'contact':
+ message = 'Please provide your contact information';
+ requestedSchema = {
+ type: 'object',
+ properties: {
+ name: {
+ type: 'string',
+ title: 'Full Name',
+ description: 'Your full name'
+ },
+ email: {
+ type: 'string',
+ title: 'Email Address',
+ description: 'Your email address',
+ format: 'email'
+ },
+ phone: {
+ type: 'string',
+ title: 'Phone Number',
+ description: 'Your phone number (optional)'
+ }
+ },
+ required: ['name', 'email']
+ };
+ break;
+ case 'preferences':
+ message = 'Please set your preferences';
+ requestedSchema = {
+ type: 'object',
+ properties: {
+ theme: {
+ type: 'string',
+ title: 'Theme',
+ description: 'Choose your preferred theme',
+ enum: ['light', 'dark', 'auto'],
+ enumNames: ['Light', 'Dark', 'Auto']
+ },
+ notifications: {
+ type: 'boolean',
+ title: 'Enable Notifications',
+ description: 'Would you like to receive notifications?',
+ default: true
+ },
+ frequency: {
+ type: 'string',
+ title: 'Notification Frequency',
+ description: 'How often would you like notifications?',
+ enum: ['daily', 'weekly', 'monthly'],
+ enumNames: ['Daily', 'Weekly', 'Monthly']
+ }
+ },
+ required: ['theme']
+ };
+ break;
+ case 'feedback':
+ message = 'Please provide your feedback';
+ requestedSchema = {
+ type: 'object',
+ properties: {
+ rating: {
+ type: 'integer',
+ title: 'Rating',
+ description: 'Rate your experience (1-5)',
+ minimum: 1,
+ maximum: 5
+ },
+ comments: {
+ type: 'string',
+ title: 'Comments',
+ description: 'Additional comments (optional)',
+ maxLength: 500
+ },
+ recommend: {
+ type: 'boolean',
+ title: 'Would you recommend this?',
+ description: 'Would you recommend this to others?'
+ }
+ },
+ required: ['rating', 'recommend']
+ };
+ break;
+ default:
+ throw new Error(`Unknown info type: ${infoType}`);
+ }
+ try {
+ // Use sendRequest through the extra parameter to elicit input
+ const result = await extra.sendRequest({
+ method: 'elicitation/create',
+ params: {
+ mode: 'form',
+ message,
+ requestedSchema
+ }
+ }, types_js_1.ElicitResultSchema);
+ if (result.action === 'accept') {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Thank you! Collected ${infoType} information: ${JSON.stringify(result.content, null, 2)}`
+ }
+ ]
+ };
+ }
+ else if (result.action === 'decline') {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `No information was collected. User declined ${infoType} information request.`
+ }
+ ]
+ };
+ }
+ else {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Information collection was cancelled by the user.`
+ }
+ ]
+ };
+ }
+ }
+ catch (error) {
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Error collecting ${infoType} information: ${error}`
+ }
+ ]
+ };
+ }
+ });
+ // Register a tool that demonstrates bidirectional task support:
+ // Server creates a task, then elicits input from client using elicitInputStream
+ // Using the experimental tasks API - WARNING: may change without notice
+ server.experimental.tasks.registerToolTask('collect-user-info-task', {
+ title: 'Collect Info with Task',
+ description: 'Collects user info via elicitation with task support using elicitInputStream',
+ inputSchema: {
+ infoType: z.enum(['contact', 'preferences']).describe('Type of information to collect').default('contact')
+ }
+ }, {
+ async createTask({ infoType }, { taskStore: createTaskStore, taskRequestedTtl }) {
+ // Create the server-side task
+ const task = await createTaskStore.createTask({
+ ttl: taskRequestedTtl
+ });
+ // Perform async work that makes a nested elicitation request using elicitInputStream
+ (async () => {
+ try {
+ const message = infoType === 'contact' ? 'Please provide your contact information' : 'Please set your preferences';
+ // Define schemas with proper typing for PrimitiveSchemaDefinition
+ const contactSchema = {
+ type: 'object',
+ properties: {
+ name: { type: 'string', title: 'Full Name', description: 'Your full name' },
+ email: { type: 'string', title: 'Email', description: 'Your email address' }
+ },
+ required: ['name', 'email']
+ };
+ const preferencesSchema = {
+ type: 'object',
+ properties: {
+ theme: { type: 'string', title: 'Theme', enum: ['light', 'dark', 'auto'] },
+ notifications: { type: 'boolean', title: 'Enable Notifications', default: true }
+ },
+ required: ['theme']
+ };
+ const requestedSchema = infoType === 'contact' ? contactSchema : preferencesSchema;
+ // Use elicitInputStream to elicit input from client
+ // This demonstrates the streaming elicitation API
+ // Access via server.server to get the underlying Server instance
+ const stream = server.server.experimental.tasks.elicitInputStream({
+ mode: 'form',
+ message,
+ requestedSchema
+ });
+ let elicitResult;
+ for await (const msg of stream) {
+ if (msg.type === 'result') {
+ elicitResult = msg.result;
+ }
+ else if (msg.type === 'error') {
+ throw msg.error;
+ }
+ }
+ if (!elicitResult) {
+ throw new Error('No result received from elicitation');
+ }
+ let resultText;
+ if (elicitResult.action === 'accept') {
+ resultText = `Collected ${infoType} info: ${JSON.stringify(elicitResult.content, null, 2)}`;
+ }
+ else if (elicitResult.action === 'decline') {
+ resultText = `User declined to provide ${infoType} information`;
+ }
+ else {
+ resultText = 'User cancelled the request';
+ }
+ await taskStore.storeTaskResult(task.taskId, 'completed', {
+ content: [{ type: 'text', text: resultText }]
+ });
+ }
+ catch (error) {
+ console.error('Error in collect-user-info-task:', error);
+ await taskStore.storeTaskResult(task.taskId, 'failed', {
+ content: [{ type: 'text', text: `Error: ${error}` }],
+ isError: true
+ });
+ }
+ })();
+ return { task };
+ },
+ async getTask(_args, { taskId, taskStore: getTaskStore }) {
+ return await getTaskStore.getTask(taskId);
+ },
+ async getTaskResult(_args, { taskId, taskStore: getResultTaskStore }) {
+ const result = await getResultTaskStore.getTaskResult(taskId);
+ return result;
+ }
+ });
+ // Register a simple prompt with title
+ server.registerPrompt('greeting-template', {
+ title: 'Greeting Template', // Display name for UI
+ description: 'A simple greeting prompt template',
+ argsSchema: {
+ name: z.string().describe('Name to include in greeting')
+ }
+ }, async ({ name }) => {
+ return {
+ messages: [
+ {
+ role: 'user',
+ content: {
+ type: 'text',
+ text: `Please greet ${name} in a friendly manner.`
+ }
+ }
+ ]
+ };
+ });
+ // Register a tool specifically for testing resumability
+ server.registerTool('start-notification-stream', {
+ description: 'Starts sending periodic notifications for testing resumability',
+ inputSchema: {
+ interval: z.number().describe('Interval in milliseconds between notifications').default(100),
+ count: z.number().describe('Number of notifications to send (0 for 100)').default(50)
+ }
+ }, async ({ interval, count }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ let counter = 0;
+ while (count === 0 || counter < count) {
+ counter++;
+ try {
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Periodic notification #${counter} at ${new Date().toISOString()}`
+ }, extra.sessionId);
+ }
+ catch (error) {
+ console.error('Error sending notification:', error);
+ }
+ // Wait for the specified interval
+ await sleep(interval);
+ }
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Started sending periodic notifications every ${interval}ms`
+ }
+ ]
+ };
+ });
+ // Create a simple resource at a fixed URI
+ server.registerResource('greeting-resource', 'https://example.com/greetings/default', {
+ title: 'Default Greeting', // Display name for UI
+ description: 'A simple greeting resource',
+ mimeType: 'text/plain'
+ }, async () => {
+ return {
+ contents: [
+ {
+ uri: 'https://example.com/greetings/default',
+ text: 'Hello, world!'
+ }
+ ]
+ };
+ });
+ // Create additional resources for ResourceLink demonstration
+ server.registerResource('example-file-1', 'file:///example/file1.txt', {
+ title: 'Example File 1',
+ description: 'First example file for ResourceLink demonstration',
+ mimeType: 'text/plain'
+ }, async () => {
+ return {
+ contents: [
+ {
+ uri: 'file:///example/file1.txt',
+ text: 'This is the content of file 1'
+ }
+ ]
+ };
+ });
+ server.registerResource('example-file-2', 'file:///example/file2.txt', {
+ title: 'Example File 2',
+ description: 'Second example file for ResourceLink demonstration',
+ mimeType: 'text/plain'
+ }, async () => {
+ return {
+ contents: [
+ {
+ uri: 'file:///example/file2.txt',
+ text: 'This is the content of file 2'
+ }
+ ]
+ };
+ });
+ // Register a tool that returns ResourceLinks
+ server.registerTool('list-files', {
+ title: 'List Files with ResourceLinks',
+ description: 'Returns a list of files as ResourceLinks without embedding their content',
+ inputSchema: {
+ includeDescriptions: z.boolean().optional().describe('Whether to include descriptions in the resource links')
+ }
+ }, async ({ includeDescriptions = true }) => {
+ const resourceLinks = [
+ {
+ type: 'resource_link',
+ uri: 'https://example.com/greetings/default',
+ name: 'Default Greeting',
+ mimeType: 'text/plain',
+ ...(includeDescriptions && { description: 'A simple greeting resource' })
+ },
+ {
+ type: 'resource_link',
+ uri: 'file:///example/file1.txt',
+ name: 'Example File 1',
+ mimeType: 'text/plain',
+ ...(includeDescriptions && { description: 'First example file for ResourceLink demonstration' })
+ },
+ {
+ type: 'resource_link',
+ uri: 'file:///example/file2.txt',
+ name: 'Example File 2',
+ mimeType: 'text/plain',
+ ...(includeDescriptions && { description: 'Second example file for ResourceLink demonstration' })
+ }
+ ];
+ return {
+ content: [
+ {
+ type: 'text',
+ text: 'Here are the available files as resource links:'
+ },
+ ...resourceLinks,
+ {
+ type: 'text',
+ text: '\nYou can read any of these resources using their URI.'
+ }
+ ]
+ };
+ });
+ // Register a long-running tool that demonstrates task execution
+ // Using the experimental tasks API - WARNING: may change without notice
+ server.experimental.tasks.registerToolTask('delay', {
+ title: 'Delay',
+ description: 'A simple tool that delays for a specified duration, useful for testing task execution',
+ inputSchema: {
+ duration: z.number().describe('Duration in milliseconds').default(5000)
+ }
+ }, {
+ async createTask({ duration }, { taskStore, taskRequestedTtl }) {
+ // Create the task
+ const task = await taskStore.createTask({
+ ttl: taskRequestedTtl
+ });
+ // Simulate out-of-band work
+ (async () => {
+ await new Promise(resolve => setTimeout(resolve, duration));
+ await taskStore.storeTaskResult(task.taskId, 'completed', {
+ content: [
+ {
+ type: 'text',
+ text: `Completed ${duration}ms delay`
+ }
+ ]
+ });
+ })();
+ // Return CreateTaskResult with the created task
+ return {
+ task
+ };
+ },
+ async getTask(_args, { taskId, taskStore }) {
+ return await taskStore.getTask(taskId);
+ },
+ async getTaskResult(_args, { taskId, taskStore }) {
+ const result = await taskStore.getTaskResult(taskId);
+ return result;
+ }
+ });
+ return server;
+};
+const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000;
+const AUTH_PORT = process.env.MCP_AUTH_PORT ? parseInt(process.env.MCP_AUTH_PORT, 10) : 3001;
+const app = (0, express_js_1.createMcpExpressApp)();
+// Set up OAuth if enabled
+let authMiddleware = null;
+if (useOAuth) {
+ // Create auth middleware for MCP endpoints
+ const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`);
+ const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`);
+ const oauthMetadata = (0, demoInMemoryOAuthProvider_js_1.setupAuthServer)({ authServerUrl, mcpServerUrl, strictResource: strictOAuth });
+ const tokenVerifier = {
+ verifyAccessToken: async (token) => {
+ const endpoint = oauthMetadata.introspection_endpoint;
+ if (!endpoint) {
+ throw new Error('No token verification endpoint available in metadata');
+ }
+ const response = await fetch(endpoint, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ body: new URLSearchParams({
+ token: token
+ }).toString()
+ });
+ if (!response.ok) {
+ const text = await response.text().catch(() => null);
+ throw new Error(`Invalid or expired token: ${text}`);
+ }
+ const data = await response.json();
+ if (strictOAuth) {
+ if (!data.aud) {
+ throw new Error(`Resource Indicator (RFC8707) missing`);
+ }
+ if (!(0, auth_utils_js_1.checkResourceAllowed)({ requestedResource: data.aud, configuredResource: mcpServerUrl })) {
+ throw new Error(`Expected resource indicator ${mcpServerUrl}, got: ${data.aud}`);
+ }
+ }
+ // Convert the response to AuthInfo format
+ return {
+ token,
+ clientId: data.client_id,
+ scopes: data.scope ? data.scope.split(' ') : [],
+ expiresAt: data.exp
+ };
+ }
+ };
+ // Add metadata routes to the main MCP server
+ app.use((0, router_js_1.mcpAuthMetadataRouter)({
+ oauthMetadata,
+ resourceServerUrl: mcpServerUrl,
+ scopesSupported: ['mcp:tools'],
+ resourceName: 'MCP Demo Server'
+ }));
+ authMiddleware = (0, bearerAuth_js_1.requireBearerAuth)({
+ verifier: tokenVerifier,
+ requiredScopes: [],
+ resourceMetadataUrl: (0, router_js_1.getOAuthProtectedResourceMetadataUrl)(mcpServerUrl)
+ });
+}
+// Map to store transports by session ID
+const transports = {};
+// MCP POST endpoint with optional auth
+const mcpPostHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (sessionId) {
+ console.log(`Received MCP request for session: ${sessionId}`);
+ }
+ else {
+ console.log('Request body:', req.body);
+ }
+ if (useOAuth && req.auth) {
+ console.log('Authenticated user:', req.auth);
+ }
+ try {
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Reuse existing transport
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
+ // New initialization request
+ const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore();
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ eventStore, // Enable resumability
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ // This avoids race conditions where requests might come in before the session is stored
+ console.log(`Session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ }
+ });
+ // Set up onclose handler to clean up transport when closed
+ transport.onclose = () => {
+ const sid = transport.sessionId;
+ if (sid && transports[sid]) {
+ console.log(`Transport closed for session ${sid}, removing from transports map`);
+ delete transports[sid];
+ }
+ };
+ // Connect the transport to the MCP server BEFORE handling the request
+ // so responses can flow back through the same transport
+ const server = getServer();
+ await server.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ return; // Already handled
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with existing transport - no need to reconnect
+ // The existing transport is already connected to the server
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+};
+// Set up routes with conditional auth middleware
+if (useOAuth && authMiddleware) {
+ app.post('/mcp', authMiddleware, mcpPostHandler);
+}
+else {
+ app.post('/mcp', mcpPostHandler);
+}
+// Handle GET requests for SSE streams (using built-in support from StreamableHTTP)
+const mcpGetHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ if (useOAuth && req.auth) {
+ console.log('Authenticated SSE connection from user:', req.auth);
+ }
+ // Check for Last-Event-ID header for resumability
+ const lastEventId = req.headers['last-event-id'];
+ if (lastEventId) {
+ console.log(`Client reconnecting with Last-Event-ID: ${lastEventId}`);
+ }
+ else {
+ console.log(`Establishing new SSE stream for session ${sessionId}`);
+ }
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+};
+// Set up GET route with conditional auth middleware
+if (useOAuth && authMiddleware) {
+ app.get('/mcp', authMiddleware, mcpGetHandler);
+}
+else {
+ app.get('/mcp', mcpGetHandler);
+}
+// Handle DELETE requests for session termination (according to MCP spec)
+const mcpDeleteHandler = async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Received session termination request for session ${sessionId}`);
+ try {
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+ }
+ catch (error) {
+ console.error('Error handling session termination:', error);
+ if (!res.headersSent) {
+ res.status(500).send('Error processing session termination');
+ }
+ }
+};
+// Set up DELETE route with conditional auth middleware
+if (useOAuth && authMiddleware) {
+ app.delete('/mcp', authMiddleware, mcpDeleteHandler);
+}
+else {
+ app.delete('/mcp', mcpDeleteHandler);
+}
+app.listen(MCP_PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`MCP Streamable HTTP Server listening on port ${MCP_PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ // Close all active transports to properly clean up resources
+ for (const sessionId in transports) {
+ try {
+ console.log(`Closing transport for session ${sessionId}`);
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing transport for session ${sessionId}:`, error);
+ }
+ }
+ console.log('Server shutdown complete');
+ process.exit(0);
+});
+//# sourceMappingURL=simpleStreamableHttp.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..64486a8bdf07a8d0d9d981b39895c2919364fdc4
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleStreamableHttp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleStreamableHttp.js","sourceRoot":"","sources":["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AAE,KAAK,CAAC,EAAE;IACzB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,gDAAgD,QAAQ,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..661c9f010c27483235ec25eafbc09a39f4160b1e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts
@@ -0,0 +1,12 @@
+/**
+ * Simple interactive task server demonstrating elicitation and sampling.
+ *
+ * This server demonstrates the task message queue pattern from the MCP Tasks spec:
+ * - confirm_delete: Uses elicitation to ask the user for confirmation
+ * - write_haiku: Uses sampling to request an LLM to generate content
+ *
+ * Both tools use the "call-now, fetch-later" pattern where the initial call
+ * creates a task, and the result is fetched via tasks/result endpoint.
+ */
+export {};
+//# sourceMappingURL=simpleTaskInteractive.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..3e48b9e762716210f384414c1c74117de0f222dc
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleTaskInteractive.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd95140784c8f6c0d59da5576be5b12047848639
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js
@@ -0,0 +1,600 @@
+"use strict";
+/**
+ * Simple interactive task server demonstrating elicitation and sampling.
+ *
+ * This server demonstrates the task message queue pattern from the MCP Tasks spec:
+ * - confirm_delete: Uses elicitation to ask the user for confirmation
+ * - write_haiku: Uses sampling to request an LLM to generate content
+ *
+ * Both tools use the "call-now, fetch-later" pattern where the initial call
+ * creates a task, and the result is fetched via tasks/result endpoint.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const index_js_1 = require("../../server/index.js");
+const express_js_1 = require("../../server/express.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const types_js_1 = require("../../types.js");
+const interfaces_js_1 = require("../../experimental/tasks/interfaces.js");
+const in_memory_js_1 = require("../../experimental/tasks/stores/in-memory.js");
+// ============================================================================
+// Resolver - Promise-like for passing results between async operations
+// ============================================================================
+class Resolver {
+ constructor() {
+ this._done = false;
+ this._promise = new Promise((resolve, reject) => {
+ this._resolve = resolve;
+ this._reject = reject;
+ });
+ }
+ setResult(value) {
+ if (this._done)
+ return;
+ this._done = true;
+ this._resolve(value);
+ }
+ setException(error) {
+ if (this._done)
+ return;
+ this._done = true;
+ this._reject(error);
+ }
+ wait() {
+ return this._promise;
+ }
+ done() {
+ return this._done;
+ }
+}
+class TaskMessageQueueWithResolvers {
+ constructor() {
+ this.queues = new Map();
+ this.waitResolvers = new Map();
+ }
+ getQueue(taskId) {
+ let queue = this.queues.get(taskId);
+ if (!queue) {
+ queue = [];
+ this.queues.set(taskId, queue);
+ }
+ return queue;
+ }
+ async enqueue(taskId, message, _sessionId, maxSize) {
+ const queue = this.getQueue(taskId);
+ if (maxSize !== undefined && queue.length >= maxSize) {
+ throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`);
+ }
+ queue.push(message);
+ // Notify any waiters
+ this.notifyWaiters(taskId);
+ }
+ async enqueueWithResolver(taskId, message, resolver, originalRequestId) {
+ const queue = this.getQueue(taskId);
+ const queuedMessage = {
+ type: 'request',
+ message,
+ timestamp: Date.now(),
+ resolver,
+ originalRequestId
+ };
+ queue.push(queuedMessage);
+ this.notifyWaiters(taskId);
+ }
+ async dequeue(taskId, _sessionId) {
+ const queue = this.getQueue(taskId);
+ return queue.shift();
+ }
+ async dequeueAll(taskId, _sessionId) {
+ const queue = this.queues.get(taskId) ?? [];
+ this.queues.delete(taskId);
+ return queue;
+ }
+ async waitForMessage(taskId) {
+ // Check if there are already messages
+ const queue = this.getQueue(taskId);
+ if (queue.length > 0)
+ return;
+ // Wait for a message to be added
+ return new Promise(resolve => {
+ let waiters = this.waitResolvers.get(taskId);
+ if (!waiters) {
+ waiters = [];
+ this.waitResolvers.set(taskId, waiters);
+ }
+ waiters.push(resolve);
+ });
+ }
+ notifyWaiters(taskId) {
+ const waiters = this.waitResolvers.get(taskId);
+ if (waiters) {
+ this.waitResolvers.delete(taskId);
+ for (const resolve of waiters) {
+ resolve();
+ }
+ }
+ }
+ cleanup() {
+ this.queues.clear();
+ this.waitResolvers.clear();
+ }
+}
+// ============================================================================
+// Extended task store with wait functionality
+// ============================================================================
+class TaskStoreWithNotifications extends in_memory_js_1.InMemoryTaskStore {
+ constructor() {
+ super(...arguments);
+ this.updateResolvers = new Map();
+ }
+ async updateTaskStatus(taskId, status, statusMessage, sessionId) {
+ await super.updateTaskStatus(taskId, status, statusMessage, sessionId);
+ this.notifyUpdate(taskId);
+ }
+ async storeTaskResult(taskId, status, result, sessionId) {
+ await super.storeTaskResult(taskId, status, result, sessionId);
+ this.notifyUpdate(taskId);
+ }
+ async waitForUpdate(taskId) {
+ return new Promise(resolve => {
+ let waiters = this.updateResolvers.get(taskId);
+ if (!waiters) {
+ waiters = [];
+ this.updateResolvers.set(taskId, waiters);
+ }
+ waiters.push(resolve);
+ });
+ }
+ notifyUpdate(taskId) {
+ const waiters = this.updateResolvers.get(taskId);
+ if (waiters) {
+ this.updateResolvers.delete(taskId);
+ for (const resolve of waiters) {
+ resolve();
+ }
+ }
+ }
+}
+// ============================================================================
+// Task Result Handler - delivers queued messages and routes responses
+// ============================================================================
+class TaskResultHandler {
+ constructor(store, queue) {
+ this.store = store;
+ this.queue = queue;
+ this.pendingRequests = new Map();
+ }
+ async handle(taskId, server, _sessionId) {
+ while (true) {
+ // Get fresh task state
+ const task = await this.store.getTask(taskId);
+ if (!task) {
+ throw new Error(`Task not found: ${taskId}`);
+ }
+ // Dequeue and send all pending messages
+ await this.deliverQueuedMessages(taskId, server, _sessionId);
+ // If task is terminal, return result
+ if ((0, interfaces_js_1.isTerminal)(task.status)) {
+ const result = await this.store.getTaskResult(taskId);
+ // Add related-task metadata per spec
+ return {
+ ...result,
+ _meta: {
+ ...(result._meta || {}),
+ [types_js_1.RELATED_TASK_META_KEY]: { taskId }
+ }
+ };
+ }
+ // Wait for task update or new message
+ await this.waitForUpdate(taskId);
+ }
+ }
+ async deliverQueuedMessages(taskId, server, _sessionId) {
+ while (true) {
+ const message = await this.queue.dequeue(taskId);
+ if (!message)
+ break;
+ console.log(`[Server] Delivering queued ${message.type} message for task ${taskId}`);
+ if (message.type === 'request') {
+ const reqMessage = message;
+ // Send the request via the server
+ // Store the resolver so we can route the response back
+ if (reqMessage.resolver && reqMessage.originalRequestId) {
+ this.pendingRequests.set(reqMessage.originalRequestId, reqMessage.resolver);
+ }
+ // Send the message - for elicitation/sampling, we use the server's methods
+ // But since we're in tasks/result context, we need to send via transport
+ // This is simplified - in production you'd use proper message routing
+ try {
+ const request = reqMessage.message;
+ let response;
+ if (request.method === 'elicitation/create') {
+ // Send elicitation request to client
+ const params = request.params;
+ response = await server.elicitInput(params);
+ }
+ else if (request.method === 'sampling/createMessage') {
+ // Send sampling request to client
+ const params = request.params;
+ response = await server.createMessage(params);
+ }
+ else {
+ throw new Error(`Unknown request method: ${request.method}`);
+ }
+ // Route response back to resolver
+ if (reqMessage.resolver) {
+ reqMessage.resolver.setResult(response);
+ }
+ }
+ catch (error) {
+ if (reqMessage.resolver) {
+ reqMessage.resolver.setException(error instanceof Error ? error : new Error(String(error)));
+ }
+ }
+ }
+ // For notifications, we'd send them too but this example focuses on requests
+ }
+ }
+ async waitForUpdate(taskId) {
+ // Race between store update and queue message
+ await Promise.race([this.store.waitForUpdate(taskId), this.queue.waitForMessage(taskId)]);
+ }
+ routeResponse(requestId, response) {
+ const resolver = this.pendingRequests.get(requestId);
+ if (resolver && !resolver.done()) {
+ this.pendingRequests.delete(requestId);
+ resolver.setResult(response);
+ return true;
+ }
+ return false;
+ }
+ routeError(requestId, error) {
+ const resolver = this.pendingRequests.get(requestId);
+ if (resolver && !resolver.done()) {
+ this.pendingRequests.delete(requestId);
+ resolver.setException(error);
+ return true;
+ }
+ return false;
+ }
+}
+// ============================================================================
+// Task Session - wraps server to enqueue requests during task execution
+// ============================================================================
+class TaskSession {
+ constructor(server, taskId, store, queue) {
+ this.server = server;
+ this.taskId = taskId;
+ this.store = store;
+ this.queue = queue;
+ this.requestCounter = 0;
+ }
+ nextRequestId() {
+ return `task-${this.taskId}-${++this.requestCounter}`;
+ }
+ async elicit(message, requestedSchema) {
+ // Update task status to input_required
+ await this.store.updateTaskStatus(this.taskId, 'input_required');
+ const requestId = this.nextRequestId();
+ // Build the elicitation request with related-task metadata
+ const params = {
+ message,
+ requestedSchema,
+ mode: 'form',
+ _meta: {
+ [types_js_1.RELATED_TASK_META_KEY]: { taskId: this.taskId }
+ }
+ };
+ const jsonrpcRequest = {
+ jsonrpc: '2.0',
+ id: requestId,
+ method: 'elicitation/create',
+ params
+ };
+ // Create resolver to wait for response
+ const resolver = new Resolver();
+ // Enqueue the request
+ await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId);
+ try {
+ // Wait for response
+ const response = await resolver.wait();
+ // Update status back to working
+ await this.store.updateTaskStatus(this.taskId, 'working');
+ return response;
+ }
+ catch (error) {
+ await this.store.updateTaskStatus(this.taskId, 'working');
+ throw error;
+ }
+ }
+ async createMessage(messages, maxTokens) {
+ // Update task status to input_required
+ await this.store.updateTaskStatus(this.taskId, 'input_required');
+ const requestId = this.nextRequestId();
+ // Build the sampling request with related-task metadata
+ const params = {
+ messages,
+ maxTokens,
+ _meta: {
+ [types_js_1.RELATED_TASK_META_KEY]: { taskId: this.taskId }
+ }
+ };
+ const jsonrpcRequest = {
+ jsonrpc: '2.0',
+ id: requestId,
+ method: 'sampling/createMessage',
+ params
+ };
+ // Create resolver to wait for response
+ const resolver = new Resolver();
+ // Enqueue the request
+ await this.queue.enqueueWithResolver(this.taskId, jsonrpcRequest, resolver, requestId);
+ try {
+ // Wait for response
+ const response = await resolver.wait();
+ // Update status back to working
+ await this.store.updateTaskStatus(this.taskId, 'working');
+ return response;
+ }
+ catch (error) {
+ await this.store.updateTaskStatus(this.taskId, 'working');
+ throw error;
+ }
+ }
+}
+// ============================================================================
+// Server Setup
+// ============================================================================
+const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 8000;
+// Create shared stores
+const taskStore = new TaskStoreWithNotifications();
+const messageQueue = new TaskMessageQueueWithResolvers();
+const taskResultHandler = new TaskResultHandler(taskStore, messageQueue);
+// Track active task executions
+const activeTaskExecutions = new Map();
+// Create the server
+const createServer = () => {
+ const server = new index_js_1.Server({ name: 'simple-task-interactive', version: '1.0.0' }, {
+ capabilities: {
+ tools: {},
+ tasks: {
+ requests: {
+ tools: { call: {} }
+ }
+ }
+ }
+ });
+ // Register tools
+ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
+ return {
+ tools: [
+ {
+ name: 'confirm_delete',
+ description: 'Asks for confirmation before deleting (demonstrates elicitation)',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ filename: { type: 'string' }
+ }
+ },
+ execution: { taskSupport: 'required' }
+ },
+ {
+ name: 'write_haiku',
+ description: 'Asks LLM to write a haiku (demonstrates sampling)',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ topic: { type: 'string' }
+ }
+ },
+ execution: { taskSupport: 'required' }
+ }
+ ]
+ };
+ });
+ // Handle tool calls
+ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request, extra) => {
+ const { name, arguments: args } = request.params;
+ const taskParams = (request.params._meta?.task || request.params.task);
+ // Validate task mode - these tools require tasks
+ if (!taskParams) {
+ throw new Error(`Tool ${name} requires task mode`);
+ }
+ // Create task
+ const taskOptions = {
+ ttl: taskParams.ttl,
+ pollInterval: taskParams.pollInterval ?? 1000
+ };
+ const task = await taskStore.createTask(taskOptions, extra.requestId, request, extra.sessionId);
+ console.log(`\n[Server] ${name} called, task created: ${task.taskId}`);
+ // Start background task execution
+ const taskExecution = (async () => {
+ try {
+ const taskSession = new TaskSession(server, task.taskId, taskStore, messageQueue);
+ if (name === 'confirm_delete') {
+ const filename = args?.filename ?? 'unknown.txt';
+ console.log(`[Server] confirm_delete: asking about '${filename}'`);
+ console.log('[Server] Sending elicitation request to client...');
+ const result = await taskSession.elicit(`Are you sure you want to delete '${filename}'?`, {
+ type: 'object',
+ properties: {
+ confirm: { type: 'boolean' }
+ },
+ required: ['confirm']
+ });
+ console.log(`[Server] Received elicitation response: action=${result.action}, content=${JSON.stringify(result.content)}`);
+ let text;
+ if (result.action === 'accept' && result.content) {
+ const confirmed = result.content.confirm;
+ text = confirmed ? `Deleted '${filename}'` : 'Deletion cancelled';
+ }
+ else {
+ text = 'Deletion cancelled';
+ }
+ console.log(`[Server] Completing task with result: ${text}`);
+ await taskStore.storeTaskResult(task.taskId, 'completed', {
+ content: [{ type: 'text', text }]
+ });
+ }
+ else if (name === 'write_haiku') {
+ const topic = args?.topic ?? 'nature';
+ console.log(`[Server] write_haiku: topic '${topic}'`);
+ console.log('[Server] Sending sampling request to client...');
+ const result = await taskSession.createMessage([
+ {
+ role: 'user',
+ content: { type: 'text', text: `Write a haiku about ${topic}` }
+ }
+ ], 50);
+ let haiku = 'No response';
+ if (result.content && 'text' in result.content) {
+ haiku = result.content.text;
+ }
+ console.log(`[Server] Received sampling response: ${haiku.substring(0, 50)}...`);
+ console.log('[Server] Completing task with haiku');
+ await taskStore.storeTaskResult(task.taskId, 'completed', {
+ content: [{ type: 'text', text: `Haiku:\n${haiku}` }]
+ });
+ }
+ }
+ catch (error) {
+ console.error(`[Server] Task ${task.taskId} failed:`, error);
+ await taskStore.storeTaskResult(task.taskId, 'failed', {
+ content: [{ type: 'text', text: `Error: ${error}` }],
+ isError: true
+ });
+ }
+ finally {
+ activeTaskExecutions.delete(task.taskId);
+ }
+ })();
+ activeTaskExecutions.set(task.taskId, {
+ promise: taskExecution,
+ server,
+ sessionId: extra.sessionId ?? ''
+ });
+ return { task };
+ });
+ // Handle tasks/get
+ server.setRequestHandler(types_js_1.GetTaskRequestSchema, async (request) => {
+ const { taskId } = request.params;
+ const task = await taskStore.getTask(taskId);
+ if (!task) {
+ throw new Error(`Task ${taskId} not found`);
+ }
+ return task;
+ });
+ // Handle tasks/result
+ server.setRequestHandler(types_js_1.GetTaskPayloadRequestSchema, async (request, extra) => {
+ const { taskId } = request.params;
+ console.log(`[Server] tasks/result called for task ${taskId}`);
+ return taskResultHandler.handle(taskId, server, extra.sessionId ?? '');
+ });
+ return server;
+};
+// ============================================================================
+// Express App Setup
+// ============================================================================
+const app = (0, express_js_1.createMcpExpressApp)();
+// Map to store transports by session ID
+const transports = {};
+// Helper to check if request is initialize
+const isInitializeRequest = (body) => {
+ return typeof body === 'object' && body !== null && 'method' in body && body.method === 'initialize';
+};
+// MCP POST endpoint
+app.post('/mcp', async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ try {
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && isInitializeRequest(req.body)) {
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ onsessioninitialized: sid => {
+ console.log(`Session initialized: ${sid}`);
+ transports[sid] = transport;
+ }
+ });
+ transport.onclose = () => {
+ const sid = transport.sessionId;
+ if (sid && transports[sid]) {
+ console.log(`Transport closed for session ${sid}`);
+ delete transports[sid];
+ }
+ };
+ const server = createServer();
+ await server.connect(transport);
+ await transport.handleRequest(req, res, req.body);
+ return;
+ }
+ else {
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: { code: -32000, message: 'Bad Request: No valid session ID' },
+ id: null
+ });
+ return;
+ }
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: { code: -32603, message: 'Internal server error' },
+ id: null
+ });
+ }
+ }
+});
+// Handle GET requests for SSE streams
+app.get('/mcp', async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+});
+// Handle DELETE requests for session termination
+app.delete('/mcp', async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Session termination request: ${sessionId}`);
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+});
+// Start server
+app.listen(PORT, () => {
+ console.log(`Starting server on http://localhost:${PORT}/mcp`);
+ console.log('\nAvailable tools:');
+ console.log(' - confirm_delete: Demonstrates elicitation (asks user y/n)');
+ console.log(' - write_haiku: Demonstrates sampling (requests LLM completion)');
+});
+// Handle shutdown
+process.on('SIGINT', async () => {
+ console.log('\nShutting down server...');
+ for (const sessionId of Object.keys(transports)) {
+ try {
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing session ${sessionId}:`, error);
+ }
+ }
+ taskStore.cleanup();
+ messageQueue.cleanup();
+ console.log('Server shutdown complete');
+ process.exit(0);
+});
+//# sourceMappingURL=simpleTaskInteractive.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..faabd3ff01a39a87902175c3c7eeb78e0428fe13
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/simpleTaskInteractive.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"simpleTaskInteractive.js","sourceRoot":"","sources":["../../../../src/examples/server/simpleTaskInteractive.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAGH,6CAAyC;AACzC,oDAA+C;AAC/C,wDAA8D;AAC9D,sEAA+E;AAC/E,6CAsBwB;AACxB,0EAAuI;AACvI,+EAAiF;AAEjF,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAE/E,MAAM,QAAQ;IAMV;QAFQ,UAAK,GAAG,KAAK,CAAC;QAGlB,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,SAAS,CAAC,KAAQ;QACd,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,KAAY;QACrB,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ;AAaD,MAAM,6BAA6B;IAAnC;QACY,WAAM,GAAG,IAAI,GAAG,EAAuC,CAAC;QACxD,kBAAa,GAAG,IAAI,GAAG,EAA0B,CAAC;IAgF9D,CAAC;IA9EW,QAAQ,CAAC,MAAc;QAC3B,IAAI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AAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;AACpF,CAAC,CAAC,CAAC;AAEH,kBAAkB;AAClB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9C,IAAI,CAAC;YACD,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IACD,SAAS,CAAC,OAAO,EAAE,CAAC;IACpB,YAAY,CAAC,OAAO,EAAE,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c536d0c80ebcbd956f40fd36a8cc967baa2f9998
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fb982c84a6c2111844e67b790620009b4bc9bc73
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"sseAndStreamableHttpCompatibleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js
new file mode 100644
index 0000000000000000000000000000000000000000..6e2c1b44fed8da3846aab7538990c2d37e1a2fd1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js
@@ -0,0 +1,256 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const sse_js_1 = require("../../server/sse.js");
+const z = __importStar(require("zod/v4"));
+const types_js_1 = require("../../types.js");
+const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js");
+const express_js_1 = require("../../server/express.js");
+/**
+ * This example server demonstrates backwards compatibility with both:
+ * 1. The deprecated HTTP+SSE transport (protocol version 2024-11-05)
+ * 2. The Streamable HTTP transport (protocol version 2025-11-25)
+ *
+ * It maintains a single MCP server instance but exposes two transport options:
+ * - /mcp: The new Streamable HTTP endpoint (supports GET/POST/DELETE)
+ * - /sse: The deprecated SSE endpoint for older clients (GET to establish stream)
+ * - /messages: The deprecated POST endpoint for older clients (POST to send messages)
+ */
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'backwards-compatible-server',
+ version: '1.0.0'
+ }, { capabilities: { logging: {} } });
+ // Register a simple tool that sends notifications over time
+ server.registerTool('start-notification-stream', {
+ description: 'Starts sending periodic notifications for testing resumability',
+ inputSchema: {
+ interval: z.number().describe('Interval in milliseconds between notifications').default(100),
+ count: z.number().describe('Number of notifications to send (0 for 100)').default(50)
+ }
+ }, async ({ interval, count }, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ let counter = 0;
+ while (count === 0 || counter < count) {
+ counter++;
+ try {
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: `Periodic notification #${counter} at ${new Date().toISOString()}`
+ }, extra.sessionId);
+ }
+ catch (error) {
+ console.error('Error sending notification:', error);
+ }
+ // Wait for the specified interval
+ await sleep(interval);
+ }
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Started sending periodic notifications every ${interval}ms`
+ }
+ ]
+ };
+ });
+ return server;
+};
+// Create Express application
+const app = (0, express_js_1.createMcpExpressApp)();
+// Store transports by session ID
+const transports = {};
+//=============================================================================
+// STREAMABLE HTTP TRANSPORT (PROTOCOL VERSION 2025-11-25)
+//=============================================================================
+// Handle all MCP Streamable HTTP requests (GET, POST, DELETE) on a single endpoint
+app.all('/mcp', async (req, res) => {
+ console.log(`Received ${req.method} request to /mcp`);
+ try {
+ // Check for existing session ID
+ const sessionId = req.headers['mcp-session-id'];
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Check if the transport is of the correct type
+ const existingTransport = transports[sessionId];
+ if (existingTransport instanceof streamableHttp_js_1.StreamableHTTPServerTransport) {
+ // Reuse existing transport
+ transport = existingTransport;
+ }
+ else {
+ // Transport exists but is not a StreamableHTTPServerTransport (could be SSEServerTransport)
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: Session exists but uses a different transport protocol'
+ },
+ id: null
+ });
+ return;
+ }
+ }
+ else if (!sessionId && req.method === 'POST' && (0, types_js_1.isInitializeRequest)(req.body)) {
+ const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore();
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ eventStore, // Enable resumability
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ console.log(`StreamableHTTP session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ }
+ });
+ // Set up onclose handler to clean up transport when closed
+ transport.onclose = () => {
+ const sid = transport.sessionId;
+ if (sid && transports[sid]) {
+ console.log(`Transport closed for session ${sid}, removing from transports map`);
+ delete transports[sid];
+ }
+ };
+ // Connect the transport to the MCP server
+ const server = getServer();
+ await server.connect(transport);
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with the transport
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+});
+//=============================================================================
+// DEPRECATED HTTP+SSE TRANSPORT (PROTOCOL VERSION 2024-11-05)
+//=============================================================================
+app.get('/sse', async (req, res) => {
+ console.log('Received GET request to /sse (deprecated SSE transport)');
+ const transport = new sse_js_1.SSEServerTransport('/messages', res);
+ transports[transport.sessionId] = transport;
+ res.on('close', () => {
+ delete transports[transport.sessionId];
+ });
+ const server = getServer();
+ await server.connect(transport);
+});
+app.post('/messages', async (req, res) => {
+ const sessionId = req.query.sessionId;
+ let transport;
+ const existingTransport = transports[sessionId];
+ if (existingTransport instanceof sse_js_1.SSEServerTransport) {
+ // Reuse existing transport
+ transport = existingTransport;
+ }
+ else {
+ // Transport exists but is not a SSEServerTransport (could be StreamableHTTPServerTransport)
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: Session exists but uses a different transport protocol'
+ },
+ id: null
+ });
+ return;
+ }
+ if (transport) {
+ await transport.handlePostMessage(req, res, req.body);
+ }
+ else {
+ res.status(400).send('No transport found for sessionId');
+ }
+});
+// Start the server
+const PORT = 3000;
+app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`Backwards compatible MCP server listening on port ${PORT}`);
+ console.log(`
+==============================================
+SUPPORTED TRANSPORT OPTIONS:
+
+1. Streamable Http(Protocol version: 2025-11-25)
+ Endpoint: /mcp
+ Methods: GET, POST, DELETE
+ Usage:
+ - Initialize with POST to /mcp
+ - Establish SSE stream with GET to /mcp
+ - Send requests with POST to /mcp
+ - Terminate session with DELETE to /mcp
+
+2. Http + SSE (Protocol version: 2024-11-05)
+ Endpoints: /sse (GET) and /messages (POST)
+ Usage:
+ - Establish SSE stream with GET to /sse
+ - Send requests with POST to /messages?sessionId=
+==============================================
+`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ // Close all active transports to properly clean up resources
+ for (const sessionId in transports) {
+ try {
+ console.log(`Closing transport for session ${sessionId}`);
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ catch (error) {
+ console.error(`Error closing transport for session ${sessionId}:`, error);
+ }
+ }
+ console.log('Server shutdown complete');
+ process.exit(0);
+});
+//# sourceMappingURL=sseAndStreamableHttpCompatibleServer.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..3f6331a8b22b4a948ace50fb3f2620becab9cbc3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/sseAndStreamableHttpCompatibleServer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"sseAndStreamableHttpCompatibleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/sseAndStreamableHttpCompatibleServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,gDAAyD;AACzD,0CAA4B;AAC5B,6CAAqE;AACrE,2EAAqE;AACrE,wDAA8D;AAE9D;;;;;;;;;GASG;AAEH,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,M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AO,CAAC,GAAG,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;YAC1D,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..63e45548e39be47c444cc8dba15c53a68350a9a0
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=ssePollingExample.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..93827316ae644020f2648cb4181ccda03db65ce1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ssePollingExample.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js
new file mode 100644
index 0000000000000000000000000000000000000000..ea5c9ede3b318629e053d2195326276e3a9ce187
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js
@@ -0,0 +1,107 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const mcp_js_1 = require("../../server/mcp.js");
+const express_js_1 = require("../../server/express.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const inMemoryEventStore_js_1 = require("../shared/inMemoryEventStore.js");
+const cors_1 = __importDefault(require("cors"));
+// Factory to create a new MCP server per session.
+// Each session needs its own server+transport pair to avoid cross-session contamination.
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'sse-polling-example',
+ version: '1.0.0'
+ }, {
+ capabilities: { logging: {} }
+ });
+ // Register a long-running tool that demonstrates server-initiated disconnect
+ server.tool('long-task', 'A long-running task that sends progress updates. Server will disconnect mid-task to demonstrate polling.', {}, async (_args, extra) => {
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
+ console.log(`[${extra.sessionId}] Starting long-task...`);
+ // Send first progress notification
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: 'Progress: 25% - Starting work...'
+ }, extra.sessionId);
+ await sleep(1000);
+ // Send second progress notification
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: 'Progress: 50% - Halfway there...'
+ }, extra.sessionId);
+ await sleep(1000);
+ // Server decides to disconnect the client to free resources
+ // Client will reconnect via GET with Last-Event-ID after the transport's retryInterval
+ // Use extra.closeSSEStream callback - available when eventStore is configured
+ if (extra.closeSSEStream) {
+ console.log(`[${extra.sessionId}] Closing SSE stream to trigger client polling...`);
+ extra.closeSSEStream();
+ }
+ // Continue processing while client is disconnected
+ // Events are stored in eventStore and will be replayed on reconnect
+ await sleep(500);
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: 'Progress: 75% - Almost done (sent while client disconnected)...'
+ }, extra.sessionId);
+ await sleep(500);
+ await server.sendLoggingMessage({
+ level: 'info',
+ data: 'Progress: 100% - Complete!'
+ }, extra.sessionId);
+ console.log(`[${extra.sessionId}] Task complete`);
+ return {
+ content: [
+ {
+ type: 'text',
+ text: 'Long task completed successfully!'
+ }
+ ]
+ };
+ });
+ return server;
+};
+// Set up Express app
+const app = (0, express_js_1.createMcpExpressApp)();
+app.use((0, cors_1.default)());
+// Create event store for resumability
+const eventStore = new inMemoryEventStore_js_1.InMemoryEventStore();
+// Track transports by session ID for session reuse
+const transports = new Map();
+// Handle all MCP requests
+app.all('/mcp', async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ // Reuse existing transport or create new one
+ let transport = sessionId ? transports.get(sessionId) : undefined;
+ if (!transport) {
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ eventStore,
+ retryInterval: 2000, // Default retry interval for priming events
+ onsessioninitialized: id => {
+ console.log(`[${id}] Session initialized`);
+ transports.set(id, transport);
+ }
+ });
+ // Create a new server per session and connect it to the transport
+ const server = getServer();
+ await server.connect(transport);
+ }
+ await transport.handleRequest(req, res, req.body);
+});
+// Start the server
+const PORT = 3001;
+app.listen(PORT, () => {
+ console.log(`SSE Polling Example Server running on http://localhost:${PORT}/mcp`);
+ console.log('');
+ console.log('This server demonstrates SEP-1699 SSE polling:');
+ console.log('- retryInterval: 2000ms (client waits 2s before reconnecting)');
+ console.log('- eventStore: InMemoryEventStore (events are persisted for replay)');
+ console.log('');
+ console.log('Try calling the "long-task" tool to see server-initiated disconnect in action.');
+});
+//# sourceMappingURL=ssePollingExample.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..d001a5b77ad8af2060d58e74a28ac7c43bcf2d93
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/ssePollingExample.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ssePollingExample.js","sourceRoot":"","sources":["../../../../src/examples/server/ssePollingExample.ts"],"names":[],"mappings":";;;;;AAeA,6CAAyC;AACzC,gDAAgD;AAChD,wDAA8D;AAC9D,sEAA+E;AAE/E,2EAAqE;AACrE,gDAAwB;AAExB,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CACxB;QACI,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KAChC,CACJ,CAAC;IAEF,6EAA6E;IAC7E,MAAM,CAAC,IAAI,CACP,WAAW,EACX,0GAA0G,EAC1G,EAAE,EACF,KAAK,EAAE,KAAK,EAAE,KAAK,EAA2B,EAAE;QAC5C,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAE9E,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,yBAAyB,CAAC,CAAC;QAE1D,mCAAmC;QACnC,MAAM,MAAM,CAAC,kBAAkB,CAC3B;YACI,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,kCAAkC;SAC3C,EACD,KAAK,CAAC,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C;IAChB,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4df17831b73f7b2e79856f948706116d701eb3a3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=standaloneSseWithGetStreamableHttp.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..df60dc51b0bd089e3e7d5091f9d1a14cf6b230c8
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"standaloneSseWithGetStreamableHttp.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js
new file mode 100644
index 0000000000000000000000000000000000000000..129980e16ab8da2185d57e1257d01f10bf16bfec
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js
@@ -0,0 +1,124 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const node_crypto_1 = require("node:crypto");
+const mcp_js_1 = require("../../server/mcp.js");
+const streamableHttp_js_1 = require("../../server/streamableHttp.js");
+const types_js_1 = require("../../types.js");
+const express_js_1 = require("../../server/express.js");
+// Factory to create a new MCP server per session.
+// Each session needs its own server+transport pair to avoid cross-session contamination.
+const getServer = () => {
+ const server = new mcp_js_1.McpServer({
+ name: 'resource-list-changed-notification-server',
+ version: '1.0.0'
+ });
+ const addResource = (name, content) => {
+ const uri = `https://mcp-example.com/dynamic/${encodeURIComponent(name)}`;
+ server.registerResource(name, uri, { mimeType: 'text/plain', description: `Dynamic resource: ${name}` }, async () => {
+ return {
+ contents: [{ uri, text: content }]
+ };
+ });
+ };
+ addResource('example-resource', 'Initial content for example-resource');
+ // Periodically add new resources to demonstrate notifications
+ const resourceChangeInterval = setInterval(() => {
+ const name = (0, node_crypto_1.randomUUID)();
+ addResource(name, `Content for ${name}`);
+ }, 5000);
+ // Clean up the interval when the server closes
+ server.server.onclose = () => {
+ clearInterval(resourceChangeInterval);
+ };
+ return server;
+};
+// Store transports by session ID to send notifications
+const transports = {};
+const app = (0, express_js_1.createMcpExpressApp)();
+app.post('/mcp', async (req, res) => {
+ console.log('Received MCP request:', req.body);
+ try {
+ // Check for existing session ID
+ const sessionId = req.headers['mcp-session-id'];
+ let transport;
+ if (sessionId && transports[sessionId]) {
+ // Reuse existing transport
+ transport = transports[sessionId];
+ }
+ else if (!sessionId && (0, types_js_1.isInitializeRequest)(req.body)) {
+ // New initialization request
+ transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
+ sessionIdGenerator: () => (0, node_crypto_1.randomUUID)(),
+ onsessioninitialized: sessionId => {
+ // Store the transport by session ID when session is initialized
+ // This avoids race conditions where requests might come in before the session is stored
+ console.log(`Session initialized with ID: ${sessionId}`);
+ transports[sessionId] = transport;
+ }
+ });
+ // Create a new server per session and connect it to the transport
+ const server = getServer();
+ await server.connect(transport);
+ // Handle the request - the onsessioninitialized callback will store the transport
+ await transport.handleRequest(req, res, req.body);
+ return; // Already handled
+ }
+ else {
+ // Invalid request - no session ID or not initialization request
+ res.status(400).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32000,
+ message: 'Bad Request: No valid session ID provided'
+ },
+ id: null
+ });
+ return;
+ }
+ // Handle the request with existing transport
+ await transport.handleRequest(req, res, req.body);
+ }
+ catch (error) {
+ console.error('Error handling MCP request:', error);
+ if (!res.headersSent) {
+ res.status(500).json({
+ jsonrpc: '2.0',
+ error: {
+ code: -32603,
+ message: 'Internal server error'
+ },
+ id: null
+ });
+ }
+ }
+});
+// Handle GET requests for SSE streams (now using built-in support from StreamableHTTP)
+app.get('/mcp', async (req, res) => {
+ const sessionId = req.headers['mcp-session-id'];
+ if (!sessionId || !transports[sessionId]) {
+ res.status(400).send('Invalid or missing session ID');
+ return;
+ }
+ console.log(`Establishing SSE stream for session ${sessionId}`);
+ const transport = transports[sessionId];
+ await transport.handleRequest(req, res);
+});
+// Start the server
+const PORT = 3000;
+app.listen(PORT, error => {
+ if (error) {
+ console.error('Failed to start server:', error);
+ process.exit(1);
+ }
+ console.log(`Server listening on port ${PORT}`);
+});
+// Handle server shutdown
+process.on('SIGINT', async () => {
+ console.log('Shutting down server...');
+ for (const sessionId in transports) {
+ await transports[sessionId].close();
+ delete transports[sessionId];
+ }
+ process.exit(0);
+});
+//# sourceMappingURL=standaloneSseWithGetStreamableHttp.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5c8acdaa7f1117af637eee814f2ec0f86af674b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/standaloneSseWithGetStreamableHttp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"standaloneSseWithGetStreamableHttp.js","sourceRoot":"","sources":["../../../../src/examples/server/standaloneSseWithGetStreamableHttp.ts"],"names":[],"mappings":";;AACA,6CAAyC;AACzC,gDAAgD;AAChD,sEAA+E;AAC/E,6CAAyE;AACzE,wDAA8D;AAE9D,kDAAkD;AAClD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QACzB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,OAAO;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;QAClD,MAAM,GAAG,GAAG,mCAAmC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1E,MAAM,CAAC,gBAAgB,CACnB,IAAI,EACJ,GAAG,EACH,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,IAAI,EAAE,EAAE,EACpE,KAAK,IAAiC,EAAE;YACpC,OAAO;gBACH,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;aACrC,CAAC;QACN,CAAC,CACJ,CAAC;IACN,CAAC,CAAC;IAEF,WAAW,CAAC,kBAAkB,EAAE,sCAAsC,CAAC,CAAC;IAExE,8DAA8D;IAC9D,MAAM,sBAAsB,GAAG,WAAW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AuB,CAAC;IACtE,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QACtD,OAAO;IACX,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uCAAuC,SAAS,EAAE,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,MAAM,IAAI,GAAG,IAAI,CAAC;AAClB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrB,IAAI,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC;AAEH,yBAAyB;AACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;QACpC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..acc24b6a536a9b1464c0d48fcd0b22899dac1a9e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=toolWithSampleServer.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..bd0cebcf198122703dba48e63365437a37895cdb
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"toolWithSampleServer.d.ts","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js
new file mode 100644
index 0000000000000000000000000000000000000000..45d38374d1fbb369dcde37e1dd37d16ecc74d06f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js
@@ -0,0 +1,73 @@
+"use strict";
+// Run with: npx tsx src/examples/server/toolWithSampleServer.ts
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mcp_js_1 = require("../../server/mcp.js");
+const stdio_js_1 = require("../../server/stdio.js");
+const z = __importStar(require("zod/v4"));
+const mcpServer = new mcp_js_1.McpServer({
+ name: 'tools-with-sample-server',
+ version: '1.0.0'
+});
+// Tool that uses LLM sampling to summarize any text
+mcpServer.registerTool('summarize', {
+ description: 'Summarize any text using an LLM',
+ inputSchema: {
+ text: z.string().describe('Text to summarize')
+ }
+}, async ({ text }) => {
+ // Call the LLM through MCP sampling
+ const response = await mcpServer.server.createMessage({
+ messages: [
+ {
+ role: 'user',
+ content: {
+ type: 'text',
+ text: `Please summarize the following text concisely:\n\n${text}`
+ }
+ }
+ ],
+ maxTokens: 500
+ });
+ // Since we're not passing tools param to createMessage, response.content is single content
+ return {
+ content: [
+ {
+ type: 'text',
+ text: response.content.type === 'text' ? response.content.text : 'Unable to generate summary'
+ }
+ ]
+ };
+});
+async function main() {
+ const transport = new stdio_js_1.StdioServerTransport();
+ await mcpServer.connect(transport);
+ console.log('MCP server is running...');
+}
+main().catch(error => {
+ console.error('Server error:', error);
+ process.exit(1);
+});
+//# sourceMappingURL=toolWithSampleServer.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..287e11ee9b6fde2f9a522cd7c30b918b45a6259c
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/server/toolWithSampleServer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"toolWithSampleServer.js","sourceRoot":"","sources":["../../../../src/examples/server/toolWithSampleServer.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;;;;;;;;;;;;;;;;;;;;;;;AAEhE,gDAAgD;AAChD,oDAA6D;AAC7D,0CAA4B;AAE5B,MAAM,SAAS,GAAG,IAAI,kBAAS,CAAC;IAC5B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;CACnB,CAAC,CAAC;AAEH,oDAAoD;AACpD,SAAS,CAAC,YAAY,CAClB,WAAW,EACX;IACI,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACjD;CACJ,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACf,oCAAoC;IACpC,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC;QAClD,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,qDAAqD,IAAI,EAAE;iBACpE;aACJ;SACJ;QACD,SAAS,EAAE,GAAG;KACjB,CAAC,CAAC;IAEH,2FAA2F;IAC3F,OAAO;QACH,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,4BAA4B;aAChG;SACJ;KACJ,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..26ff38cf938789254fd2422d0e79827238555698
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts
@@ -0,0 +1,31 @@
+import { JSONRPCMessage } from '../../types.js';
+import { EventStore } from '../../server/streamableHttp.js';
+/**
+ * Simple in-memory implementation of the EventStore interface for resumability
+ * This is primarily intended for examples and testing, not for production use
+ * where a persistent storage solution would be more appropriate.
+ */
+export declare class InMemoryEventStore implements EventStore {
+ private events;
+ /**
+ * Generates a unique event ID for a given stream ID
+ */
+ private generateEventId;
+ /**
+ * Extracts the stream ID from an event ID
+ */
+ private getStreamIdFromEventId;
+ /**
+ * Stores an event with a generated event ID
+ * Implements EventStore.storeEvent
+ */
+ storeEvent(streamId: string, message: JSONRPCMessage): Promise;
+ /**
+ * Replays events that occurred after a specific event ID
+ * Implements EventStore.replayEventsAfter
+ */
+ replayEventsAfter(lastEventId: string, { send }: {
+ send: (eventId: string, message: JSONRPCMessage) => Promise;
+ }): Promise;
+}
+//# sourceMappingURL=inMemoryEventStore.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a67ee6cd175840bb7712d0b3f2071636246afad8
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"inMemoryEventStore.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACjD,OAAO,CAAC,MAAM,CAAyE;IAEvF;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5E;;;OAGG;IACG,iBAAiB,CACnB,WAAW,EAAE,MAAM,EACnB,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,GAChF,OAAO,CAAC,MAAM,CAAC;CAkCrB"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js
new file mode 100644
index 0000000000000000000000000000000000000000..d33ffdb5c1e97780a2c1d2769fb1955efa7abf83
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js
@@ -0,0 +1,69 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.InMemoryEventStore = void 0;
+/**
+ * Simple in-memory implementation of the EventStore interface for resumability
+ * This is primarily intended for examples and testing, not for production use
+ * where a persistent storage solution would be more appropriate.
+ */
+class InMemoryEventStore {
+ constructor() {
+ this.events = new Map();
+ }
+ /**
+ * Generates a unique event ID for a given stream ID
+ */
+ generateEventId(streamId) {
+ return `${streamId}_${Date.now()}_${Math.random().toString(36).substring(2, 10)}`;
+ }
+ /**
+ * Extracts the stream ID from an event ID
+ */
+ getStreamIdFromEventId(eventId) {
+ const parts = eventId.split('_');
+ return parts.length > 0 ? parts[0] : '';
+ }
+ /**
+ * Stores an event with a generated event ID
+ * Implements EventStore.storeEvent
+ */
+ async storeEvent(streamId, message) {
+ const eventId = this.generateEventId(streamId);
+ this.events.set(eventId, { streamId, message });
+ return eventId;
+ }
+ /**
+ * Replays events that occurred after a specific event ID
+ * Implements EventStore.replayEventsAfter
+ */
+ async replayEventsAfter(lastEventId, { send }) {
+ if (!lastEventId || !this.events.has(lastEventId)) {
+ return '';
+ }
+ // Extract the stream ID from the event ID
+ const streamId = this.getStreamIdFromEventId(lastEventId);
+ if (!streamId) {
+ return '';
+ }
+ let foundLastEvent = false;
+ // Sort events by eventId for chronological ordering
+ const sortedEvents = [...this.events.entries()].sort((a, b) => a[0].localeCompare(b[0]));
+ for (const [eventId, { streamId: eventStreamId, message }] of sortedEvents) {
+ // Only include events from the same stream
+ if (eventStreamId !== streamId) {
+ continue;
+ }
+ // Start sending events after we find the lastEventId
+ if (eventId === lastEventId) {
+ foundLastEvent = true;
+ continue;
+ }
+ if (foundLastEvent) {
+ await send(eventId, message);
+ }
+ }
+ return streamId;
+ }
+}
+exports.InMemoryEventStore = InMemoryEventStore;
+//# sourceMappingURL=inMemoryEventStore.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..d6964506395e11f2a21da4aab7b42edff7ae83a6
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/examples/shared/inMemoryEventStore.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"inMemoryEventStore.js","sourceRoot":"","sources":["../../../../src/examples/shared/inMemoryEventStore.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,MAAa,kBAAkB;IAA/B;QACY,WAAM,GAA+D,IAAI,GAAG,EAAE,CAAC;IAoE3F,CAAC;IAlEG;;OAEG;IACK,eAAe,CAAC,QAAgB;QACpC,OAAO,GAAG,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IACtF,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAAe;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAuB;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ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CAAC;CACJ;AArED,gDAqEC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2a8633553a9ef6906064c9e0717886d68f72241f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts
@@ -0,0 +1,13 @@
+/**
+ * Experimental MCP SDK features.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * Import experimental features from this module:
+ * ```typescript
+ * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental';
+ * ```
+ *
+ * @experimental
+ */
+export * from './tasks/index.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..410892aa411801bf4e83783d57c3fdda69307cf0
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,kBAAkB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..7634e674c64d40e538cd0685a016b1542029218e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js
@@ -0,0 +1,29 @@
+"use strict";
+/**
+ * Experimental MCP SDK features.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * Import experimental features from this module:
+ * ```typescript
+ * import { TaskStore, InMemoryTaskStore } from '@modelcontextprotocol/sdk/experimental';
+ * ```
+ *
+ * @experimental
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+__exportStar(require("./tasks/index.js"), exports);
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..110189e9f3b2dcbcbf17395e75e25252f59cdaf4
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/experimental/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;AAEH,mDAAiC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9c7a92834b7c642eb962812299efece97f3d0f31
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts
@@ -0,0 +1,121 @@
+/**
+ * Experimental client task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+import type { Client } from '../../client/index.js';
+import type { RequestOptions } from '../../shared/protocol.js';
+import type { ResponseMessage } from '../../shared/responseMessage.js';
+import type { AnyObjectSchema, SchemaOutput } from '../../server/zod-compat.js';
+import type { CallToolRequest, ClientRequest, Notification, Request, Result } from '../../types.js';
+import { CallToolResultSchema, type CompatibilityCallToolResultSchema } from '../../types.js';
+import type { GetTaskResult, ListTasksResult, CancelTaskResult } from './types.js';
+/**
+ * Experimental task features for MCP clients.
+ *
+ * Access via `client.experimental.tasks`:
+ * ```typescript
+ * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} });
+ * const task = await client.experimental.tasks.getTask(taskId);
+ * ```
+ *
+ * @experimental
+ */
+export declare class ExperimentalClientTasks {
+ private readonly _client;
+ constructor(_client: Client);
+ /**
+ * Calls a tool and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to tool execution, allowing you to
+ * observe intermediate task status updates for long-running tool calls.
+ * Automatically validates structured output if the tool has an outputSchema.
+ *
+ * @example
+ * ```typescript
+ * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} });
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Tool execution started:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Tool status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('Tool result:', message.result);
+ * break;
+ * case 'error':
+ * console.error('Tool error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - Tool call parameters (name and arguments)
+ * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema)
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ callToolStream(params: CallToolRequest['params'], resultSchema?: T, options?: RequestOptions): AsyncGenerator>, void, void>;
+ /**
+ * Gets the current status of a task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ * @returns The task status
+ *
+ * @experimental
+ */
+ getTask(taskId: string, options?: RequestOptions): Promise;
+ /**
+ * Retrieves the result of a completed task.
+ *
+ * @param taskId - The task identifier
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options
+ * @returns The task result
+ *
+ * @experimental
+ */
+ getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>;
+ /**
+ * Lists tasks with optional pagination.
+ *
+ * @param cursor - Optional pagination cursor
+ * @param options - Optional request options
+ * @returns List of tasks with optional next cursor
+ *
+ * @experimental
+ */
+ listTasks(cursor?: string, options?: RequestOptions): Promise;
+ /**
+ * Cancels a running task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ *
+ * @experimental
+ */
+ cancelTask(taskId: string, options?: RequestOptions): Promise;
+ /**
+ * Sends a request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to request processing, allowing you to
+ * observe intermediate task status updates for task-augmented requests.
+ *
+ * @param request - The request to send
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ requestStream(request: ClientRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>;
+}
+//# sourceMappingURL=client.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e54158d6533a03c2f588ec140db950757e852d49
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,KAAK,iCAAiC,EAAuB,MAAM,gBAAgB,CAAC;AAEnH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAgBnF;;;;;;;;;;GAUG;AACH,qBAAa,uBAAuB,CAChC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACI,cAAc,CAAC,CAAC,SAAS,OAAO,oBAAoB,GAAG,OAAO,iCAAiC,EAClG,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,YAAY,GAAE,CAA6B,EAC3C,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAyE/D;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAM/E;;;;;;;;;OASG;IACG,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAapI;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IASpF;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IASrF;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,SAAS,eAAe,EACnC,OAAO,EAAE,aAAa,GAAG,QAAQ,EACjC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;CAWlE"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb7d26f963f80f8ca6877a771a545150ad23f0f7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js
@@ -0,0 +1,188 @@
+"use strict";
+/**
+ * Experimental client task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ExperimentalClientTasks = void 0;
+const types_js_1 = require("../../types.js");
+/**
+ * Experimental task features for MCP clients.
+ *
+ * Access via `client.experimental.tasks`:
+ * ```typescript
+ * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} });
+ * const task = await client.experimental.tasks.getTask(taskId);
+ * ```
+ *
+ * @experimental
+ */
+class ExperimentalClientTasks {
+ constructor(_client) {
+ this._client = _client;
+ }
+ /**
+ * Calls a tool and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to tool execution, allowing you to
+ * observe intermediate task status updates for long-running tool calls.
+ * Automatically validates structured output if the tool has an outputSchema.
+ *
+ * @example
+ * ```typescript
+ * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} });
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Tool execution started:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Tool status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('Tool result:', message.result);
+ * break;
+ * case 'error':
+ * console.error('Tool error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - Tool call parameters (name and arguments)
+ * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema)
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ async *callToolStream(params, resultSchema = types_js_1.CallToolResultSchema, options) {
+ // Access Client's internal methods
+ const clientInternal = this._client;
+ // Add task creation parameters if server supports it and not explicitly provided
+ const optionsWithTask = {
+ ...options,
+ // We check if the tool is known to be a task during auto-configuration, but assume
+ // the caller knows what they're doing if they pass this explicitly
+ task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : undefined)
+ };
+ const stream = clientInternal.requestStream({ method: 'tools/call', params }, resultSchema, optionsWithTask);
+ // Get the validator for this tool (if it has an output schema)
+ const validator = clientInternal.getToolOutputValidator(params.name);
+ // Iterate through the stream and validate the final result if needed
+ for await (const message of stream) {
+ // If this is a result message and the tool has an output schema, validate it
+ if (message.type === 'result' && validator) {
+ const result = message.result;
+ // If tool has outputSchema, it MUST return structuredContent (unless it's an error)
+ if (!result.structuredContent && !result.isError) {
+ yield {
+ type: 'error',
+ error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
+ };
+ return;
+ }
+ // Only validate structured content if present (not when there's an error)
+ if (result.structuredContent) {
+ try {
+ // Validate the structured content against the schema
+ const validationResult = validator(result.structuredContent);
+ if (!validationResult.valid) {
+ yield {
+ type: 'error',
+ error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`)
+ };
+ return;
+ }
+ }
+ catch (error) {
+ if (error instanceof types_js_1.McpError) {
+ yield { type: 'error', error };
+ return;
+ }
+ yield {
+ type: 'error',
+ error: new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`)
+ };
+ return;
+ }
+ }
+ }
+ // Yield the message (either validated result or any other message type)
+ yield message;
+ }
+ }
+ /**
+ * Gets the current status of a task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ * @returns The task status
+ *
+ * @experimental
+ */
+ async getTask(taskId, options) {
+ return this._client.getTask({ taskId }, options);
+ }
+ /**
+ * Retrieves the result of a completed task.
+ *
+ * @param taskId - The task identifier
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options
+ * @returns The task result
+ *
+ * @experimental
+ */
+ async getTaskResult(taskId, resultSchema, options) {
+ // Delegate to the client's underlying Protocol method
+ return this._client.getTaskResult({ taskId }, resultSchema, options);
+ }
+ /**
+ * Lists tasks with optional pagination.
+ *
+ * @param cursor - Optional pagination cursor
+ * @param options - Optional request options
+ * @returns List of tasks with optional next cursor
+ *
+ * @experimental
+ */
+ async listTasks(cursor, options) {
+ // Delegate to the client's underlying Protocol method
+ return this._client.listTasks(cursor ? { cursor } : undefined, options);
+ }
+ /**
+ * Cancels a running task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ *
+ * @experimental
+ */
+ async cancelTask(taskId, options) {
+ // Delegate to the client's underlying Protocol method
+ return this._client.cancelTask({ taskId }, options);
+ }
+ /**
+ * Sends a request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to request processing, allowing you to
+ * observe intermediate task status updates for task-augmented requests.
+ *
+ * @param request - The request to send
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ requestStream(request, resultSchema, options) {
+ return this._client.requestStream(request, resultSchema, options);
+ }
+}
+exports.ExperimentalClientTasks = ExperimentalClientTasks;
+//# sourceMappingURL=client.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a5dd7bd63bd6407a08664c5f1e307bf7e36c6aec
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/client.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAOH,6CAAmH;AAkBnH;;;;;;;;;;GAUG;AACH,MAAa,uBAAuB;IAK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AE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe,EAAE,OAAwB;QACrD,sDAAsD;QACtD,OACI,IAAI,CAAC,OAGR,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,OAAwB;QACrD,sDAAsD;QACtD,OACI,IAAI,CAAC,OAGR,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,aAAa,CACT,OAAiC,EACjC,YAAe,EACf,OAAwB;QAUxB,OAAQ,IAAI,CAAC,OAA8C,CAAC,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;CACJ;AA9ND,0DA8NC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f5e505f816496f0abebe62215e50a1c3d0f48a32
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts
@@ -0,0 +1,47 @@
+/**
+ * Experimental task capability assertion helpers.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+/**
+ * Type representing the task requests capability structure.
+ * This is derived from ClientTasksCapability.requests and ServerTasksCapability.requests.
+ */
+interface TaskRequestsCapability {
+ tools?: {
+ call?: object;
+ };
+ sampling?: {
+ createMessage?: object;
+ };
+ elicitation?: {
+ create?: object;
+ };
+}
+/**
+ * Asserts that task creation is supported for tools/call.
+ * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability.
+ *
+ * @param requests - The task requests capability object
+ * @param method - The method being checked
+ * @param entityName - 'Server' or 'Client' for error messages
+ * @throws Error if the capability is not supported
+ *
+ * @experimental
+ */
+export declare function assertToolsCallTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void;
+/**
+ * Asserts that task creation is supported for sampling/createMessage or elicitation/create.
+ * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability.
+ *
+ * @param requests - The task requests capability object
+ * @param method - The method being checked
+ * @param entityName - 'Server' or 'Client' for error messages
+ * @throws Error if the capability is not supported
+ *
+ * @experimental
+ */
+export declare function assertClientRequestTaskCapability(requests: TaskRequestsCapability | undefined, method: string, entityName: 'Server' | 'Client'): void;
+export {};
+//# sourceMappingURL=helpers.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..99dc903432a37d62d2211357bca0b117a60b8d96
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,UAAU,sBAAsB;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CACzC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAgBN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAC7C,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAChC,IAAI,CAsBN"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..6348ab0f94326d1a76f4a537fac3debbab8cf60e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js
@@ -0,0 +1,68 @@
+"use strict";
+/**
+ * Experimental task capability assertion helpers.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.assertToolsCallTaskCapability = assertToolsCallTaskCapability;
+exports.assertClientRequestTaskCapability = assertClientRequestTaskCapability;
+/**
+ * Asserts that task creation is supported for tools/call.
+ * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability.
+ *
+ * @param requests - The task requests capability object
+ * @param method - The method being checked
+ * @param entityName - 'Server' or 'Client' for error messages
+ * @throws Error if the capability is not supported
+ *
+ * @experimental
+ */
+function assertToolsCallTaskCapability(requests, method, entityName) {
+ if (!requests) {
+ throw new Error(`${entityName} does not support task creation (required for ${method})`);
+ }
+ switch (method) {
+ case 'tools/call':
+ if (!requests.tools?.call) {
+ throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
+ }
+ break;
+ default:
+ // Method doesn't support tasks, which is fine - no error
+ break;
+ }
+}
+/**
+ * Asserts that task creation is supported for sampling/createMessage or elicitation/create.
+ * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability.
+ *
+ * @param requests - The task requests capability object
+ * @param method - The method being checked
+ * @param entityName - 'Server' or 'Client' for error messages
+ * @throws Error if the capability is not supported
+ *
+ * @experimental
+ */
+function assertClientRequestTaskCapability(requests, method, entityName) {
+ if (!requests) {
+ throw new Error(`${entityName} does not support task creation (required for ${method})`);
+ }
+ switch (method) {
+ case 'sampling/createMessage':
+ if (!requests.sampling?.createMessage) {
+ throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
+ }
+ break;
+ case 'elicitation/create':
+ if (!requests.elicitation?.create) {
+ throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
+ }
+ break;
+ default:
+ // Method doesn't support tasks, which is fine - no error
+ break;
+ }
+}
+//# sourceMappingURL=helpers.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..1054273d9c2bce7fab2add79535fa98c9385a121
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/helpers.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAuBH,sEAoBC;AAaD,8EA0BC;AAtED;;;;;;;;;;GAUG;AACH,SAAgB,6BAA6B,CACzC,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,YAAY;YACb,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,gEAAgE,MAAM,GAAG,CAAC,CAAC;YAC5G,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,iCAAiC,CAC7C,QAA4C,EAC5C,MAAc,EACd,UAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,iDAAiD,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,wBAAwB;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,4EAA4E,MAAM,GAAG,CAAC,CAAC;YACxH,CAAC;YACD,MAAM;QAEV,KAAK,oBAAoB;YACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,wEAAwE,MAAM,GAAG,CAAC,CAAC;YACpH,CAAC;YACD,MAAM;QAEV;YACI,yDAAyD;YACzD,MAAM;IACd,CAAC;AACL,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..33ab7916936bd78b0913cc6e04a7ec0a4be9dbc7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts
@@ -0,0 +1,16 @@
+/**
+ * Experimental task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+export * from './types.js';
+export * from './interfaces.js';
+export * from './helpers.js';
+export * from './client.js';
+export * from './server.js';
+export * from './mcp-server.js';
+export * from './stores/in-memory.js';
+export type { ResponseMessage, TaskStatusMessage, TaskCreatedMessage, ResultMessage, ErrorMessage, BaseResponseMessage } from '../../shared/responseMessage.js';
+export { takeResult, toArrayAsync } from '../../shared/responseMessage.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..cf117ed5fbdf77e3345daab312698c9946d4ef25
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACR,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..25296f6d68505541fcaea2a05be80d678ef0c916
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js
@@ -0,0 +1,39 @@
+"use strict";
+/**
+ * Experimental task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.toArrayAsync = exports.takeResult = void 0;
+// Re-export spec types for convenience
+__exportStar(require("./types.js"), exports);
+// SDK implementation interfaces
+__exportStar(require("./interfaces.js"), exports);
+// Assertion helpers
+__exportStar(require("./helpers.js"), exports);
+// Wrapper classes
+__exportStar(require("./client.js"), exports);
+__exportStar(require("./server.js"), exports);
+__exportStar(require("./mcp-server.js"), exports);
+// Store implementations
+__exportStar(require("./stores/in-memory.js"), exports);
+var responseMessage_js_1 = require("../../shared/responseMessage.js");
+Object.defineProperty(exports, "takeResult", { enumerable: true, get: function () { return responseMessage_js_1.takeResult; } });
+Object.defineProperty(exports, "toArrayAsync", { enumerable: true, get: function () { return responseMessage_js_1.toArrayAsync; } });
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..3d570658c048aef9235a2c500fba0ceae59c7271
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,uCAAuC;AACvC,6CAA2B;AAE3B,gCAAgC;AAChC,kDAAgC;AAEhC,oBAAoB;AACpB,+CAA6B;AAE7B,kBAAkB;AAClB,8CAA4B;AAC5B,8CAA4B;AAC5B,kDAAgC;AAEhC,wBAAwB;AACxB,wDAAsC;AAWtC,sEAA2E;AAAlE,gHAAA,UAAU,OAAA;AAAE,kHAAA,YAAY,OAAA"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b0bb9895caf1e40cec519a238a392a1047583931
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts
@@ -0,0 +1,232 @@
+/**
+ * Experimental task interfaces for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ */
+import { Task, RequestId, Result, JSONRPCRequest, JSONRPCNotification, JSONRPCResultResponse, JSONRPCErrorResponse, ServerRequest, ServerNotification, CallToolResult, GetTaskResult, ToolExecution, Request } from '../../types.js';
+import { CreateTaskResult } from './types.js';
+import type { RequestHandlerExtra, RequestTaskStore } from '../../shared/protocol.js';
+import type { ZodRawShapeCompat, AnySchema, ShapeOutput } from '../../server/zod-compat.js';
+/**
+ * Extended handler extra with task store for task creation.
+ * @experimental
+ */
+export interface CreateTaskRequestHandlerExtra extends RequestHandlerExtra {
+ taskStore: RequestTaskStore;
+}
+/**
+ * Extended handler extra with task ID and store for task operations.
+ * @experimental
+ */
+export interface TaskRequestHandlerExtra extends RequestHandlerExtra {
+ taskId: string;
+ taskStore: RequestTaskStore;
+}
+/**
+ * Base callback type for tool handlers.
+ * @experimental
+ */
+export type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: ExtraT) => SendResultT | Promise : Args extends AnySchema ? (args: unknown, extra: ExtraT) => SendResultT | Promise : (extra: ExtraT) => SendResultT | Promise;
+/**
+ * Handler for creating a task.
+ * @experimental
+ */
+export type CreateTaskRequestHandler = BaseToolCallback;
+/**
+ * Handler for task operations (get, getResult).
+ * @experimental
+ */
+export type TaskRequestHandler = BaseToolCallback;
+/**
+ * Interface for task-based tool handlers.
+ * @experimental
+ */
+export interface ToolTaskHandler {
+ createTask: CreateTaskRequestHandler;
+ getTask: TaskRequestHandler;
+ getTaskResult: TaskRequestHandler;
+}
+/**
+ * Task-specific execution configuration.
+ * taskSupport cannot be 'forbidden' for task-based tools.
+ * @experimental
+ */
+export type TaskToolExecution = Omit & {
+ taskSupport: TaskSupport extends 'forbidden' | undefined ? never : TaskSupport;
+};
+/**
+ * Represents a message queued for side-channel delivery via tasks/result.
+ *
+ * This is a serializable data structure that can be stored in external systems.
+ * All fields are JSON-serializable.
+ */
+export type QueuedMessage = QueuedRequest | QueuedNotification | QueuedResponse | QueuedError;
+export interface BaseQueuedMessage {
+ /** Type of message */
+ type: string;
+ /** When the message was queued (milliseconds since epoch) */
+ timestamp: number;
+}
+export interface QueuedRequest extends BaseQueuedMessage {
+ type: 'request';
+ /** The actual JSONRPC request */
+ message: JSONRPCRequest;
+}
+export interface QueuedNotification extends BaseQueuedMessage {
+ type: 'notification';
+ /** The actual JSONRPC notification */
+ message: JSONRPCNotification;
+}
+export interface QueuedResponse extends BaseQueuedMessage {
+ type: 'response';
+ /** The actual JSONRPC response */
+ message: JSONRPCResultResponse;
+}
+export interface QueuedError extends BaseQueuedMessage {
+ type: 'error';
+ /** The actual JSONRPC error */
+ message: JSONRPCErrorResponse;
+}
+/**
+ * Interface for managing per-task FIFO message queues.
+ *
+ * Similar to TaskStore, this allows pluggable queue implementations
+ * (in-memory, Redis, other distributed queues, etc.).
+ *
+ * Each method accepts taskId and optional sessionId parameters to enable
+ * a single queue instance to manage messages for multiple tasks, with
+ * isolation based on task ID and session ID.
+ *
+ * All methods are async to support external storage implementations.
+ * All data in QueuedMessage must be JSON-serializable.
+ *
+ * @experimental
+ */
+export interface TaskMessageQueue {
+ /**
+ * Adds a message to the end of the queue for a specific task.
+ * Atomically checks queue size and throws if maxSize would be exceeded.
+ * @param taskId The task identifier
+ * @param message The message to enqueue
+ * @param sessionId Optional session ID for binding the operation to a specific session
+ * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error
+ * @throws Error if maxSize is specified and would be exceeded
+ */
+ enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise;
+ /**
+ * Removes and returns the first message from the queue for a specific task.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns The first message, or undefined if the queue is empty
+ */
+ dequeue(taskId: string, sessionId?: string): Promise;
+ /**
+ * Removes and returns all messages from the queue for a specific task.
+ * Used when tasks are cancelled or failed to clean up pending messages.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns Array of all messages that were in the queue
+ */
+ dequeueAll(taskId: string, sessionId?: string): Promise;
+}
+/**
+ * Task creation options.
+ * @experimental
+ */
+export interface CreateTaskOptions {
+ /**
+ * Time in milliseconds to keep task results available after completion.
+ * If null, the task has unlimited lifetime until manually cleaned up.
+ */
+ ttl?: number | null;
+ /**
+ * Time in milliseconds to wait between task status requests.
+ */
+ pollInterval?: number;
+ /**
+ * Additional context to pass to the task store.
+ */
+ context?: Record;
+}
+/**
+ * Interface for storing and retrieving task state and results.
+ *
+ * Similar to Transport, this allows pluggable task storage implementations
+ * (in-memory, database, distributed cache, etc.).
+ *
+ * @experimental
+ */
+export interface TaskStore {
+ /**
+ * Creates a new task with the given creation parameters and original request.
+ * The implementation must generate a unique taskId and createdAt timestamp.
+ *
+ * TTL Management:
+ * - The implementation receives the TTL suggested by the requestor via taskParams.ttl
+ * - The implementation MAY override the requested TTL (e.g., to enforce limits)
+ * - The actual TTL used MUST be returned in the Task object
+ * - Null TTL indicates unlimited task lifetime (no automatic cleanup)
+ * - Cleanup SHOULD occur automatically after TTL expires, regardless of task status
+ *
+ * @param taskParams - The task creation parameters from the request (ttl, pollInterval)
+ * @param requestId - The JSON-RPC request ID
+ * @param request - The original request that triggered task creation
+ * @param sessionId - Optional session ID for binding the task to a specific session
+ * @returns The created task object
+ */
+ createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise;
+ /**
+ * Gets the current status of a task.
+ *
+ * @param taskId - The task identifier
+ * @param sessionId - Optional session ID for binding the query to a specific session
+ * @returns The task object, or null if it does not exist
+ */
+ getTask(taskId: string, sessionId?: string): Promise;
+ /**
+ * Stores the result of a task and sets its final status.
+ *
+ * @param taskId - The task identifier
+ * @param status - The final status: 'completed' for success, 'failed' for errors
+ * @param result - The result to store
+ * @param sessionId - Optional session ID for binding the operation to a specific session
+ */
+ storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise;
+ /**
+ * Retrieves the stored result of a task.
+ *
+ * @param taskId - The task identifier
+ * @param sessionId - Optional session ID for binding the query to a specific session
+ * @returns The stored result
+ */
+ getTaskResult(taskId: string, sessionId?: string): Promise;
+ /**
+ * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed').
+ *
+ * @param taskId - The task identifier
+ * @param status - The new status
+ * @param statusMessage - Optional diagnostic message for failed tasks or other status information
+ * @param sessionId - Optional session ID for binding the operation to a specific session
+ */
+ updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise;
+ /**
+ * Lists tasks, optionally starting from a pagination cursor.
+ *
+ * @param cursor - Optional cursor for pagination
+ * @param sessionId - Optional session ID for binding the query to a specific session
+ * @returns An object containing the tasks array and an optional nextCursor
+ */
+ listTasks(cursor?: string, sessionId?: string): Promise<{
+ tasks: Task[];
+ nextCursor?: string;
+ }>;
+}
+/**
+ * Checks if a task status represents a terminal state.
+ * Terminal states are those where the task has finished and will not change.
+ *
+ * @param status - The task status to check
+ * @returns True if the status is terminal (completed, failed, or cancelled)
+ * @experimental
+ */
+export declare function isTerminal(status: Task['status']): boolean;
+//# sourceMappingURL=interfaces.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..afd1d70b06997f4d96a334b28e94fc9c7c321a29
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,IAAI,EACJ,SAAS,EACT,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,OAAO,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAA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QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnH;;;;;;OAMG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnE;;;;;;;OAOG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpH;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnG;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAE1D"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js
new file mode 100644
index 0000000000000000000000000000000000000000..8f533bbae795e8353cd6a065cc3a21e185909a8b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js
@@ -0,0 +1,19 @@
+"use strict";
+/**
+ * Experimental task interfaces for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isTerminal = isTerminal;
+/**
+ * Checks if a task status represents a terminal state.
+ * Terminal states are those where the task has finished and will not change.
+ *
+ * @param status - The task status to check
+ * @returns True if the status is terminal (completed, failed, or cancelled)
+ * @experimental
+ */
+function isTerminal(status) {
+ return status === 'completed' || status === 'failed' || status === 'cancelled';
+}
+//# sourceMappingURL=interfaces.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..c3cd4edd2a55802e1457e300d54feda7cbd40291
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/interfaces.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA2RH,gCAEC;AAVD;;;;;;;GAOG;AACH,SAAgB,UAAU,CAAC,MAAsB;IAC7C,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACnF,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b3244f9d6811cdc419ac94013ea5754a55b22d43
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts
@@ -0,0 +1,77 @@
+/**
+ * Experimental McpServer task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+import type { McpServer, RegisteredTool } from '../../server/mcp.js';
+import type { ZodRawShapeCompat, AnySchema } from '../../server/zod-compat.js';
+import type { ToolAnnotations } from '../../types.js';
+import type { ToolTaskHandler, TaskToolExecution } from './interfaces.js';
+/**
+ * Experimental task features for McpServer.
+ *
+ * Access via `server.experimental.tasks`:
+ * ```typescript
+ * server.experimental.tasks.registerToolTask('long-running', config, handler);
+ * ```
+ *
+ * @experimental
+ */
+export declare class ExperimentalMcpServerTasks {
+ private readonly _mcpServer;
+ constructor(_mcpServer: McpServer);
+ /**
+ * Registers a task-based tool with a config object and handler.
+ *
+ * Task-based tools support long-running operations that can be polled for status
+ * and results. The handler must implement `createTask`, `getTask`, and `getTaskResult`
+ * methods.
+ *
+ * @example
+ * ```typescript
+ * server.experimental.tasks.registerToolTask('long-computation', {
+ * description: 'Performs a long computation',
+ * inputSchema: { input: z.string() },
+ * execution: { taskSupport: 'required' }
+ * }, {
+ * createTask: async (args, extra) => {
+ * const task = await extra.taskStore.createTask({ ttl: 300000 });
+ * startBackgroundWork(task.taskId, args);
+ * return { task };
+ * },
+ * getTask: async (args, extra) => {
+ * return extra.taskStore.getTask(extra.taskId);
+ * },
+ * getTaskResult: async (args, extra) => {
+ * return extra.taskStore.getTaskResult(extra.taskId);
+ * }
+ * });
+ * ```
+ *
+ * @param name - The tool name
+ * @param config - Tool configuration (description, schemas, etc.)
+ * @param handler - Task handler with createTask, getTask, getTaskResult methods
+ * @returns RegisteredTool for managing the tool's lifecycle
+ *
+ * @experimental
+ */
+ registerToolTask(name: string, config: {
+ title?: string;
+ description?: string;
+ outputSchema?: OutputArgs;
+ annotations?: ToolAnnotations;
+ execution?: TaskToolExecution;
+ _meta?: Record;
+ }, handler: ToolTaskHandler): RegisteredTool;
+ registerToolTask(name: string, config: {
+ title?: string;
+ description?: string;
+ inputSchema: InputArgs;
+ outputSchema?: OutputArgs;
+ annotations?: ToolAnnotations;
+ execution?: TaskToolExecution;
+ _meta?: Record;
+ }, handler: ToolTaskHandler): RegisteredTool;
+}
+//# sourceMappingURL=mcp-server.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..84ee9e08d18c277525f2c8635582130457083814
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoB1E;;;;;;;;;GASG;AACH,qBAAa,0BAA0B;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,SAAS;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,gBAAgB,CAAC,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EACzE,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;IAEjB,gBAAgB,CAAC,SAAS,SAAS,iBAAiB,GAAG,SAAS,EAAE,UAAU,SAAS,SAAS,GAAG,iBAAiB,GAAG,SAAS,EAC1H,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,SAAS,CAAC;QACvB,YAAY,CAAC,EAAE,UAAU,CAAC;QAC1B,WAAW,CAAC,EAAE,eAAe,CAAC;QAC9B,SAAS,CAAC,EAAE,iBAAiB,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,GACpC,cAAc;CAsCpB"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js
new file mode 100644
index 0000000000000000000000000000000000000000..a2718e1e0be955b2e32f16ab8c7fc2cdfac32420
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js
@@ -0,0 +1,36 @@
+"use strict";
+/**
+ * Experimental McpServer task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ExperimentalMcpServerTasks = void 0;
+/**
+ * Experimental task features for McpServer.
+ *
+ * Access via `server.experimental.tasks`:
+ * ```typescript
+ * server.experimental.tasks.registerToolTask('long-running', config, handler);
+ * ```
+ *
+ * @experimental
+ */
+class ExperimentalMcpServerTasks {
+ constructor(_mcpServer) {
+ this._mcpServer = _mcpServer;
+ }
+ registerToolTask(name, config, handler) {
+ // Validate that taskSupport is not 'forbidden' for task-based tools
+ const execution = { taskSupport: 'required', ...config.execution };
+ if (execution.taskSupport === 'forbidden') {
+ throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`);
+ }
+ // Access McpServer's internal _createRegisteredTool method
+ const mcpServerInternal = this._mcpServer;
+ return mcpServerInternal._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler);
+ }
+}
+exports.ExperimentalMcpServerTasks = ExperimentalMcpServerTasks;
+//# sourceMappingURL=mcp-server.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ff3e8c49ae2332d564a04167d7150ca69c6a27bd
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/mcp-server.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyBH;;;;;;;;;GASG;AACH,MAAa,0BAA0B;IACnC,YAA6B,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;IAAG,CAAC;IAgEtD,gBAAgB,CAIZ,IAAY,EACZ,MAQC,EACD,OAAmC;QAEnC,oEAAoE;QACpE,MAAM,SAAS,GAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAClF,IAAI,SAAS,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,6DAA6D,CAAC,CAAC;QAC3H,CAAC;QAED,2DAA2D;QAC3D,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAA0C,CAAC;QAC1E,OAAO,iBAAiB,CAAC,qBAAqB,CAC1C,IAAI,EACJ,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,YAAY,EACnB,MAAM,CAAC,WAAW,EAClB,SAAS,EACT,MAAM,CAAC,KAAK,EACZ,OAAwD,CAC3D,CAAC;IACN,CAAC;CACJ;AArGD,gEAqGC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..45ac3d65e0c9547599dd7c78116fa97d5da29f94
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts
@@ -0,0 +1,170 @@
+/**
+ * Experimental server task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+import type { Server } from '../../server/index.js';
+import type { RequestOptions } from '../../shared/protocol.js';
+import type { ResponseMessage } from '../../shared/responseMessage.js';
+import type { AnySchema, SchemaOutput } from '../../server/zod-compat.js';
+import type { ServerRequest, Notification, Request, Result, GetTaskResult, ListTasksResult, CancelTaskResult, CreateMessageRequestParams, CreateMessageResult, ElicitRequestFormParams, ElicitRequestURLParams, ElicitResult } from '../../types.js';
+/**
+ * Experimental task features for low-level MCP servers.
+ *
+ * Access via `server.experimental.tasks`:
+ * ```typescript
+ * const stream = server.experimental.tasks.requestStream(request, schema, options);
+ * ```
+ *
+ * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead.
+ *
+ * @experimental
+ */
+export declare class ExperimentalServerTasks {
+ private readonly _server;
+ constructor(_server: Server);
+ /**
+ * Sends a request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to request processing, allowing you to
+ * observe intermediate task status updates for task-augmented requests.
+ *
+ * @param request - The request to send
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ requestStream(request: ServerRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>;
+ /**
+ * Sends a sampling request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * For task-augmented requests, yields 'taskCreated' and 'taskStatus' messages
+ * before the final result.
+ *
+ * @example
+ * ```typescript
+ * const stream = server.experimental.tasks.createMessageStream({
+ * messages: [{ role: 'user', content: { type: 'text', text: 'Hello' } }],
+ * maxTokens: 100
+ * }, {
+ * onprogress: (progress) => {
+ * // Handle streaming tokens via progress notifications
+ * console.log('Progress:', progress.message);
+ * }
+ * });
+ *
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Task created:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Task status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('Final result:', message.result);
+ * break;
+ * case 'error':
+ * console.error('Error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - The sampling request parameters
+ * @param options - Optional request options (timeout, signal, task creation params, onprogress, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ createMessageStream(params: CreateMessageRequestParams, options?: RequestOptions): AsyncGenerator, void, void>;
+ /**
+ * Sends an elicitation request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * For task-augmented requests (especially URL-based elicitation), yields 'taskCreated'
+ * and 'taskStatus' messages before the final result.
+ *
+ * @example
+ * ```typescript
+ * const stream = server.experimental.tasks.elicitInputStream({
+ * mode: 'url',
+ * message: 'Please authenticate',
+ * elicitationId: 'auth-123',
+ * url: 'https://example.com/auth'
+ * }, {
+ * task: { ttl: 300000 } // Task-augmented for long-running auth flow
+ * });
+ *
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Task created:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Task status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('User action:', message.result.action);
+ * break;
+ * case 'error':
+ * console.error('Error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - The elicitation request parameters
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ elicitInputStream(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): AsyncGenerator, void, void>;
+ /**
+ * Gets the current status of a task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ * @returns The task status
+ *
+ * @experimental
+ */
+ getTask(taskId: string, options?: RequestOptions): Promise;
+ /**
+ * Retrieves the result of a completed task.
+ *
+ * @param taskId - The task identifier
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options
+ * @returns The task result
+ *
+ * @experimental
+ */
+ getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>;
+ /**
+ * Lists tasks with optional pagination.
+ *
+ * @param cursor - Optional pagination cursor
+ * @param options - Optional request options
+ * @returns List of tasks with optional next cursor
+ *
+ * @experimental
+ */
+ listTasks(cursor?: string, options?: RequestOptions): Promise;
+ /**
+ * Cancels a running task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ *
+ * @experimental
+ */
+ cancelTask(taskId: string, options?: RequestOptions): Promise;
+}
+//# sourceMappingURL=server.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..48c996bf2e55de748fa884717f822eb2cda70e2b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EACR,aAAa,EACb,YAAY,EACZ,OAAO,EACP,MAAM,EACN,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACf,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;GAWG;AACH,qBAAa,uBAAuB,CAChC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAClC,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,OAAO,SAAS,MAAM,GAAG,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IAE9E;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,CAAC,SAAS,SAAS,EAC7B,OAAO,EAAE,aAAa,GAAG,QAAQ,EACjC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAY/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,mBAAmB,CACf,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAuDnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,iBAAiB,CACb,MAAM,EAAE,uBAAuB,GAAG,sBAAsB,EACxD,OAAO,CAAC,EAAE,cAAc,GACzB,cAAc,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAoC5D;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAK/E;;;;;;;;;OASG;IACG,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAY9H;;;;;;;;OAQG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAQpF;;;;;;;OAOG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAOxF"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js
new file mode 100644
index 0000000000000000000000000000000000000000..5da86c99d29dc337b333f9840647e10115239381
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js
@@ -0,0 +1,250 @@
+"use strict";
+/**
+ * Experimental server task features for MCP SDK.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ExperimentalServerTasks = void 0;
+const types_js_1 = require("../../types.js");
+/**
+ * Experimental task features for low-level MCP servers.
+ *
+ * Access via `server.experimental.tasks`:
+ * ```typescript
+ * const stream = server.experimental.tasks.requestStream(request, schema, options);
+ * ```
+ *
+ * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead.
+ *
+ * @experimental
+ */
+class ExperimentalServerTasks {
+ constructor(_server) {
+ this._server = _server;
+ }
+ /**
+ * Sends a request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * This method provides streaming access to request processing, allowing you to
+ * observe intermediate task status updates for task-augmented requests.
+ *
+ * @param request - The request to send
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ requestStream(request, resultSchema, options) {
+ return this._server.requestStream(request, resultSchema, options);
+ }
+ /**
+ * Sends a sampling request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * For task-augmented requests, yields 'taskCreated' and 'taskStatus' messages
+ * before the final result.
+ *
+ * @example
+ * ```typescript
+ * const stream = server.experimental.tasks.createMessageStream({
+ * messages: [{ role: 'user', content: { type: 'text', text: 'Hello' } }],
+ * maxTokens: 100
+ * }, {
+ * onprogress: (progress) => {
+ * // Handle streaming tokens via progress notifications
+ * console.log('Progress:', progress.message);
+ * }
+ * });
+ *
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Task created:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Task status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('Final result:', message.result);
+ * break;
+ * case 'error':
+ * console.error('Error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - The sampling request parameters
+ * @param options - Optional request options (timeout, signal, task creation params, onprogress, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ createMessageStream(params, options) {
+ // Access client capabilities via the server
+ const clientCapabilities = this._server.getClientCapabilities();
+ // Capability check - only required when tools/toolChoice are provided
+ if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
+ throw new Error('Client does not support sampling tools capability.');
+ }
+ // Message structure validation - always validate tool_use/tool_result pairs.
+ // These may appear even without tools/toolChoice in the current request when
+ // a previous sampling request returned tool_use and this is a follow-up with results.
+ if (params.messages.length > 0) {
+ const lastMessage = params.messages[params.messages.length - 1];
+ const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
+ const hasToolResults = lastContent.some(c => c.type === 'tool_result');
+ const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
+ const previousContent = previousMessage
+ ? Array.isArray(previousMessage.content)
+ ? previousMessage.content
+ : [previousMessage.content]
+ : [];
+ const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use');
+ if (hasToolResults) {
+ if (lastContent.some(c => c.type !== 'tool_result')) {
+ throw new Error('The last message must contain only tool_result content if any is present');
+ }
+ if (!hasPreviousToolUse) {
+ throw new Error('tool_result blocks are not matching any tool_use from the previous message');
+ }
+ }
+ if (hasPreviousToolUse) {
+ // Extract tool_use IDs from previous message and tool_result IDs from current message
+ const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id));
+ const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId));
+ if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) {
+ throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match');
+ }
+ }
+ }
+ return this.requestStream({
+ method: 'sampling/createMessage',
+ params
+ }, types_js_1.CreateMessageResultSchema, options);
+ }
+ /**
+ * Sends an elicitation request and returns an AsyncGenerator that yields response messages.
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
+ *
+ * For task-augmented requests (especially URL-based elicitation), yields 'taskCreated'
+ * and 'taskStatus' messages before the final result.
+ *
+ * @example
+ * ```typescript
+ * const stream = server.experimental.tasks.elicitInputStream({
+ * mode: 'url',
+ * message: 'Please authenticate',
+ * elicitationId: 'auth-123',
+ * url: 'https://example.com/auth'
+ * }, {
+ * task: { ttl: 300000 } // Task-augmented for long-running auth flow
+ * });
+ *
+ * for await (const message of stream) {
+ * switch (message.type) {
+ * case 'taskCreated':
+ * console.log('Task created:', message.task.taskId);
+ * break;
+ * case 'taskStatus':
+ * console.log('Task status:', message.task.status);
+ * break;
+ * case 'result':
+ * console.log('User action:', message.result.action);
+ * break;
+ * case 'error':
+ * console.error('Error:', message.error);
+ * break;
+ * }
+ * }
+ * ```
+ *
+ * @param params - The elicitation request parameters
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
+ * @returns AsyncGenerator that yields ResponseMessage objects
+ *
+ * @experimental
+ */
+ elicitInputStream(params, options) {
+ // Access client capabilities via the server
+ const clientCapabilities = this._server.getClientCapabilities();
+ const mode = params.mode ?? 'form';
+ // Capability check based on mode
+ switch (mode) {
+ case 'url': {
+ if (!clientCapabilities?.elicitation?.url) {
+ throw new Error('Client does not support url elicitation.');
+ }
+ break;
+ }
+ case 'form': {
+ if (!clientCapabilities?.elicitation?.form) {
+ throw new Error('Client does not support form elicitation.');
+ }
+ break;
+ }
+ }
+ // Normalize params to ensure mode is set for form mode (defaults to 'form' per spec)
+ const normalizedParams = mode === 'form' && params.mode === undefined ? { ...params, mode: 'form' } : params;
+ // Cast to ServerRequest needed because TypeScript can't narrow the union type
+ // based on the discriminated 'method' field when constructing the object literal
+ return this.requestStream({
+ method: 'elicitation/create',
+ params: normalizedParams
+ }, types_js_1.ElicitResultSchema, options);
+ }
+ /**
+ * Gets the current status of a task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ * @returns The task status
+ *
+ * @experimental
+ */
+ async getTask(taskId, options) {
+ return this._server.getTask({ taskId }, options);
+ }
+ /**
+ * Retrieves the result of a completed task.
+ *
+ * @param taskId - The task identifier
+ * @param resultSchema - Zod schema for validating the result
+ * @param options - Optional request options
+ * @returns The task result
+ *
+ * @experimental
+ */
+ async getTaskResult(taskId, resultSchema, options) {
+ return this._server.getTaskResult({ taskId }, resultSchema, options);
+ }
+ /**
+ * Lists tasks with optional pagination.
+ *
+ * @param cursor - Optional pagination cursor
+ * @param options - Optional request options
+ * @returns List of tasks with optional next cursor
+ *
+ * @experimental
+ */
+ async listTasks(cursor, options) {
+ return this._server.listTasks(cursor ? { cursor } : undefined, options);
+ }
+ /**
+ * Cancels a running task.
+ *
+ * @param taskId - The task identifier
+ * @param options - Optional request options
+ *
+ * @experimental
+ */
+ async cancelTask(taskId, options) {
+ return this._server.cancelTask({ taskId }, options);
+ }
+}
+exports.ExperimentalServerTasks = ExperimentalServerTasks;
+//# sourceMappingURL=server.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..5beb3169a185b78d0cb2eb7c1d3aca23cff586d2
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/server.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/server.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAoBH,6CAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAa,uBAAuB;IAKhC,YAA6B,OAAiD;QAAjD,YAAO,GAAP,OAAO,CAA0C;IAAG,CAAC;IAElF;;;;;;;;;;;;;O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BAAoB;YAC5B,MAAM,EAAE,gBAAgB;SACV,EAClB,6BAAkB,EAClB,OAAO,CACV,CAAC;IACN,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,OAAwB;QAElD,OAAQ,IAAI,CAAC,OAAwC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CAAsB,MAAc,EAAE,YAAgB,EAAE,OAAwB;QAC/F,OACI,IAAI,CAAC,OAOR,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,OAAwB;QACrD,OACI,IAAI,CAAC,OAGR,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AA/RD,0DA+RC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d30795e30cb4cfad41070493871347652a2ebe98
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts
@@ -0,0 +1,94 @@
+/**
+ * In-memory implementations of TaskStore and TaskMessageQueue.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+import { Task, RequestId, Result, Request } from '../../../types.js';
+import { TaskStore, TaskMessageQueue, QueuedMessage, CreateTaskOptions } from '../interfaces.js';
+/**
+ * A simple in-memory implementation of TaskStore for demonstration purposes.
+ *
+ * This implementation stores all tasks in memory and provides automatic cleanup
+ * based on the ttl duration specified in the task creation parameters.
+ *
+ * Note: This is not suitable for production use as all data is lost on restart.
+ * For production, consider implementing TaskStore with a database or distributed cache.
+ *
+ * @experimental
+ */
+export declare class InMemoryTaskStore implements TaskStore {
+ private tasks;
+ private cleanupTimers;
+ /**
+ * Generates a unique task ID.
+ * Uses 16 bytes of random data encoded as hex (32 characters).
+ */
+ private generateTaskId;
+ createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, _sessionId?: string): Promise;
+ getTask(taskId: string, _sessionId?: string): Promise;
+ storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, _sessionId?: string): Promise;
+ getTaskResult(taskId: string, _sessionId?: string): Promise;
+ updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, _sessionId?: string): Promise;
+ listTasks(cursor?: string, _sessionId?: string): Promise<{
+ tasks: Task[];
+ nextCursor?: string;
+ }>;
+ /**
+ * Cleanup all timers (useful for testing or graceful shutdown)
+ */
+ cleanup(): void;
+ /**
+ * Get all tasks (useful for debugging)
+ */
+ getAllTasks(): Task[];
+}
+/**
+ * A simple in-memory implementation of TaskMessageQueue for demonstration purposes.
+ *
+ * This implementation stores messages in memory, organized by task ID and optional session ID.
+ * Messages are stored in FIFO queues per task.
+ *
+ * Note: This is not suitable for production use in distributed systems.
+ * For production, consider implementing TaskMessageQueue with Redis or other distributed queues.
+ *
+ * @experimental
+ */
+export declare class InMemoryTaskMessageQueue implements TaskMessageQueue {
+ private queues;
+ /**
+ * Generates a queue key from taskId.
+ * SessionId is intentionally ignored because taskIds are globally unique
+ * and tasks need to be accessible across HTTP requests/sessions.
+ */
+ private getQueueKey;
+ /**
+ * Gets or creates a queue for the given task and session.
+ */
+ private getQueue;
+ /**
+ * Adds a message to the end of the queue for a specific task.
+ * Atomically checks queue size and throws if maxSize would be exceeded.
+ * @param taskId The task identifier
+ * @param message The message to enqueue
+ * @param sessionId Optional session ID for binding the operation to a specific session
+ * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error
+ * @throws Error if maxSize is specified and would be exceeded
+ */
+ enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise;
+ /**
+ * Removes and returns the first message from the queue for a specific task.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns The first message, or undefined if the queue is empty
+ */
+ dequeue(taskId: string, sessionId?: string): Promise;
+ /**
+ * Removes and returns all messages from the queue for a specific task.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns Array of all messages that were in the queue
+ */
+ dequeueAll(taskId: string, sessionId?: string): Promise;
+}
+//# sourceMappingURL=in-memory.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..1825e8751d930035b9da182b51f26872a09bcecb
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAc,gBAAgB,EAAE,aAAa,EAAE,i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sC;IAEpD;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAUhB;;;;;;;;OAQG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1G;;;;;OAKG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAKrF;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAMjF"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js
new file mode 100644
index 0000000000000000000000000000000000000000..fe1b1e7fc419249b82218afbf4dbbb995a8efac5
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js
@@ -0,0 +1,251 @@
+"use strict";
+/**
+ * In-memory implementations of TaskStore and TaskMessageQueue.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.InMemoryTaskMessageQueue = exports.InMemoryTaskStore = void 0;
+const interfaces_js_1 = require("../interfaces.js");
+const node_crypto_1 = require("node:crypto");
+/**
+ * A simple in-memory implementation of TaskStore for demonstration purposes.
+ *
+ * This implementation stores all tasks in memory and provides automatic cleanup
+ * based on the ttl duration specified in the task creation parameters.
+ *
+ * Note: This is not suitable for production use as all data is lost on restart.
+ * For production, consider implementing TaskStore with a database or distributed cache.
+ *
+ * @experimental
+ */
+class InMemoryTaskStore {
+ constructor() {
+ this.tasks = new Map();
+ this.cleanupTimers = new Map();
+ }
+ /**
+ * Generates a unique task ID.
+ * Uses 16 bytes of random data encoded as hex (32 characters).
+ */
+ generateTaskId() {
+ return (0, node_crypto_1.randomBytes)(16).toString('hex');
+ }
+ async createTask(taskParams, requestId, request, _sessionId) {
+ // Generate a unique task ID
+ const taskId = this.generateTaskId();
+ // Ensure uniqueness
+ if (this.tasks.has(taskId)) {
+ throw new Error(`Task with ID ${taskId} already exists`);
+ }
+ const actualTtl = taskParams.ttl ?? null;
+ // Create task with generated ID and timestamps
+ const createdAt = new Date().toISOString();
+ const task = {
+ taskId,
+ status: 'working',
+ ttl: actualTtl,
+ createdAt,
+ lastUpdatedAt: createdAt,
+ pollInterval: taskParams.pollInterval ?? 1000
+ };
+ this.tasks.set(taskId, {
+ task,
+ request,
+ requestId
+ });
+ // Schedule cleanup if ttl is specified
+ // Cleanup occurs regardless of task status
+ if (actualTtl) {
+ const timer = setTimeout(() => {
+ this.tasks.delete(taskId);
+ this.cleanupTimers.delete(taskId);
+ }, actualTtl);
+ this.cleanupTimers.set(taskId, timer);
+ }
+ return task;
+ }
+ async getTask(taskId, _sessionId) {
+ const stored = this.tasks.get(taskId);
+ return stored ? { ...stored.task } : null;
+ }
+ async storeTaskResult(taskId, status, result, _sessionId) {
+ const stored = this.tasks.get(taskId);
+ if (!stored) {
+ throw new Error(`Task with ID ${taskId} not found`);
+ }
+ // Don't allow storing results for tasks already in terminal state
+ if ((0, interfaces_js_1.isTerminal)(stored.task.status)) {
+ throw new Error(`Cannot store result for task ${taskId} in terminal status '${stored.task.status}'. Task results can only be stored once.`);
+ }
+ stored.result = result;
+ stored.task.status = status;
+ stored.task.lastUpdatedAt = new Date().toISOString();
+ // Reset cleanup timer to start from now (if ttl is set)
+ if (stored.task.ttl) {
+ const existingTimer = this.cleanupTimers.get(taskId);
+ if (existingTimer) {
+ clearTimeout(existingTimer);
+ }
+ const timer = setTimeout(() => {
+ this.tasks.delete(taskId);
+ this.cleanupTimers.delete(taskId);
+ }, stored.task.ttl);
+ this.cleanupTimers.set(taskId, timer);
+ }
+ }
+ async getTaskResult(taskId, _sessionId) {
+ const stored = this.tasks.get(taskId);
+ if (!stored) {
+ throw new Error(`Task with ID ${taskId} not found`);
+ }
+ if (!stored.result) {
+ throw new Error(`Task ${taskId} has no result stored`);
+ }
+ return stored.result;
+ }
+ async updateTaskStatus(taskId, status, statusMessage, _sessionId) {
+ const stored = this.tasks.get(taskId);
+ if (!stored) {
+ throw new Error(`Task with ID ${taskId} not found`);
+ }
+ // Don't allow transitions from terminal states
+ if ((0, interfaces_js_1.isTerminal)(stored.task.status)) {
+ throw new Error(`Cannot update task ${taskId} from terminal status '${stored.task.status}' to '${status}'. Terminal states (completed, failed, cancelled) cannot transition to other states.`);
+ }
+ stored.task.status = status;
+ if (statusMessage) {
+ stored.task.statusMessage = statusMessage;
+ }
+ stored.task.lastUpdatedAt = new Date().toISOString();
+ // If task is in a terminal state and has ttl, start cleanup timer
+ if ((0, interfaces_js_1.isTerminal)(status) && stored.task.ttl) {
+ const existingTimer = this.cleanupTimers.get(taskId);
+ if (existingTimer) {
+ clearTimeout(existingTimer);
+ }
+ const timer = setTimeout(() => {
+ this.tasks.delete(taskId);
+ this.cleanupTimers.delete(taskId);
+ }, stored.task.ttl);
+ this.cleanupTimers.set(taskId, timer);
+ }
+ }
+ async listTasks(cursor, _sessionId) {
+ const PAGE_SIZE = 10;
+ const allTaskIds = Array.from(this.tasks.keys());
+ let startIndex = 0;
+ if (cursor) {
+ const cursorIndex = allTaskIds.indexOf(cursor);
+ if (cursorIndex >= 0) {
+ startIndex = cursorIndex + 1;
+ }
+ else {
+ // Invalid cursor - throw error
+ throw new Error(`Invalid cursor: ${cursor}`);
+ }
+ }
+ const pageTaskIds = allTaskIds.slice(startIndex, startIndex + PAGE_SIZE);
+ const tasks = pageTaskIds.map(taskId => {
+ const stored = this.tasks.get(taskId);
+ return { ...stored.task };
+ });
+ const nextCursor = startIndex + PAGE_SIZE < allTaskIds.length ? pageTaskIds[pageTaskIds.length - 1] : undefined;
+ return { tasks, nextCursor };
+ }
+ /**
+ * Cleanup all timers (useful for testing or graceful shutdown)
+ */
+ cleanup() {
+ for (const timer of this.cleanupTimers.values()) {
+ clearTimeout(timer);
+ }
+ this.cleanupTimers.clear();
+ this.tasks.clear();
+ }
+ /**
+ * Get all tasks (useful for debugging)
+ */
+ getAllTasks() {
+ return Array.from(this.tasks.values()).map(stored => ({ ...stored.task }));
+ }
+}
+exports.InMemoryTaskStore = InMemoryTaskStore;
+/**
+ * A simple in-memory implementation of TaskMessageQueue for demonstration purposes.
+ *
+ * This implementation stores messages in memory, organized by task ID and optional session ID.
+ * Messages are stored in FIFO queues per task.
+ *
+ * Note: This is not suitable for production use in distributed systems.
+ * For production, consider implementing TaskMessageQueue with Redis or other distributed queues.
+ *
+ * @experimental
+ */
+class InMemoryTaskMessageQueue {
+ constructor() {
+ this.queues = new Map();
+ }
+ /**
+ * Generates a queue key from taskId.
+ * SessionId is intentionally ignored because taskIds are globally unique
+ * and tasks need to be accessible across HTTP requests/sessions.
+ */
+ getQueueKey(taskId, _sessionId) {
+ return taskId;
+ }
+ /**
+ * Gets or creates a queue for the given task and session.
+ */
+ getQueue(taskId, sessionId) {
+ const key = this.getQueueKey(taskId, sessionId);
+ let queue = this.queues.get(key);
+ if (!queue) {
+ queue = [];
+ this.queues.set(key, queue);
+ }
+ return queue;
+ }
+ /**
+ * Adds a message to the end of the queue for a specific task.
+ * Atomically checks queue size and throws if maxSize would be exceeded.
+ * @param taskId The task identifier
+ * @param message The message to enqueue
+ * @param sessionId Optional session ID for binding the operation to a specific session
+ * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error
+ * @throws Error if maxSize is specified and would be exceeded
+ */
+ async enqueue(taskId, message, sessionId, maxSize) {
+ const queue = this.getQueue(taskId, sessionId);
+ // Atomically check size and enqueue
+ if (maxSize !== undefined && queue.length >= maxSize) {
+ throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`);
+ }
+ queue.push(message);
+ }
+ /**
+ * Removes and returns the first message from the queue for a specific task.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns The first message, or undefined if the queue is empty
+ */
+ async dequeue(taskId, sessionId) {
+ const queue = this.getQueue(taskId, sessionId);
+ return queue.shift();
+ }
+ /**
+ * Removes and returns all messages from the queue for a specific task.
+ * @param taskId The task identifier
+ * @param sessionId Optional session ID for binding the query to a specific session
+ * @returns Array of all messages that were in the queue
+ */
+ async dequeueAll(taskId, sessionId) {
+ const key = this.getQueueKey(taskId, sessionId);
+ const queue = this.queues.get(key) ?? [];
+ this.queues.delete(key);
+ return queue;
+ }
+}
+exports.InMemoryTaskMessageQueue = InMemoryTaskMessageQueue;
+//# sourceMappingURL=in-memory.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a4d21a90a49a4d95b4b36130038a88491cff6cfa
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/stores/in-memory.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"in-memory.js","sourceRoot":"","sources":["../../../../../src/experimental/tasks/stores/in-memory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oDAA6G;AAC7G,6CAA0C;AAS1C;;;;;;;;;;GAUG;AACH,MAAa,iBAAiB;IAA9B;QACY,UAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;QACtC,kBAAa,GAAG,IAAI,GAAG,EAAyC,CAAC;IAsL7E,CAAC;IApLG;;;OAGG;IACK,cAAc;QAClB,OAAO,IAAA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M,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AApED,4DAoEC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6022e19b27627032390f74cc65587fa26d5eaf7f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts
@@ -0,0 +1,10 @@
+/**
+ * Re-exports of task-related types from the MCP protocol spec.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * These types are defined in types.ts (matching the protocol spec) and
+ * re-exported here for convenience when working with experimental task features.
+ */
+export { TaskCreationParamsSchema, RelatedTaskMetadataSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema } from '../../types.js';
+export type { Task, TaskCreationParams, RelatedTaskMetadata, CreateTaskResult, TaskStatusNotificationParams, TaskStatusNotification, GetTaskRequest, GetTaskResult, GetTaskPayloadRequest, ListTasksRequest, ListTasksResult, CancelTaskRequest, CancelTaskResult } from '../../types.js';
+//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..f7b9ead05f5b06209e37b122aecf44d75b777af2
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC9B,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACR,IAAI,EACJ,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACnB,MAAM,gBAAgB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js
new file mode 100644
index 0000000000000000000000000000000000000000..b051c848b47eca368d966cd03ec6be71de8f0c47
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js
@@ -0,0 +1,28 @@
+"use strict";
+/**
+ * Re-exports of task-related types from the MCP protocol spec.
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * These types are defined in types.ts (matching the protocol spec) and
+ * re-exported here for convenience when working with experimental task features.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ServerTasksCapabilitySchema = exports.ClientTasksCapabilitySchema = exports.CancelTaskResultSchema = exports.CancelTaskRequestSchema = exports.ListTasksResultSchema = exports.ListTasksRequestSchema = exports.GetTaskPayloadRequestSchema = exports.GetTaskResultSchema = exports.GetTaskRequestSchema = exports.TaskStatusNotificationSchema = exports.TaskStatusNotificationParamsSchema = exports.CreateTaskResultSchema = exports.TaskSchema = exports.RelatedTaskMetadataSchema = exports.TaskCreationParamsSchema = void 0;
+// Task schemas (Zod)
+var types_js_1 = require("../../types.js");
+Object.defineProperty(exports, "TaskCreationParamsSchema", { enumerable: true, get: function () { return types_js_1.TaskCreationParamsSchema; } });
+Object.defineProperty(exports, "RelatedTaskMetadataSchema", { enumerable: true, get: function () { return types_js_1.RelatedTaskMetadataSchema; } });
+Object.defineProperty(exports, "TaskSchema", { enumerable: true, get: function () { return types_js_1.TaskSchema; } });
+Object.defineProperty(exports, "CreateTaskResultSchema", { enumerable: true, get: function () { return types_js_1.CreateTaskResultSchema; } });
+Object.defineProperty(exports, "TaskStatusNotificationParamsSchema", { enumerable: true, get: function () { return types_js_1.TaskStatusNotificationParamsSchema; } });
+Object.defineProperty(exports, "TaskStatusNotificationSchema", { enumerable: true, get: function () { return types_js_1.TaskStatusNotificationSchema; } });
+Object.defineProperty(exports, "GetTaskRequestSchema", { enumerable: true, get: function () { return types_js_1.GetTaskRequestSchema; } });
+Object.defineProperty(exports, "GetTaskResultSchema", { enumerable: true, get: function () { return types_js_1.GetTaskResultSchema; } });
+Object.defineProperty(exports, "GetTaskPayloadRequestSchema", { enumerable: true, get: function () { return types_js_1.GetTaskPayloadRequestSchema; } });
+Object.defineProperty(exports, "ListTasksRequestSchema", { enumerable: true, get: function () { return types_js_1.ListTasksRequestSchema; } });
+Object.defineProperty(exports, "ListTasksResultSchema", { enumerable: true, get: function () { return types_js_1.ListTasksResultSchema; } });
+Object.defineProperty(exports, "CancelTaskRequestSchema", { enumerable: true, get: function () { return types_js_1.CancelTaskRequestSchema; } });
+Object.defineProperty(exports, "CancelTaskResultSchema", { enumerable: true, get: function () { return types_js_1.CancelTaskResultSchema; } });
+Object.defineProperty(exports, "ClientTasksCapabilitySchema", { enumerable: true, get: function () { return types_js_1.ClientTasksCapabilitySchema; } });
+Object.defineProperty(exports, "ServerTasksCapabilitySchema", { enumerable: true, get: function () { return types_js_1.ServerTasksCapabilitySchema; } });
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..adfc3ab50bd5ba05fffe1260e6487c52be2db9c4
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/experimental/tasks/types.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/experimental/tasks/types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qBAAqB;AACrB,2CAgBwB;AAfpB,oHAAA,wBAAwB,OAAA;AACxB,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,8HAAA,kCAAkC,OAAA;AAClC,wHAAA,4BAA4B,OAAA;AAC5B,gHAAA,oBAAoB,OAAA;AACpB,+GAAA,mBAAmB,OAAA;AACnB,uHAAA,2BAA2B,OAAA;AAC3B,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,mHAAA,uBAAuB,OAAA;AACvB,kHAAA,sBAAsB,OAAA;AACtB,uHAAA,2BAA2B,OAAA;AAC3B,uHAAA,2BAA2B,OAAA"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..32a931a8636db7e1bbe7530a07335df266812d06
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts
@@ -0,0 +1,31 @@
+import { Transport } from './shared/transport.js';
+import { JSONRPCMessage, RequestId } from './types.js';
+import { AuthInfo } from './server/auth/types.js';
+/**
+ * In-memory transport for creating clients and servers that talk to each other within the same process.
+ */
+export declare class InMemoryTransport implements Transport {
+ private _otherTransport?;
+ private _messageQueue;
+ onclose?: () => void;
+ onerror?: (error: Error) => void;
+ onmessage?: (message: JSONRPCMessage, extra?: {
+ authInfo?: AuthInfo;
+ }) => void;
+ sessionId?: string;
+ /**
+ * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server.
+ */
+ static createLinkedPair(): [InMemoryTransport, InMemoryTransport];
+ start(): Promise;
+ close(): Promise;
+ /**
+ * Sends a message with optional auth info.
+ * This is useful for testing authentication scenarios.
+ */
+ send(message: JSONRPCMessage, options?: {
+ relatedRequestId?: RequestId;
+ authInfo?: AuthInfo;
+ }): Promise;
+}
+//# sourceMappingURL=inMemory.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..46bc74be1794c252b30af9a064ada512cb212e51
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"inMemory.d.ts","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,SAAS;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAoB;IAC5C,OAAO,CAAC,aAAa,CAAuB;IAE5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAQ3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAWtH"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js
new file mode 100644
index 0000000000000000000000000000000000000000..9c6cb0e2c3f1bb2a8f3369eb156e41b92572b15a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js
@@ -0,0 +1,51 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.InMemoryTransport = void 0;
+/**
+ * In-memory transport for creating clients and servers that talk to each other within the same process.
+ */
+class InMemoryTransport {
+ constructor() {
+ this._messageQueue = [];
+ }
+ /**
+ * Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server.
+ */
+ static createLinkedPair() {
+ const clientTransport = new InMemoryTransport();
+ const serverTransport = new InMemoryTransport();
+ clientTransport._otherTransport = serverTransport;
+ serverTransport._otherTransport = clientTransport;
+ return [clientTransport, serverTransport];
+ }
+ async start() {
+ // Process any messages that were queued before start was called
+ while (this._messageQueue.length > 0) {
+ const queuedMessage = this._messageQueue.shift();
+ this.onmessage?.(queuedMessage.message, queuedMessage.extra);
+ }
+ }
+ async close() {
+ const other = this._otherTransport;
+ this._otherTransport = undefined;
+ await other?.close();
+ this.onclose?.();
+ }
+ /**
+ * Sends a message with optional auth info.
+ * This is useful for testing authentication scenarios.
+ */
+ async send(message, options) {
+ if (!this._otherTransport) {
+ throw new Error('Not connected');
+ }
+ if (this._otherTransport.onmessage) {
+ this._otherTransport.onmessage(message, { authInfo: options?.authInfo });
+ }
+ else {
+ this._otherTransport._messageQueue.push({ message, extra: { authInfo: options?.authInfo } });
+ }
+ }
+}
+exports.InMemoryTransport = InMemoryTransport;
+//# sourceMappingURL=inMemory.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a45f3a89f62ffe6e50a9931dc8993a8ca0fd7ef2
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/inMemory.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"inMemory.js","sourceRoot":"","sources":["../../src/inMemory.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,MAAa,iBAAiB;IAA9B;QAEY,kBAAa,GAAoB,EAAE,CAAC;IAgDhD,CAAC;IAzCG;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACnB,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAChD,MAAM,eAAe,GAAG,IAAI,iBAAiB,EA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t-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..b731bd61b9cefea28f38a00e57c8cb9a3866bd84
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/package.json
@@ -0,0 +1 @@
+{"type": "commonjs"}
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..be6899a198cacbb5c88e991884c7218b58ac4edc
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts
@@ -0,0 +1,19 @@
+import { OAuthClientInformationFull } from '../../shared/auth.js';
+/**
+ * Stores information about registered OAuth clients for this server.
+ */
+export interface OAuthRegisteredClientsStore {
+ /**
+ * Returns information about a registered client, based on its ID.
+ */
+ getClient(clientId: string): OAuthClientInformationFull | undefined | Promise;
+ /**
+ * Registers a new client with the server. The client ID and secret will be automatically generated by the library. A modified version of the client information can be returned to reflect specific values enforced by the server.
+ *
+ * NOTE: Implementations should NOT delete expired client secrets in-place. Auth middleware provided by this library will automatically check the `client_secret_expires_at` field and reject requests with expired secrets. Any custom logic for authenticating clients should check the `client_secret_expires_at` field as well.
+ *
+ * If unimplemented, dynamic client registration is unsupported.
+ */
+ registerClient?(client: Omit): OAuthClientInformationFull | Promise;
+}
+//# sourceMappingURL=clients.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..ab3851db35974587a2ea2a262e34b034d26e69b5
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;IAEtH;;;;;;OAMG;IACH,cAAc,CAAC,CACX,MAAM,EAAE,IAAI,CAAC,0BAA0B,EAAE,WAAW,GAAG,qBAAqB,CAAC,GAC9E,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACvE"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js
new file mode 100644
index 0000000000000000000000000000000000000000..866b88b74bd7c8c3cc4137a50281299f4fc0f753
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=clients.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..02101044221db6c3f382512c33f94592d157c748
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/clients.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/server/auth/clients.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7fddf954cf66a216654e1f407de13375f29438a7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts
@@ -0,0 +1,148 @@
+import { OAuthErrorResponse } from '../../shared/auth.js';
+/**
+ * Base class for all OAuth errors
+ */
+export declare class OAuthError extends Error {
+ readonly errorUri?: string | undefined;
+ static errorCode: string;
+ constructor(message: string, errorUri?: string | undefined);
+ /**
+ * Converts the error to a standard OAuth error response object
+ */
+ toResponseObject(): OAuthErrorResponse;
+ get errorCode(): string;
+}
+/**
+ * Invalid request error - The request is missing a required parameter,
+ * includes an invalid parameter value, includes a parameter more than once,
+ * or is otherwise malformed.
+ */
+export declare class InvalidRequestError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid client error - Client authentication failed (e.g., unknown client, no client
+ * authentication included, or unsupported authentication method).
+ */
+export declare class InvalidClientError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid grant error - The provided authorization grant or refresh token is
+ * invalid, expired, revoked, does not match the redirection URI used in the
+ * authorization request, or was issued to another client.
+ */
+export declare class InvalidGrantError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Unauthorized client error - The authenticated client is not authorized to use
+ * this authorization grant type.
+ */
+export declare class UnauthorizedClientError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Unsupported grant type error - The authorization grant type is not supported
+ * by the authorization server.
+ */
+export declare class UnsupportedGrantTypeError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid scope error - The requested scope is invalid, unknown, malformed, or
+ * exceeds the scope granted by the resource owner.
+ */
+export declare class InvalidScopeError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Access denied error - The resource owner or authorization server denied the request.
+ */
+export declare class AccessDeniedError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Server error - The authorization server encountered an unexpected condition
+ * that prevented it from fulfilling the request.
+ */
+export declare class ServerError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Temporarily unavailable error - The authorization server is currently unable to
+ * handle the request due to a temporary overloading or maintenance of the server.
+ */
+export declare class TemporarilyUnavailableError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Unsupported response type error - The authorization server does not support
+ * obtaining an authorization code using this method.
+ */
+export declare class UnsupportedResponseTypeError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Unsupported token type error - The authorization server does not support
+ * the requested token type.
+ */
+export declare class UnsupportedTokenTypeError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid token error - The access token provided is expired, revoked, malformed,
+ * or invalid for other reasons.
+ */
+export declare class InvalidTokenError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Method not allowed error - The HTTP method used is not allowed for this endpoint.
+ * (Custom, non-standard error)
+ */
+export declare class MethodNotAllowedError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Too many requests error - Rate limit exceeded.
+ * (Custom, non-standard error based on RFC 6585)
+ */
+export declare class TooManyRequestsError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid client metadata error - The client metadata is invalid.
+ * (Custom error for dynamic client registration - RFC 7591)
+ */
+export declare class InvalidClientMetadataError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Insufficient scope error - The request requires higher privileges than provided by the access token.
+ */
+export declare class InsufficientScopeError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * Invalid target error - The requested resource is invalid, missing, unknown, or malformed.
+ * (Custom error for resource indicators - RFC 8707)
+ */
+export declare class InvalidTargetError extends OAuthError {
+ static errorCode: string;
+}
+/**
+ * A utility class for defining one-off error codes
+ */
+export declare class CustomOAuthError extends OAuthError {
+ private readonly customErrorCode;
+ constructor(customErrorCode: string, message: string, errorUri?: string);
+ get errorCode(): string;
+}
+/**
+ * A full list of all OAuthErrors, enabling parsing from error responses
+ */
+export declare const OAUTH_ERRORS: {
+ readonly [x: string]: typeof InvalidRequestError;
+};
+//# sourceMappingURL=errors.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5c0e99202519bd00ce7cb567c1997c5c79f62a26
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAKb,QAAQ,CAAC,EAAE,MAAM;IAJrC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACC,QAAQ,CAAC,EAAE,MAAM,YAAA;IAMrC;;OAEG;IACH,gBAAgB,IAAI,kBAAkB;IAatC,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IAC/C,MAAM,CAAC,SAAS,SAAqB;CACxC;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IAC9C,MAAM,CAAC,SAAS,SAAoB;CACvC;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC7C,MAAM,CAAC,SAAS,SAAm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,UAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,MAAM,EACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM;IAKrB,IAAI,SAAS,IAAI,MAAM,CAEtB;CACJ;AAED;;GAEG;AACH,eAAO,MAAM,YAAY;;CAkBf,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js
new file mode 100644
index 0000000000000000000000000000000000000000..e67478c3cec6b718424c16657d70ef11924fc4cf
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js
@@ -0,0 +1,202 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.OAUTH_ERRORS = exports.CustomOAuthError = exports.InvalidTargetError = exports.InsufficientScopeError = exports.InvalidClientMetadataError = exports.TooManyRequestsError = exports.MethodNotAllowedError = exports.InvalidTokenError = exports.UnsupportedTokenTypeError = exports.UnsupportedResponseTypeError = exports.TemporarilyUnavailableError = exports.ServerError = exports.AccessDeniedError = exports.InvalidScopeError = exports.UnsupportedGrantTypeError = exports.UnauthorizedClientError = exports.InvalidGrantError = exports.InvalidClientError = exports.InvalidRequestError = exports.OAuthError = void 0;
+/**
+ * Base class for all OAuth errors
+ */
+class OAuthError extends Error {
+ constructor(message, errorUri) {
+ super(message);
+ this.errorUri = errorUri;
+ this.name = this.constructor.name;
+ }
+ /**
+ * Converts the error to a standard OAuth error response object
+ */
+ toResponseObject() {
+ const response = {
+ error: this.errorCode,
+ error_description: this.message
+ };
+ if (this.errorUri) {
+ response.error_uri = this.errorUri;
+ }
+ return response;
+ }
+ get errorCode() {
+ return this.constructor.errorCode;
+ }
+}
+exports.OAuthError = OAuthError;
+/**
+ * Invalid request error - The request is missing a required parameter,
+ * includes an invalid parameter value, includes a parameter more than once,
+ * or is otherwise malformed.
+ */
+class InvalidRequestError extends OAuthError {
+}
+exports.InvalidRequestError = InvalidRequestError;
+InvalidRequestError.errorCode = 'invalid_request';
+/**
+ * Invalid client error - Client authentication failed (e.g., unknown client, no client
+ * authentication included, or unsupported authentication method).
+ */
+class InvalidClientError extends OAuthError {
+}
+exports.InvalidClientError = InvalidClientError;
+InvalidClientError.errorCode = 'invalid_client';
+/**
+ * Invalid grant error - The provided authorization grant or refresh token is
+ * invalid, expired, revoked, does not match the redirection URI used in the
+ * authorization request, or was issued to another client.
+ */
+class InvalidGrantError extends OAuthError {
+}
+exports.InvalidGrantError = InvalidGrantError;
+InvalidGrantError.errorCode = 'invalid_grant';
+/**
+ * Unauthorized client error - The authenticated client is not authorized to use
+ * this authorization grant type.
+ */
+class UnauthorizedClientError extends OAuthError {
+}
+exports.UnauthorizedClientError = UnauthorizedClientError;
+UnauthorizedClientError.errorCode = 'unauthorized_client';
+/**
+ * Unsupported grant type error - The authorization grant type is not supported
+ * by the authorization server.
+ */
+class UnsupportedGrantTypeError extends OAuthError {
+}
+exports.UnsupportedGrantTypeError = UnsupportedGrantTypeError;
+UnsupportedGrantTypeError.errorCode = 'unsupported_grant_type';
+/**
+ * Invalid scope error - The requested scope is invalid, unknown, malformed, or
+ * exceeds the scope granted by the resource owner.
+ */
+class InvalidScopeError extends OAuthError {
+}
+exports.InvalidScopeError = InvalidScopeError;
+InvalidScopeError.errorCode = 'invalid_scope';
+/**
+ * Access denied error - The resource owner or authorization server denied the request.
+ */
+class AccessDeniedError extends OAuthError {
+}
+exports.AccessDeniedError = AccessDeniedError;
+AccessDeniedError.errorCode = 'access_denied';
+/**
+ * Server error - The authorization server encountered an unexpected condition
+ * that prevented it from fulfilling the request.
+ */
+class ServerError extends OAuthError {
+}
+exports.ServerError = ServerError;
+ServerError.errorCode = 'server_error';
+/**
+ * Temporarily unavailable error - The authorization server is currently unable to
+ * handle the request due to a temporary overloading or maintenance of the server.
+ */
+class TemporarilyUnavailableError extends OAuthError {
+}
+exports.TemporarilyUnavailableError = TemporarilyUnavailableError;
+TemporarilyUnavailableError.errorCode = 'temporarily_unavailable';
+/**
+ * Unsupported response type error - The authorization server does not support
+ * obtaining an authorization code using this method.
+ */
+class UnsupportedResponseTypeError extends OAuthError {
+}
+exports.UnsupportedResponseTypeError = UnsupportedResponseTypeError;
+UnsupportedResponseTypeError.errorCode = 'unsupported_response_type';
+/**
+ * Unsupported token type error - The authorization server does not support
+ * the requested token type.
+ */
+class UnsupportedTokenTypeError extends OAuthError {
+}
+exports.UnsupportedTokenTypeError = UnsupportedTokenTypeError;
+UnsupportedTokenTypeError.errorCode = 'unsupported_token_type';
+/**
+ * Invalid token error - The access token provided is expired, revoked, malformed,
+ * or invalid for other reasons.
+ */
+class InvalidTokenError extends OAuthError {
+}
+exports.InvalidTokenError = InvalidTokenError;
+InvalidTokenError.errorCode = 'invalid_token';
+/**
+ * Method not allowed error - The HTTP method used is not allowed for this endpoint.
+ * (Custom, non-standard error)
+ */
+class MethodNotAllowedError extends OAuthError {
+}
+exports.MethodNotAllowedError = MethodNotAllowedError;
+MethodNotAllowedError.errorCode = 'method_not_allowed';
+/**
+ * Too many requests error - Rate limit exceeded.
+ * (Custom, non-standard error based on RFC 6585)
+ */
+class TooManyRequestsError extends OAuthError {
+}
+exports.TooManyRequestsError = TooManyRequestsError;
+TooManyRequestsError.errorCode = 'too_many_requests';
+/**
+ * Invalid client metadata error - The client metadata is invalid.
+ * (Custom error for dynamic client registration - RFC 7591)
+ */
+class InvalidClientMetadataError extends OAuthError {
+}
+exports.InvalidClientMetadataError = InvalidClientMetadataError;
+InvalidClientMetadataError.errorCode = 'invalid_client_metadata';
+/**
+ * Insufficient scope error - The request requires higher privileges than provided by the access token.
+ */
+class InsufficientScopeError extends OAuthError {
+}
+exports.InsufficientScopeError = InsufficientScopeError;
+InsufficientScopeError.errorCode = 'insufficient_scope';
+/**
+ * Invalid target error - The requested resource is invalid, missing, unknown, or malformed.
+ * (Custom error for resource indicators - RFC 8707)
+ */
+class InvalidTargetError extends OAuthError {
+}
+exports.InvalidTargetError = InvalidTargetError;
+InvalidTargetError.errorCode = 'invalid_target';
+/**
+ * A utility class for defining one-off error codes
+ */
+class CustomOAuthError extends OAuthError {
+ constructor(customErrorCode, message, errorUri) {
+ super(message, errorUri);
+ this.customErrorCode = customErrorCode;
+ }
+ get errorCode() {
+ return this.customErrorCode;
+ }
+}
+exports.CustomOAuthError = CustomOAuthError;
+/**
+ * A full list of all OAuthErrors, enabling parsing from error responses
+ */
+exports.OAUTH_ERRORS = {
+ [InvalidRequestError.errorCode]: InvalidRequestError,
+ [InvalidClientError.errorCode]: InvalidClientError,
+ [InvalidGrantError.errorCode]: InvalidGrantError,
+ [UnauthorizedClientError.errorCode]: UnauthorizedClientError,
+ [UnsupportedGrantTypeError.errorCode]: UnsupportedGrantTypeError,
+ [InvalidScopeError.errorCode]: InvalidScopeError,
+ [AccessDeniedError.errorCode]: AccessDeniedError,
+ [ServerError.errorCode]: ServerError,
+ [TemporarilyUnavailableError.errorCode]: TemporarilyUnavailableError,
+ [UnsupportedResponseTypeError.errorCode]: UnsupportedResponseTypeError,
+ [UnsupportedTokenTypeError.errorCode]: UnsupportedTokenTypeError,
+ [InvalidTokenError.errorCode]: InvalidTokenError,
+ [MethodNotAllowedError.errorCode]: MethodNotAllowedError,
+ [TooManyRequestsError.errorCode]: TooManyRequestsError,
+ [InvalidClientMetadataError.errorCode]: InvalidClientMetadataError,
+ [InsufficientScopeError.errorCode]: InsufficientScopeError,
+ [InvalidTargetError.errorCode]: InvalidTargetError
+};
+//# sourceMappingURL=errors.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f802594f88630b042e00dc9b69db2c265288a122
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/errors.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/server/auth/errors.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,UAAW,SAAQ,KAAK;IAGjC,YACI,OAAe,EACC,QAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,aAAQ,GAAR,QAAQ,CAAS;QAGjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,gBAAgB;QACZ,MAAM,QAAQ,GAAuB;YACjC,KAAK,EAAE,IAAI,CAAC,SAAS;YACrB,iBAAiB,EAAE,IAAI,CAAC,OAAO;SAClC,CAAC;QAEF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;QACvC,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,SAAS;QACT,OAAQ,IAAI,CAAC,WAAiC,CAAC,SAAS,CAAC;IAC7D,CAAC;CACJ;AA9BD,gCA8BC;AAED;;;;GAIG;AACH,MAAa,mBAAoB,SAAQ,UAAU;;AAAnD,kDAEC;AADU,6BAAS,GAAG,iBAAiB,CAAC;AAGzC;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,UAAU;;AAAlD,gDAEC;AADU,4BAAS,GAAG,gBAAgB,CAAC;AAGxC;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,UAAU;;AAAjD,8CAEC;AADU,2BAAS,GAAG,eAAe,CAAC;AAGvC;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,UAAU;;AAAvD,0DAEC;AADU,iCAAS,GAAG,qBAAqB,CAAC;AAG7C;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,UAAU;;AAAzD,8DAE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auth/handlers/authorize.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e2da8f07853c4336a5f5f1cc9c208700e5ffa63a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts
@@ -0,0 +1,24 @@
+import { RequestHandler } from 'express';
+import { OAuthServerProvider } from '../provider.js';
+import { Options as RateLimitOptions } from 'express-rate-limit';
+export type AuthorizationHandlerOptions = {
+ provider: OAuthServerProvider;
+ /**
+ * Rate limiting configuration for the authorization endpoint.
+ * Set to false to disable rate limiting for this endpoint.
+ */
+ rateLimit?: Partial | false;
+};
+/**
+ * Validates a requested redirect_uri against a registered one.
+ *
+ * Per RFC 8252 §7.3 (OAuth 2.0 for Native Apps), authorization servers MUST
+ * allow any port for loopback redirect URIs (localhost, 127.0.0.1, [::1]) to
+ * accommodate native clients that obtain an ephemeral port from the OS. For
+ * non-loopback URIs, exact match is required.
+ *
+ * @see https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
+ */
+export declare function redirectUriMatches(requested: string, registered: string): boolean;
+export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler;
+//# sourceMappingURL=authorize.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..b0e06313f41089cbbfd14bf786b6cdbb15976a2b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,2BAA2B,GAAG;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAIF;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAmBjF;AAqBD,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,2BAA2B,GAAG,cAAc,CAiH1H"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js
new file mode 100644
index 0000000000000000000000000000000000000000..21de602f6f5793e39005a4534fc0612ff662da82
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js
@@ -0,0 +1,201 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.redirectUriMatches = redirectUriMatches;
+exports.authorizationHandler = authorizationHandler;
+const z = __importStar(require("zod/v4"));
+const express_1 = __importDefault(require("express"));
+const express_rate_limit_1 = require("express-rate-limit");
+const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
+const errors_js_1 = require("../errors.js");
+const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);
+/**
+ * Validates a requested redirect_uri against a registered one.
+ *
+ * Per RFC 8252 §7.3 (OAuth 2.0 for Native Apps), authorization servers MUST
+ * allow any port for loopback redirect URIs (localhost, 127.0.0.1, [::1]) to
+ * accommodate native clients that obtain an ephemeral port from the OS. For
+ * non-loopback URIs, exact match is required.
+ *
+ * @see https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
+ */
+function redirectUriMatches(requested, registered) {
+ if (requested === registered) {
+ return true;
+ }
+ let req, reg;
+ try {
+ req = new URL(requested);
+ reg = new URL(registered);
+ }
+ catch {
+ return false;
+ }
+ // Port relaxation only applies when both URIs target a loopback host.
+ if (!LOOPBACK_HOSTS.has(req.hostname) || !LOOPBACK_HOSTS.has(reg.hostname)) {
+ return false;
+ }
+ // RFC 8252 relaxes the port only — scheme, host, path, and query must
+ // still match exactly. Note: hostname must match exactly too (the RFC
+ // does not allow localhost↔127.0.0.1 cross-matching).
+ return req.protocol === reg.protocol && req.hostname === reg.hostname && req.pathname === reg.pathname && req.search === reg.search;
+}
+// Parameters that must be validated in order to issue redirects.
+const ClientAuthorizationParamsSchema = z.object({
+ client_id: z.string(),
+ redirect_uri: z
+ .string()
+ .optional()
+ .refine(value => value === undefined || URL.canParse(value), { message: 'redirect_uri must be a valid URL' })
+});
+// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI.
+const RequestAuthorizationParamsSchema = z.object({
+ response_type: z.literal('code'),
+ code_challenge: z.string(),
+ code_challenge_method: z.literal('S256'),
+ scope: z.string().optional(),
+ state: z.string().optional(),
+ resource: z.string().url().optional()
+});
+function authorizationHandler({ provider, rateLimit: rateLimitConfig }) {
+ // Create a router to apply middleware
+ const router = express_1.default.Router();
+ router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'POST']));
+ router.use(express_1.default.urlencoded({ extended: false }));
+ // Apply rate limiting unless explicitly disabled
+ if (rateLimitConfig !== false) {
+ router.use((0, express_rate_limit_1.rateLimit)({
+ windowMs: 15 * 60 * 1000, // 15 minutes
+ max: 100, // 100 requests per windowMs
+ standardHeaders: true,
+ legacyHeaders: false,
+ message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for authorization requests').toResponseObject(),
+ ...rateLimitConfig
+ }));
+ }
+ router.all('/', async (req, res) => {
+ res.setHeader('Cache-Control', 'no-store');
+ // In the authorization flow, errors are split into two categories:
+ // 1. Pre-redirect errors (direct response with 400)
+ // 2. Post-redirect errors (redirect with error parameters)
+ // Phase 1: Validate client_id and redirect_uri. Any errors here must be direct responses.
+ let client_id, redirect_uri, client;
+ try {
+ const result = ClientAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query);
+ if (!result.success) {
+ throw new errors_js_1.InvalidRequestError(result.error.message);
+ }
+ client_id = result.data.client_id;
+ redirect_uri = result.data.redirect_uri;
+ client = await provider.clientsStore.getClient(client_id);
+ if (!client) {
+ throw new errors_js_1.InvalidClientError('Invalid client_id');
+ }
+ if (redirect_uri !== undefined) {
+ const requested = redirect_uri;
+ if (!client.redirect_uris.some(registered => redirectUriMatches(requested, registered))) {
+ throw new errors_js_1.InvalidRequestError('Unregistered redirect_uri');
+ }
+ }
+ else if (client.redirect_uris.length === 1) {
+ redirect_uri = client.redirect_uris[0];
+ }
+ else {
+ throw new errors_js_1.InvalidRequestError('redirect_uri must be specified when client has multiple registered URIs');
+ }
+ }
+ catch (error) {
+ // Pre-redirect errors - return direct response
+ //
+ // These don't need to be JSON encoded, as they'll be displayed in a user
+ // agent, but OTOH they all represent exceptional situations (arguably,
+ // "programmer error"), so presenting a nice HTML page doesn't help the
+ // user anyway.
+ if (error instanceof errors_js_1.OAuthError) {
+ const status = error instanceof errors_js_1.ServerError ? 500 : 400;
+ res.status(status).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ return;
+ }
+ // Phase 2: Validate other parameters. Any errors here should go into redirect responses.
+ let state;
+ try {
+ // Parse and validate authorization parameters
+ const parseResult = RequestAuthorizationParamsSchema.safeParse(req.method === 'POST' ? req.body : req.query);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidRequestError(parseResult.error.message);
+ }
+ const { scope, code_challenge, resource } = parseResult.data;
+ state = parseResult.data.state;
+ // Validate scopes
+ let requestedScopes = [];
+ if (scope !== undefined) {
+ requestedScopes = scope.split(' ');
+ }
+ // All validation passed, proceed with authorization
+ await provider.authorize(client, {
+ state,
+ scopes: requestedScopes,
+ redirectUri: redirect_uri,
+ codeChallenge: code_challenge,
+ resource: resource ? new URL(resource) : undefined
+ }, res);
+ }
+ catch (error) {
+ // Post-redirect errors - redirect with error parameters
+ if (error instanceof errors_js_1.OAuthError) {
+ res.redirect(302, createErrorRedirect(redirect_uri, error, state));
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.redirect(302, createErrorRedirect(redirect_uri, serverError, state));
+ }
+ }
+ });
+ return router;
+}
+/**
+ * Helper function to create redirect URL with error parameters
+ */
+function createErrorRedirect(redirectUri, error, state) {
+ const errorUrl = new URL(redirectUri);
+ errorUrl.searchParams.set('error', error.errorCode);
+ errorUrl.searchParams.set('error_description', error.message);
+ if (error.errorUri) {
+ errorUrl.searchParams.set('error_uri', error.errorUri);
+ }
+ if (state) {
+ errorUrl.searchParams.set('state', state);
+ }
+ return errorUrl.href;
+}
+//# sourceMappingURL=authorize.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..a9156fbb17a3785dc7526fc060feecbe3fdc9146
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/authorize.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/authorize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,gDAmBC;AAqBD,oDAiHC;AArLD,0CAA4B;AAC5B,sDAA8B;AAE9B,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAsH;AAWtH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAEpE;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAAC,SAAiB,EAAE,UAAkB;IACpE,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,GAAQ,EAAE,GAAQ,CAAC;IACvB,IAAI,CAAC;QACD,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;QACzB,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;I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AC;YACb,wDAAwD;YACxD,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACvE,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,WAAmB,EAAE,KAAiB,EAAE,KAAc;IAC/E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4d03286170723c4f1573293daab027f14e50dd97
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts
@@ -0,0 +1,4 @@
+import { RequestHandler } from 'express';
+import { OAuthMetadata, OAuthProtectedResourceMetadata } from '../../../shared/auth.js';
+export declare function metadataHandler(metadata: OAuthMetadata | OAuthProtectedResourceMetadata): RequestHandler;
+//# sourceMappingURL=metadata.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..55e3a50dc113e476be14a526bdc6a46cc8e6b312
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAIxF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,8BAA8B,GAAG,cAAc,CAaxG"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js
new file mode 100644
index 0000000000000000000000000000000000000000..4e00bc588e7b6a2b3246193fb801182cccf8cab3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js
@@ -0,0 +1,21 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.metadataHandler = metadataHandler;
+const express_1 = __importDefault(require("express"));
+const cors_1 = __importDefault(require("cors"));
+const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
+function metadataHandler(metadata) {
+ // Nested router so we can configure middleware and restrict HTTP method
+ const router = express_1.default.Router();
+ // Configure CORS to allow any origin, to make accessible to web-based MCP clients
+ router.use((0, cors_1.default)());
+ router.use((0, allowedMethods_js_1.allowedMethods)(['GET', 'OPTIONS']));
+ router.get('/', (req, res) => {
+ res.status(200).json(metadata);
+ });
+ return router;
+}
+//# sourceMappingURL=metadata.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..9679c9fa5068460dd83d69b73d90c44d7299df5f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/metadata.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/metadata.ts"],"names":[],"mappings":";;;;;AAKA,0CAaC;AAlBD,sDAAkD;AAElD,gDAAwB;AACxB,uEAAiE;AAEjE,SAAgB,eAAe,CAAC,QAAwD;IACpF,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e9add28458baa5053a396e087e469ac06daeccfb
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts
@@ -0,0 +1,29 @@
+import { RequestHandler } from 'express';
+import { OAuthRegisteredClientsStore } from '../clients.js';
+import { Options as RateLimitOptions } from 'express-rate-limit';
+export type ClientRegistrationHandlerOptions = {
+ /**
+ * A store used to save information about dynamically registered OAuth clients.
+ */
+ clientsStore: OAuthRegisteredClientsStore;
+ /**
+ * The number of seconds after which to expire issued client secrets, or 0 to prevent expiration of client secrets (not recommended).
+ *
+ * If not set, defaults to 30 days.
+ */
+ clientSecretExpirySeconds?: number;
+ /**
+ * Rate limiting configuration for the client registration endpoint.
+ * Set to false to disable rate limiting for this endpoint.
+ * Registration endpoints are particularly sensitive to abuse and should be rate limited.
+ */
+ rateLimit?: Partial | false;
+ /**
+ * Whether to generate a client ID before calling the client registration endpoint.
+ *
+ * If not set, defaults to true.
+ */
+ clientIdGeneration?: boolean;
+};
+export declare function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds, rateLimit: rateLimitConfig, clientIdGeneration }: ClientRegistrationHandlerOptions): RequestHandler;
+//# sourceMappingURL=register.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..a38ebdb89e28201057c791c5e152ec5096fca958
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,gCAAgC,GAAG;IAC3C;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;IAE1C;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;IAE9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAIF,wBAAgB,yBAAyB,CAAC,EACtC,YAAY,EACZ,yBAAgE,EAChE,SAAS,EAAE,eAAe,EAC1B,kBAAyB,EAC5B,EAAE,gCAAgC,GAAG,cAAc,CA0EnD"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js
new file mode 100644
index 0000000000000000000000000000000000000000..e40c5c904e7360dc5b778b58b092aa5318982f14
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js
@@ -0,0 +1,77 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.clientRegistrationHandler = clientRegistrationHandler;
+const express_1 = __importDefault(require("express"));
+const auth_js_1 = require("../../../shared/auth.js");
+const node_crypto_1 = __importDefault(require("node:crypto"));
+const cors_1 = __importDefault(require("cors"));
+const express_rate_limit_1 = require("express-rate-limit");
+const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
+const errors_js_1 = require("../errors.js");
+const DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS = 30 * 24 * 60 * 60; // 30 days
+function clientRegistrationHandler({ clientsStore, clientSecretExpirySeconds = DEFAULT_CLIENT_SECRET_EXPIRY_SECONDS, rateLimit: rateLimitConfig, clientIdGeneration = true }) {
+ if (!clientsStore.registerClient) {
+ throw new Error('Client registration store does not support registering clients');
+ }
+ // Nested router so we can configure middleware and restrict HTTP method
+ const router = express_1.default.Router();
+ // Configure CORS to allow any origin, to make accessible to web-based MCP clients
+ router.use((0, cors_1.default)());
+ router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
+ router.use(express_1.default.json());
+ // Apply rate limiting unless explicitly disabled - stricter limits for registration
+ if (rateLimitConfig !== false) {
+ router.use((0, express_rate_limit_1.rateLimit)({
+ windowMs: 60 * 60 * 1000, // 1 hour
+ max: 20, // 20 requests per hour - stricter as registration is sensitive
+ standardHeaders: true,
+ legacyHeaders: false,
+ message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for client registration requests').toResponseObject(),
+ ...rateLimitConfig
+ }));
+ }
+ router.post('/', async (req, res) => {
+ res.setHeader('Cache-Control', 'no-store');
+ try {
+ const parseResult = auth_js_1.OAuthClientMetadataSchema.safeParse(req.body);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidClientMetadataError(parseResult.error.message);
+ }
+ const clientMetadata = parseResult.data;
+ const isPublicClient = clientMetadata.token_endpoint_auth_method === 'none';
+ // Generate client credentials
+ const clientSecret = isPublicClient ? undefined : node_crypto_1.default.randomBytes(32).toString('hex');
+ const clientIdIssuedAt = Math.floor(Date.now() / 1000);
+ // Calculate client secret expiry time
+ const clientsDoExpire = clientSecretExpirySeconds > 0;
+ const secretExpiryTime = clientsDoExpire ? clientIdIssuedAt + clientSecretExpirySeconds : 0;
+ const clientSecretExpiresAt = isPublicClient ? undefined : secretExpiryTime;
+ let clientInfo = {
+ ...clientMetadata,
+ client_secret: clientSecret,
+ client_secret_expires_at: clientSecretExpiresAt
+ };
+ if (clientIdGeneration) {
+ clientInfo.client_id = node_crypto_1.default.randomUUID();
+ clientInfo.client_id_issued_at = clientIdIssuedAt;
+ }
+ clientInfo = await clientsStore.registerClient(clientInfo);
+ res.status(201).json(clientInfo);
+ }
+ catch (error) {
+ if (error instanceof errors_js_1.OAuthError) {
+ const status = error instanceof errors_js_1.ServerError ? 500 : 400;
+ res.status(status).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ }
+ });
+ return router;
+}
+//# sourceMappingURL=register.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..e116a474fddc46d20a8cd9cc80454ce63962525a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/register.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/register.ts"],"names":[],"mappings":";;;;;AAuCA,8DA+EC;AAtHD,sDAAkD;AAClD,qDAAgG;AAChG,8DAAiC;AACjC,gDAAwB;AAExB,2DAA4E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rC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..2be32bb3cad62143e2c5acf3780732272eac9cb1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts
@@ -0,0 +1,13 @@
+import { OAuthServerProvider } from '../provider.js';
+import { RequestHandler } from 'express';
+import { Options as RateLimitOptions } from 'express-rate-limit';
+export type RevocationHandlerOptions = {
+ provider: OAuthServerProvider;
+ /**
+ * Rate limiting configuration for the token revocation endpoint.
+ * Set to false to disable rate limiting for this endpoint.
+ */
+ rateLimit?: Partial | false;
+};
+export declare function revocationHandler({ provider, rateLimit: rateLimitConfig }: RevocationHandlerOptions): RequestHandler;
+//# sourceMappingURL=revoke.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fb13cf19fe4de5b1ebb44ebc2c6ddbaf2c144c3a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,cAAc,CA4DpH"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js
new file mode 100644
index 0000000000000000000000000000000000000000..4fb1da738a1d3dd0a59b8f4801b1c9ac445db5e3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js
@@ -0,0 +1,65 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.revocationHandler = revocationHandler;
+const express_1 = __importDefault(require("express"));
+const cors_1 = __importDefault(require("cors"));
+const clientAuth_js_1 = require("../middleware/clientAuth.js");
+const auth_js_1 = require("../../../shared/auth.js");
+const express_rate_limit_1 = require("express-rate-limit");
+const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
+const errors_js_1 = require("../errors.js");
+function revocationHandler({ provider, rateLimit: rateLimitConfig }) {
+ if (!provider.revokeToken) {
+ throw new Error('Auth provider does not support revoking tokens');
+ }
+ // Nested router so we can configure middleware and restrict HTTP method
+ const router = express_1.default.Router();
+ // Configure CORS to allow any origin, to make accessible to web-based MCP clients
+ router.use((0, cors_1.default)());
+ router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
+ router.use(express_1.default.urlencoded({ extended: false }));
+ // Apply rate limiting unless explicitly disabled
+ if (rateLimitConfig !== false) {
+ router.use((0, express_rate_limit_1.rateLimit)({
+ windowMs: 15 * 60 * 1000, // 15 minutes
+ max: 50, // 50 requests per windowMs
+ standardHeaders: true,
+ legacyHeaders: false,
+ message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token revocation requests').toResponseObject(),
+ ...rateLimitConfig
+ }));
+ }
+ // Authenticate and extract client details
+ router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore }));
+ router.post('/', async (req, res) => {
+ res.setHeader('Cache-Control', 'no-store');
+ try {
+ const parseResult = auth_js_1.OAuthTokenRevocationRequestSchema.safeParse(req.body);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidRequestError(parseResult.error.message);
+ }
+ const client = req.client;
+ if (!client) {
+ // This should never happen
+ throw new errors_js_1.ServerError('Internal Server Error');
+ }
+ await provider.revokeToken(client, parseResult.data);
+ res.status(200).json({});
+ }
+ catch (error) {
+ if (error instanceof errors_js_1.OAuthError) {
+ const status = error instanceof errors_js_1.ServerError ? 500 : 400;
+ res.status(status).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ }
+ });
+ return router;
+}
+//# sourceMappingURL=revoke.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ca01fee7f55ab1ae2a2c4663293bbe74d1eba2bf
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/revoke.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"revoke.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/revoke.ts"],"names":[],"mappings":";;;;;AAkBA,8CA4DC;AA7ED,sDAAkD;AAClD,gDAAwB;AACxB,+DAAiE;AACjE,qDAA4E;AAC5E,2DAA4E;AAC5E,uEAAiE;AACjE,4CAAkG;AAWlG,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAA4B;IAChG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACtE,CAAC;IAED,wEAAwE;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,kFAAkF;IAClF,MAAM,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;IAEnB,MAAM,CAAC,GAAG,CAAC,IAAA,kCAAc,EAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAEpD,iDAAiD;IACjD,IAAI,eAAe,KAAK,KAAK,EAAE,CAAC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AAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..24d1c8783bdfec00a9511af88bdf9c38f0929e9c
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts
@@ -0,0 +1,13 @@
+import { RequestHandler } from 'express';
+import { OAuthServerProvider } from '../provider.js';
+import { Options as RateLimitOptions } from 'express-rate-limit';
+export type TokenHandlerOptions = {
+ provider: OAuthServerProvider;
+ /**
+ * Rate limiting configuration for the token endpoint.
+ * Set to false to disable rate limiting for this endpoint.
+ */
+ rateLimit?: Partial | false;
+};
+export declare function tokenHandler({ provider, rateLimit: rateLimitConfig }: TokenHandlerOptions): RequestHandler;
+//# sourceMappingURL=token.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..68189b0b210bf3110a9256f97fe5efd3f84a507e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAa,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAmBF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,mBAAmB,GAAG,cAAc,CA+G1G"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js
new file mode 100644
index 0000000000000000000000000000000000000000..8318de6b001f77c9777449fc1aed6cf24081f51c
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js
@@ -0,0 +1,136 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.tokenHandler = tokenHandler;
+const z = __importStar(require("zod/v4"));
+const express_1 = __importDefault(require("express"));
+const cors_1 = __importDefault(require("cors"));
+const pkce_challenge_1 = require("pkce-challenge");
+const clientAuth_js_1 = require("../middleware/clientAuth.js");
+const express_rate_limit_1 = require("express-rate-limit");
+const allowedMethods_js_1 = require("../middleware/allowedMethods.js");
+const errors_js_1 = require("../errors.js");
+const TokenRequestSchema = z.object({
+ grant_type: z.string()
+});
+const AuthorizationCodeGrantSchema = z.object({
+ code: z.string(),
+ code_verifier: z.string(),
+ redirect_uri: z.string().optional(),
+ resource: z.string().url().optional()
+});
+const RefreshTokenGrantSchema = z.object({
+ refresh_token: z.string(),
+ scope: z.string().optional(),
+ resource: z.string().url().optional()
+});
+function tokenHandler({ provider, rateLimit: rateLimitConfig }) {
+ // Nested router so we can configure middleware and restrict HTTP method
+ const router = express_1.default.Router();
+ // Configure CORS to allow any origin, to make accessible to web-based MCP clients
+ router.use((0, cors_1.default)());
+ router.use((0, allowedMethods_js_1.allowedMethods)(['POST']));
+ router.use(express_1.default.urlencoded({ extended: false }));
+ // Apply rate limiting unless explicitly disabled
+ if (rateLimitConfig !== false) {
+ router.use((0, express_rate_limit_1.rateLimit)({
+ windowMs: 15 * 60 * 1000, // 15 minutes
+ max: 50, // 50 requests per windowMs
+ standardHeaders: true,
+ legacyHeaders: false,
+ message: new errors_js_1.TooManyRequestsError('You have exceeded the rate limit for token requests').toResponseObject(),
+ ...rateLimitConfig
+ }));
+ }
+ // Authenticate and extract client details
+ router.use((0, clientAuth_js_1.authenticateClient)({ clientsStore: provider.clientsStore }));
+ router.post('/', async (req, res) => {
+ res.setHeader('Cache-Control', 'no-store');
+ try {
+ const parseResult = TokenRequestSchema.safeParse(req.body);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidRequestError(parseResult.error.message);
+ }
+ const { grant_type } = parseResult.data;
+ const client = req.client;
+ if (!client) {
+ // This should never happen
+ throw new errors_js_1.ServerError('Internal Server Error');
+ }
+ switch (grant_type) {
+ case 'authorization_code': {
+ const parseResult = AuthorizationCodeGrantSchema.safeParse(req.body);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidRequestError(parseResult.error.message);
+ }
+ const { code, code_verifier, redirect_uri, resource } = parseResult.data;
+ const skipLocalPkceValidation = provider.skipLocalPkceValidation;
+ // Perform local PKCE validation unless explicitly skipped
+ // (e.g. to validate code_verifier in upstream server)
+ if (!skipLocalPkceValidation) {
+ const codeChallenge = await provider.challengeForAuthorizationCode(client, code);
+ if (!(await (0, pkce_challenge_1.verifyChallenge)(code_verifier, codeChallenge))) {
+ throw new errors_js_1.InvalidGrantError('code_verifier does not match the challenge');
+ }
+ }
+ // Passes the code_verifier to the provider if PKCE validation didn't occur locally
+ const tokens = await provider.exchangeAuthorizationCode(client, code, skipLocalPkceValidation ? code_verifier : undefined, redirect_uri, resource ? new URL(resource) : undefined);
+ res.status(200).json(tokens);
+ break;
+ }
+ case 'refresh_token': {
+ const parseResult = RefreshTokenGrantSchema.safeParse(req.body);
+ if (!parseResult.success) {
+ throw new errors_js_1.InvalidRequestError(parseResult.error.message);
+ }
+ const { refresh_token, scope, resource } = parseResult.data;
+ const scopes = scope?.split(' ');
+ const tokens = await provider.exchangeRefreshToken(client, refresh_token, scopes, resource ? new URL(resource) : undefined);
+ res.status(200).json(tokens);
+ break;
+ }
+ // Additional auth methods will not be added on the server side of the SDK.
+ case 'client_credentials':
+ default:
+ throw new errors_js_1.UnsupportedGrantTypeError('The grant type is not supported by this authorization server.');
+ }
+ }
+ catch (error) {
+ if (error instanceof errors_js_1.OAuthError) {
+ const status = error instanceof errors_js_1.ServerError ? 500 : 400;
+ res.status(status).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ }
+ });
+ return router;
+}
+//# sourceMappingURL=token.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..b6b6406265fd6dc0c9563a18503e3f0c6834742f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/handlers/token.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../../../src/server/auth/handlers/token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,oCA+GC;AA1JD,0CAA4B;AAC5B,sDAAkD;AAElD,gDAAwB;AACxB,mDAAiD;AACjD,+DAAiE;AACjE,2DAA4E;AAC5E,uEAAiE;AACjE,4CAOsB;AAWtB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACz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,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC7B,MAAM;gBACV,CAAC;gBACD,2EAA2E;gBAC3E,KAAK,oBAAoB,CAAC;gBAC1B;oBACI,MAAM,IAAI,qCAAyB,CAAC,+DAA+D,CAAC,CAAC;YAC7G,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ee6037e0deb31f4e2e9a0d4866149e37a4fc042f
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts
@@ -0,0 +1,9 @@
+import { RequestHandler } from 'express';
+/**
+ * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response.
+ *
+ * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST'])
+ * @returns Express middleware that returns a 405 error if method not in allowed list
+ */
+export declare function allowedMethods(allowedMethods: string[]): RequestHandler;
+//# sourceMappingURL=allowedMethods.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..d3de93e242ef131e56c893d461648477e2c44768
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"allowedMethods.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,cAAc,CAUvE"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js
new file mode 100644
index 0000000000000000000000000000000000000000..f44553745820b4fc1166ca94153b39b9df40309d
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.allowedMethods = allowedMethods;
+const errors_js_1 = require("../errors.js");
+/**
+ * Middleware to handle unsupported HTTP methods with a 405 Method Not Allowed response.
+ *
+ * @param allowedMethods Array of allowed HTTP methods for this endpoint (e.g., ['GET', 'POST'])
+ * @returns Express middleware that returns a 405 error if method not in allowed list
+ */
+function allowedMethods(allowedMethods) {
+ return (req, res, next) => {
+ if (allowedMethods.includes(req.method)) {
+ next();
+ return;
+ }
+ const error = new errors_js_1.MethodNotAllowedError(`The method ${req.method} is not allowed for this endpoint`);
+ res.status(405).set('Allow', allowedMethods.join(', ')).json(error.toResponseObject());
+ };
+}
+//# sourceMappingURL=allowedMethods.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..be69f33771bb7385e888de5aac98d0e80855f7f1
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/allowedMethods.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"allowedMethods.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/allowedMethods.ts"],"names":[],"mappings":";;AASA,wCAUC;AAlBD,4CAAqD;AAErD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,cAAwB;IACnD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACtB,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,IAAI,EAAE,CAAC;YACP,OAAO;QACX,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,iCAAqB,CAAC,cAAc,GAAG,CAAC,MAAM,mCAAmC,CAAC,CAAC;QACrG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC3F,CAAC,CAAC;AACN,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..10730758bce4ee06bcf85a5c5fdb36575830790e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts
@@ -0,0 +1,35 @@
+import { RequestHandler } from 'express';
+import { OAuthTokenVerifier } from '../provider.js';
+import { AuthInfo } from '../types.js';
+export type BearerAuthMiddlewareOptions = {
+ /**
+ * A provider used to verify tokens.
+ */
+ verifier: OAuthTokenVerifier;
+ /**
+ * Optional scopes that the token must have.
+ */
+ requiredScopes?: string[];
+ /**
+ * Optional resource metadata URL to include in WWW-Authenticate header.
+ */
+ resourceMetadataUrl?: string;
+};
+declare module 'express-serve-static-core' {
+ interface Request {
+ /**
+ * Information about the validated access token, if the `requireBearerAuth` middleware was used.
+ */
+ auth?: AuthInfo;
+ }
+}
+/**
+ * Middleware that requires a valid Bearer token in the Authorization header.
+ *
+ * This will validate the token with the auth provider and add the resulting auth info to the request object.
+ *
+ * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header
+ * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec.
+ */
+export declare function requireBearerAuth({ verifier, requiredScopes, resourceMetadataUrl }: BearerAuthMiddlewareOptions): RequestHandler;
+//# sourceMappingURL=bearerAuth.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..c9d939f3b7329178370a7dda7649414dc5c734df
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"bearerAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,2BAA2B,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,IAAI,CAAC,EAAE,QAAQ,CAAC;KACnB;CACJ;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAmB,EAAE,mBAAmB,EAAE,EAAE,2BAA2B,GAAG,cAAc,CA8DrI"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcfc5093569d5358f2276ba9929e63b6b52ba460
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js
@@ -0,0 +1,75 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.requireBearerAuth = requireBearerAuth;
+const errors_js_1 = require("../errors.js");
+/**
+ * Middleware that requires a valid Bearer token in the Authorization header.
+ *
+ * This will validate the token with the auth provider and add the resulting auth info to the request object.
+ *
+ * If resourceMetadataUrl is provided, it will be included in the WWW-Authenticate header
+ * for 401 responses as per the OAuth 2.0 Protected Resource Metadata spec.
+ */
+function requireBearerAuth({ verifier, requiredScopes = [], resourceMetadataUrl }) {
+ return async (req, res, next) => {
+ try {
+ const authHeader = req.headers.authorization;
+ if (!authHeader) {
+ throw new errors_js_1.InvalidTokenError('Missing Authorization header');
+ }
+ const [type, token] = authHeader.split(' ');
+ if (type.toLowerCase() !== 'bearer' || !token) {
+ throw new errors_js_1.InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'");
+ }
+ const authInfo = await verifier.verifyAccessToken(token);
+ // Check if token has the required scopes (if any)
+ if (requiredScopes.length > 0) {
+ const hasAllScopes = requiredScopes.every(scope => authInfo.scopes.includes(scope));
+ if (!hasAllScopes) {
+ throw new errors_js_1.InsufficientScopeError('Insufficient scope');
+ }
+ }
+ // Check if the token is set to expire or if it is expired
+ if (typeof authInfo.expiresAt !== 'number' || isNaN(authInfo.expiresAt)) {
+ throw new errors_js_1.InvalidTokenError('Token has no expiration time');
+ }
+ else if (authInfo.expiresAt < Date.now() / 1000) {
+ throw new errors_js_1.InvalidTokenError('Token has expired');
+ }
+ req.auth = authInfo;
+ next();
+ }
+ catch (error) {
+ // Build WWW-Authenticate header parts
+ const buildWwwAuthHeader = (errorCode, message) => {
+ let header = `Bearer error="${errorCode}", error_description="${message}"`;
+ if (requiredScopes.length > 0) {
+ header += `, scope="${requiredScopes.join(' ')}"`;
+ }
+ if (resourceMetadataUrl) {
+ header += `, resource_metadata="${resourceMetadataUrl}"`;
+ }
+ return header;
+ };
+ if (error instanceof errors_js_1.InvalidTokenError) {
+ res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message));
+ res.status(401).json(error.toResponseObject());
+ }
+ else if (error instanceof errors_js_1.InsufficientScopeError) {
+ res.set('WWW-Authenticate', buildWwwAuthHeader(error.errorCode, error.message));
+ res.status(403).json(error.toResponseObject());
+ }
+ else if (error instanceof errors_js_1.ServerError) {
+ res.status(500).json(error.toResponseObject());
+ }
+ else if (error instanceof errors_js_1.OAuthError) {
+ res.status(400).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ }
+ };
+}
+//# sourceMappingURL=bearerAuth.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..d111d36bf85818264f7af6d5847cc003828843a7
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/bearerAuth.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"bearerAuth.js","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/bearerAuth.ts"],"names":[],"mappings":";;AAuCA,8CA8DC;AApGD,4CAAkG;AA8BlG;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,cAAc,GAAG,EAAE,EAAE,mBAAmB,EAA+B;IACjH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;YAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,MAAM,IAAI,6BAAiB,CAAC,8BAA8B,CAAC,CAAC;YAChE,CAAC;YAED,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC5C,MAAM,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modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..837f95fd2925472d8493ab3d1f064d2111cc20da
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts
@@ -0,0 +1,19 @@
+import { RequestHandler } from 'express';
+import { OAuthRegisteredClientsStore } from '../clients.js';
+import { OAuthClientInformationFull } from '../../../shared/auth.js';
+export type ClientAuthenticationMiddlewareOptions = {
+ /**
+ * A store used to read information about registered OAuth clients.
+ */
+ clientsStore: OAuthRegisteredClientsStore;
+};
+declare module 'express-serve-static-core' {
+ interface Request {
+ /**
+ * The authenticated client for this request, if the `authenticateClient` middleware was used.
+ */
+ client?: OAuthClientInformationFull;
+ }
+}
+export declare function authenticateClient({ clientsStore }: ClientAuthenticationMiddlewareOptions): RequestHandler;
+//# sourceMappingURL=clientAuth.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5455132c9f9e31001d246ce7b08b36257afebd71
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"clientAuth.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/middleware/clientAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,MAAM,qCAAqC,GAAG;IAChD;;OAEG;IACH,YAAY,EAAE,2BAA2B,CAAC;CAC7C,CAAC;AAOF,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb;;WAEG;QACH,MAAM,CAAC,EAAE,0BAA0B,CAAC;KACvC;CACJ;AAED,wBAAgB,kBAAkB,CAAC,EAAE,YAAY,EAAE,EAAE,qCAAqC,GAAG,cAAc,CAoC1G"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js
new file mode 100644
index 0000000000000000000000000000000000000000..e54dd10e8c063b9554095ae093c3e1c6fb84048e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js
@@ -0,0 +1,71 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+ __setModuleDefault(result, mod);
+ return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.authenticateClient = authenticateClient;
+const z = __importStar(require("zod/v4"));
+const errors_js_1 = require("../errors.js");
+const ClientAuthenticatedRequestSchema = z.object({
+ client_id: z.string(),
+ client_secret: z.string().optional()
+});
+function authenticateClient({ clientsStore }) {
+ return async (req, res, next) => {
+ try {
+ const result = ClientAuthenticatedRequestSchema.safeParse(req.body);
+ if (!result.success) {
+ throw new errors_js_1.InvalidRequestError(String(result.error));
+ }
+ const { client_id, client_secret } = result.data;
+ const client = await clientsStore.getClient(client_id);
+ if (!client) {
+ throw new errors_js_1.InvalidClientError('Invalid client_id');
+ }
+ if (client.client_secret) {
+ if (!client_secret) {
+ throw new errors_js_1.InvalidClientError('Client secret is required');
+ }
+ if (client.client_secret !== client_secret) {
+ throw new errors_js_1.InvalidClientError('Invalid client_secret');
+ }
+ if (client.client_secret_expires_at && client.client_secret_expires_at < Math.floor(Date.now() / 1000)) {
+ throw new errors_js_1.InvalidClientError('Client secret has expired');
+ }
+ }
+ req.client = client;
+ next();
+ }
+ catch (error) {
+ if (error instanceof errors_js_1.OAuthError) {
+ const status = error instanceof errors_js_1.ServerError ? 500 : 400;
+ res.status(status).json(error.toResponseObject());
+ }
+ else {
+ const serverError = new errors_js_1.ServerError('Internal Server Error');
+ res.status(500).json(serverError.toResponseObject());
+ }
+ }
+ };
+}
+//# sourceMappingURL=clientAuth.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..63184f4b523109a050718e1f9e61a1b10bc651b0
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/middleware/clientAuth.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"clientAuth.js","sourceRoot":"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IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;oBACrG,MAAM,IAAI,8BAAkB,CAAC,2BAA2B,CAAC,CAAC;gBAC9D,CAAC;YACL,CAAC;YAED,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;YACpB,IAAI,EAAE,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,sBAAU,EAAE,CAAC;gBAC9B,MAAM,MAAM,GAAG,KAAK,YAAY,uBAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;gBACxD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,uBAAW,CAAC,uBAAuB,CAAC,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC,CAAC;AACN,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3e4eca392c7fc7e85a1c62a9bcff7983469ece78
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts
@@ -0,0 +1,68 @@
+import { Response } from 'express';
+import { OAuthRegisteredClientsStore } from './clients.js';
+import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../shared/auth.js';
+import { AuthInfo } from './types.js';
+export type AuthorizationParams = {
+ state?: string;
+ scopes?: string[];
+ codeChallenge: string;
+ redirectUri: string;
+ resource?: URL;
+};
+/**
+ * Implements an end-to-end OAuth server.
+ */
+export interface OAuthServerProvider {
+ /**
+ * A store used to read information about registered OAuth clients.
+ */
+ get clientsStore(): OAuthRegisteredClientsStore;
+ /**
+ * Begins the authorization flow, which can either be implemented by this server itself or via redirection to a separate authorization server.
+ *
+ * This server must eventually issue a redirect with an authorization response or an error response to the given redirect URI. Per OAuth 2.1:
+ * - In the successful case, the redirect MUST include the `code` and `state` (if present) query parameters.
+ * - In the error case, the redirect MUST include the `error` query parameter, and MAY include an optional `error_description` query parameter.
+ */
+ authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise;
+ /**
+ * Returns the `codeChallenge` that was used when the indicated authorization began.
+ */
+ challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise;
+ /**
+ * Exchanges an authorization code for an access token.
+ */
+ exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise;
+ /**
+ * Exchanges a refresh token for an access token.
+ */
+ exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise;
+ /**
+ * Verifies an access token and returns information about it.
+ */
+ verifyAccessToken(token: string): Promise;
+ /**
+ * Revokes an access or refresh token. If unimplemented, token revocation is not supported (not recommended).
+ *
+ * If the given token is invalid or already revoked, this method should do nothing.
+ */
+ revokeToken?(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise;
+ /**
+ * Whether to skip local PKCE validation.
+ *
+ * If true, the server will not perform PKCE validation locally and will pass the code_verifier to the upstream server.
+ *
+ * NOTE: This should only be true if the upstream server is performing the actual PKCE validation.
+ */
+ skipLocalPkceValidation?: boolean;
+}
+/**
+ * Slim implementation useful for token verification
+ */
+export interface OAuthTokenVerifier {
+ /**
+ * Verifies an access token and returns information about it.
+ */
+ verifyAccessToken(token: string): Promise;
+}
+//# sourceMappingURL=provider.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..d1a4bfff0bf702d518c84d9212ffcf4385c0d311
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,IAAI,YAAY,IAAI,2BAA2B,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzG;;OAEG;IACH,6BAA6B,CAAC,MAAM,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9G;;OAEG;IACH,yBAAyB,CACrB,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAExI;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpD;;;;OAIG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,0BAA0B,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtG;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvD"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js
new file mode 100644
index 0000000000000000000000000000000000000000..0903bb2eff9f0b4654789886e5a3dfa1fa9bd33b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=provider.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..b968414aa96f6731ef6f6b37f3a47d745f603c8a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/provider.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/server/auth/provider.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ee6f3508172eaedfec4e3dde4f0101836b1172a6
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts
@@ -0,0 +1,49 @@
+import { Response } from 'express';
+import { OAuthRegisteredClientsStore } from '../clients.js';
+import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '../../../shared/auth.js';
+import { AuthInfo } from '../types.js';
+import { AuthorizationParams, OAuthServerProvider } from '../provider.js';
+import { FetchLike } from '../../../shared/transport.js';
+export type ProxyEndpoints = {
+ authorizationUrl: string;
+ tokenUrl: string;
+ revocationUrl?: string;
+ registrationUrl?: string;
+};
+export type ProxyOptions = {
+ /**
+ * Individual endpoint URLs for proxying specific OAuth operations
+ */
+ endpoints: ProxyEndpoints;
+ /**
+ * Function to verify access tokens and return auth info
+ */
+ verifyAccessToken: (token: string) => Promise;
+ /**
+ * Function to fetch client information from the upstream server
+ */
+ getClient: (clientId: string) => Promise;
+ /**
+ * Custom fetch implementation used for all network requests.
+ */
+ fetch?: FetchLike;
+};
+/**
+ * Implements an OAuth server that proxies requests to another OAuth server.
+ */
+export declare class ProxyOAuthServerProvider implements OAuthServerProvider {
+ protected readonly _endpoints: ProxyEndpoints;
+ protected readonly _verifyAccessToken: (token: string) => Promise;
+ protected readonly _getClient: (clientId: string) => Promise;
+ protected readonly _fetch?: FetchLike;
+ skipLocalPkceValidation: boolean;
+ revokeToken?: (client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest) => Promise;
+ constructor(options: ProxyOptions);
+ get clientsStore(): OAuthRegisteredClientsStore;
+ authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise;
+ challengeForAuthorizationCode(_client: OAuthClientInformationFull, _authorizationCode: string): Promise;
+ exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, codeVerifier?: string, redirectUri?: string, resource?: URL): Promise;
+ exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, scopes?: string[], resource?: URL): Promise;
+ verifyAccessToken(token: string): Promise;
+}
+//# sourceMappingURL=proxyProvider.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..124c105fab50e41d996bf7dd19e0cbc1dba462d2
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"proxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,0BAA0B,EAE1B,2BAA2B,EAC3B,WAAW,EAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CA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wB9C;IAEK,SAAS,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBxG,6BAA6B,CAAC,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM/G,yBAAyB,CAC3B,MAAM,EAAE,0BAA0B,EAClC,iBAAiB,EAAE,MAAM,EACzB,YAAY,CAAC,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC;IAwCjB,oBAAoB,CACtB,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,EACjB,QAAQ,CAAC,EAAE,GAAG,GACf,OAAO,CAAC,WAAW,CAAC;IAoCjB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG5D"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js
new file mode 100644
index 0000000000000000000000000000000000000000..17078949c42dc319e24a9e87c6f23bd928368e77
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js
@@ -0,0 +1,159 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ProxyOAuthServerProvider = void 0;
+const auth_js_1 = require("../../../shared/auth.js");
+const errors_js_1 = require("../errors.js");
+/**
+ * Implements an OAuth server that proxies requests to another OAuth server.
+ */
+class ProxyOAuthServerProvider {
+ constructor(options) {
+ this.skipLocalPkceValidation = true;
+ this._endpoints = options.endpoints;
+ this._verifyAccessToken = options.verifyAccessToken;
+ this._getClient = options.getClient;
+ this._fetch = options.fetch;
+ if (options.endpoints?.revocationUrl) {
+ this.revokeToken = async (client, request) => {
+ const revocationUrl = this._endpoints.revocationUrl;
+ if (!revocationUrl) {
+ throw new Error('No revocation endpoint configured');
+ }
+ const params = new URLSearchParams();
+ params.set('token', request.token);
+ params.set('client_id', client.client_id);
+ if (client.client_secret) {
+ params.set('client_secret', client.client_secret);
+ }
+ if (request.token_type_hint) {
+ params.set('token_type_hint', request.token_type_hint);
+ }
+ const response = await (this._fetch ?? fetch)(revocationUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ body: params.toString()
+ });
+ await response.body?.cancel();
+ if (!response.ok) {
+ throw new errors_js_1.ServerError(`Token revocation failed: ${response.status}`);
+ }
+ };
+ }
+ }
+ get clientsStore() {
+ const registrationUrl = this._endpoints.registrationUrl;
+ return {
+ getClient: this._getClient,
+ ...(registrationUrl && {
+ registerClient: async (client) => {
+ const response = await (this._fetch ?? fetch)(registrationUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(client)
+ });
+ if (!response.ok) {
+ await response.body?.cancel();
+ throw new errors_js_1.ServerError(`Client registration failed: ${response.status}`);
+ }
+ const data = await response.json();
+ return auth_js_1.OAuthClientInformationFullSchema.parse(data);
+ }
+ })
+ };
+ }
+ async authorize(client, params, res) {
+ // Start with required OAuth parameters
+ const targetUrl = new URL(this._endpoints.authorizationUrl);
+ const searchParams = new URLSearchParams({
+ client_id: client.client_id,
+ response_type: 'code',
+ redirect_uri: params.redirectUri,
+ code_challenge: params.codeChallenge,
+ code_challenge_method: 'S256'
+ });
+ // Add optional standard OAuth parameters
+ if (params.state)
+ searchParams.set('state', params.state);
+ if (params.scopes?.length)
+ searchParams.set('scope', params.scopes.join(' '));
+ if (params.resource)
+ searchParams.set('resource', params.resource.href);
+ targetUrl.search = searchParams.toString();
+ res.redirect(targetUrl.toString());
+ }
+ async challengeForAuthorizationCode(_client, _authorizationCode) {
+ // In a proxy setup, we don't store the code challenge ourselves
+ // Instead, we proxy the token request and let the upstream server validate it
+ return '';
+ }
+ async exchangeAuthorizationCode(client, authorizationCode, codeVerifier, redirectUri, resource) {
+ const params = new URLSearchParams({
+ grant_type: 'authorization_code',
+ client_id: client.client_id,
+ code: authorizationCode
+ });
+ if (client.client_secret) {
+ params.append('client_secret', client.client_secret);
+ }
+ if (codeVerifier) {
+ params.append('code_verifier', codeVerifier);
+ }
+ if (redirectUri) {
+ params.append('redirect_uri', redirectUri);
+ }
+ if (resource) {
+ params.append('resource', resource.href);
+ }
+ const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ body: params.toString()
+ });
+ if (!response.ok) {
+ await response.body?.cancel();
+ throw new errors_js_1.ServerError(`Token exchange failed: ${response.status}`);
+ }
+ const data = await response.json();
+ return auth_js_1.OAuthTokensSchema.parse(data);
+ }
+ async exchangeRefreshToken(client, refreshToken, scopes, resource) {
+ const params = new URLSearchParams({
+ grant_type: 'refresh_token',
+ client_id: client.client_id,
+ refresh_token: refreshToken
+ });
+ if (client.client_secret) {
+ params.set('client_secret', client.client_secret);
+ }
+ if (scopes?.length) {
+ params.set('scope', scopes.join(' '));
+ }
+ if (resource) {
+ params.set('resource', resource.href);
+ }
+ const response = await (this._fetch ?? fetch)(this._endpoints.tokenUrl, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ body: params.toString()
+ });
+ if (!response.ok) {
+ await response.body?.cancel();
+ throw new errors_js_1.ServerError(`Token refresh failed: ${response.status}`);
+ }
+ const data = await response.json();
+ return auth_js_1.OAuthTokensSchema.parse(data);
+ }
+ async verifyAccessToken(token) {
+ return this._verifyAccessToken(token);
+ }
+}
+exports.ProxyOAuthServerProvider = ProxyOAuthServerProvider;
+//# sourceMappingURL=proxyProvider.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..7f16e743781ccac598df10fb6d580d7b49157310
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/providers/proxyProvider.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"proxyProvider.js","sourceRoot":"","sources":["../../../../../src/server/auth/providers/proxyProvider.ts"],"names":[],"mappings":";;;AAEA,qDAMiC;AAGjC,4CAA2C;AAgC3C;;GAEG;AACH,MAAa,wBAAwB;IAUjC,YAAY,OAAqB;QAJjC,4BAAuB,GAAG,IAAI,CAAC;QAK3B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,CAAC;YACnC,IAAI,CAAC,WAAW,GAAG,KAAK,EAAE,MAAkC,EAAE,OAAoC,EAAE,EAAE;gBAClG,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;gBAEpD,IAAI,CAAC,aAAa,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;gBACzD,CAAC;gBAED,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;gBACrC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;gBACnC,MAAM,CAAC,GAAG,CAAC,WAA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AAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,2BAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACjC,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACJ;AA/LD,4DA+LC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..43dabde7d298a3e44aa93d84758047409d1b4134
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts
@@ -0,0 +1,101 @@
+import express, { RequestHandler } from 'express';
+import { ClientRegistrationHandlerOptions } from './handlers/register.js';
+import { TokenHandlerOptions } from './handlers/token.js';
+import { AuthorizationHandlerOptions } from './handlers/authorize.js';
+import { RevocationHandlerOptions } from './handlers/revoke.js';
+import { OAuthServerProvider } from './provider.js';
+import { OAuthMetadata } from '../../shared/auth.js';
+export type AuthRouterOptions = {
+ /**
+ * A provider implementing the actual authorization logic for this router.
+ */
+ provider: OAuthServerProvider;
+ /**
+ * The authorization server's issuer identifier, which is a URL that uses the "https" scheme and has no query or fragment components.
+ */
+ issuerUrl: URL;
+ /**
+ * The base URL of the authorization server to use for the metadata endpoints.
+ *
+ * If not provided, the issuer URL will be used as the base URL.
+ */
+ baseUrl?: URL;
+ /**
+ * An optional URL of a page containing human-readable information that developers might want or need to know when using the authorization server.
+ */
+ serviceDocumentationUrl?: URL;
+ /**
+ * An optional list of scopes supported by this authorization server
+ */
+ scopesSupported?: string[];
+ /**
+ * The resource name to be displayed in protected resource metadata
+ */
+ resourceName?: string;
+ /**
+ * The URL of the protected resource (RS) whose metadata we advertise.
+ * If not provided, falls back to `baseUrl` and then to `issuerUrl` (AS=RS).
+ */
+ resourceServerUrl?: URL;
+ authorizationOptions?: Omit;
+ clientRegistrationOptions?: Omit;
+ revocationOptions?: Omit;
+ tokenOptions?: Omit;
+};
+export declare const createOAuthMetadata: (options: {
+ provider: OAuthServerProvider;
+ issuerUrl: URL;
+ baseUrl?: URL;
+ serviceDocumentationUrl?: URL;
+ scopesSupported?: string[];
+}) => OAuthMetadata;
+/**
+ * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported).
+ * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients.
+ * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead.
+ *
+ * By default, rate limiting is applied to all endpoints to prevent abuse.
+ *
+ * This router MUST be installed at the application root, like so:
+ *
+ * const app = express();
+ * app.use(mcpAuthRouter(...));
+ */
+export declare function mcpAuthRouter(options: AuthRouterOptions): RequestHandler;
+export type AuthMetadataOptions = {
+ /**
+ * OAuth Metadata as would be returned from the authorization server
+ * this MCP server relies on
+ */
+ oauthMetadata: OAuthMetadata;
+ /**
+ * The url of the MCP server, for use in protected resource metadata
+ */
+ resourceServerUrl: URL;
+ /**
+ * The url for documentation for the MCP server
+ */
+ serviceDocumentationUrl?: URL;
+ /**
+ * An optional list of scopes supported by this MCP server
+ */
+ scopesSupported?: string[];
+ /**
+ * An optional resource name to display in resource metadata
+ */
+ resourceName?: string;
+};
+export declare function mcpAuthMetadataRouter(options: AuthMetadataOptions): express.Router;
+/**
+ * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL
+ * from a given server URL. This replaces the path with the standard metadata endpoint.
+ *
+ * @param serverUrl - The base URL of the protected resource server
+ * @returns The URL for the OAuth protected resource metadata endpoint
+ *
+ * @example
+ * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))
+ * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp'
+ */
+export declare function getOAuthProtectedResourceMetadataUrl(serverUrl: URL): string;
+//# sourceMappingURL=router.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..615cb964b8a1d6d83e894910d42666cbbc9535e6
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAA6B,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAqB,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AAUrF,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC;IAGxB,oBAAoB,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,UAAU,CAAC,CAAC;IACrE,yBAAyB,CAAC,EAAE,IAAI,CAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;IACnF,iBAAiB,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;IAC/D,YAAY,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CACxD,CAAC;AAeF,eAAO,MAAM,mBAAmB,YAAa;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,KAAG,aAgCH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAyCxE;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;;OAGG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,iBAAiB,EAAE,GAAG,CAAC;IAEvB;;OAEG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAuBlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oCAAoC,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAI3E"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js
new file mode 100644
index 0000000000000000000000000000000000000000..58271196274e148266a47cc0b2b40bc592281f6e
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js
@@ -0,0 +1,128 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.createOAuthMetadata = void 0;
+exports.mcpAuthRouter = mcpAuthRouter;
+exports.mcpAuthMetadataRouter = mcpAuthMetadataRouter;
+exports.getOAuthProtectedResourceMetadataUrl = getOAuthProtectedResourceMetadataUrl;
+const express_1 = __importDefault(require("express"));
+const register_js_1 = require("./handlers/register.js");
+const token_js_1 = require("./handlers/token.js");
+const authorize_js_1 = require("./handlers/authorize.js");
+const revoke_js_1 = require("./handlers/revoke.js");
+const metadata_js_1 = require("./handlers/metadata.js");
+// Check for dev mode flag that allows HTTP issuer URLs (for development/testing only)
+const allowInsecureIssuerUrl = process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === 'true' || process.env.MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === '1';
+if (allowInsecureIssuerUrl) {
+ // eslint-disable-next-line no-console
+ console.warn('MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL is enabled - HTTP issuer URLs are allowed. Do not use in production.');
+}
+const checkIssuerUrl = (issuer) => {
+ // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing
+ if (issuer.protocol !== 'https:' && issuer.hostname !== 'localhost' && issuer.hostname !== '127.0.0.1' && !allowInsecureIssuerUrl) {
+ throw new Error('Issuer URL must be HTTPS');
+ }
+ if (issuer.hash) {
+ throw new Error(`Issuer URL must not have a fragment: ${issuer}`);
+ }
+ if (issuer.search) {
+ throw new Error(`Issuer URL must not have a query string: ${issuer}`);
+ }
+};
+const createOAuthMetadata = (options) => {
+ const issuer = options.issuerUrl;
+ const baseUrl = options.baseUrl;
+ checkIssuerUrl(issuer);
+ const authorization_endpoint = '/authorize';
+ const token_endpoint = '/token';
+ const registration_endpoint = options.provider.clientsStore.registerClient ? '/register' : undefined;
+ const revocation_endpoint = options.provider.revokeToken ? '/revoke' : undefined;
+ const metadata = {
+ issuer: issuer.href,
+ service_documentation: options.serviceDocumentationUrl?.href,
+ authorization_endpoint: new URL(authorization_endpoint, baseUrl || issuer).href,
+ response_types_supported: ['code'],
+ code_challenge_methods_supported: ['S256'],
+ token_endpoint: new URL(token_endpoint, baseUrl || issuer).href,
+ token_endpoint_auth_methods_supported: ['client_secret_post', 'none'],
+ grant_types_supported: ['authorization_code', 'refresh_token'],
+ scopes_supported: options.scopesSupported,
+ revocation_endpoint: revocation_endpoint ? new URL(revocation_endpoint, baseUrl || issuer).href : undefined,
+ revocation_endpoint_auth_methods_supported: revocation_endpoint ? ['client_secret_post'] : undefined,
+ registration_endpoint: registration_endpoint ? new URL(registration_endpoint, baseUrl || issuer).href : undefined
+ };
+ return metadata;
+};
+exports.createOAuthMetadata = createOAuthMetadata;
+/**
+ * Installs standard MCP authorization server endpoints, including dynamic client registration and token revocation (if supported).
+ * Also advertises standard authorization server metadata, for easier discovery of supported configurations by clients.
+ * Note: if your MCP server is only a resource server and not an authorization server, use mcpAuthMetadataRouter instead.
+ *
+ * By default, rate limiting is applied to all endpoints to prevent abuse.
+ *
+ * This router MUST be installed at the application root, like so:
+ *
+ * const app = express();
+ * app.use(mcpAuthRouter(...));
+ */
+function mcpAuthRouter(options) {
+ const oauthMetadata = (0, exports.createOAuthMetadata)(options);
+ const router = express_1.default.Router();
+ router.use(new URL(oauthMetadata.authorization_endpoint).pathname, (0, authorize_js_1.authorizationHandler)({ provider: options.provider, ...options.authorizationOptions }));
+ router.use(new URL(oauthMetadata.token_endpoint).pathname, (0, token_js_1.tokenHandler)({ provider: options.provider, ...options.tokenOptions }));
+ router.use(mcpAuthMetadataRouter({
+ oauthMetadata,
+ // Prefer explicit RS; otherwise fall back to AS baseUrl, then to issuer (back-compat)
+ resourceServerUrl: options.resourceServerUrl ?? options.baseUrl ?? new URL(oauthMetadata.issuer),
+ serviceDocumentationUrl: options.serviceDocumentationUrl,
+ scopesSupported: options.scopesSupported,
+ resourceName: options.resourceName
+ }));
+ if (oauthMetadata.registration_endpoint) {
+ router.use(new URL(oauthMetadata.registration_endpoint).pathname, (0, register_js_1.clientRegistrationHandler)({
+ clientsStore: options.provider.clientsStore,
+ ...options.clientRegistrationOptions
+ }));
+ }
+ if (oauthMetadata.revocation_endpoint) {
+ router.use(new URL(oauthMetadata.revocation_endpoint).pathname, (0, revoke_js_1.revocationHandler)({ provider: options.provider, ...options.revocationOptions }));
+ }
+ return router;
+}
+function mcpAuthMetadataRouter(options) {
+ checkIssuerUrl(new URL(options.oauthMetadata.issuer));
+ const router = express_1.default.Router();
+ const protectedResourceMetadata = {
+ resource: options.resourceServerUrl.href,
+ authorization_servers: [options.oauthMetadata.issuer],
+ scopes_supported: options.scopesSupported,
+ resource_name: options.resourceName,
+ resource_documentation: options.serviceDocumentationUrl?.href
+ };
+ // Serve PRM at the path-specific URL per RFC 9728
+ const rsPath = new URL(options.resourceServerUrl.href).pathname;
+ router.use(`/.well-known/oauth-protected-resource${rsPath === '/' ? '' : rsPath}`, (0, metadata_js_1.metadataHandler)(protectedResourceMetadata));
+ // Always add this for OAuth Authorization Server metadata per RFC 8414
+ router.use('/.well-known/oauth-authorization-server', (0, metadata_js_1.metadataHandler)(options.oauthMetadata));
+ return router;
+}
+/**
+ * Helper function to construct the OAuth 2.0 Protected Resource Metadata URL
+ * from a given server URL. This replaces the path with the standard metadata endpoint.
+ *
+ * @param serverUrl - The base URL of the protected resource server
+ * @returns The URL for the OAuth protected resource metadata endpoint
+ *
+ * @example
+ * getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))
+ * // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp'
+ */
+function getOAuthProtectedResourceMetadataUrl(serverUrl) {
+ const u = new URL(serverUrl.href);
+ const rsPath = u.pathname && u.pathname !== '/' ? u.pathname : '';
+ return new URL(`/.well-known/oauth-protected-resource${rsPath}`, u).href;
+}
+//# sourceMappingURL=router.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..991898b46bb053d6073380f4e3d425419d9c5816
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/router.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;;AAgIA,sCAyCC;AA8BD,sDAuBC;AAaD,oFAIC;AA/OD,sDAAkD;AAClD,wDAAqG;AACrG,kDAAwE;AACxE,0DAA4F;AAC5F,oDAAmF;AACnF,wDAAyD;AAIzD,sFAAsF;AACtF,MAAM,sBAAsB,GACxB,OAAO,CAAC,GAAG,CAAC,yCAAyC,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,yCAAyC,KAAK,GAAG,CAAC;AACtI,IAAI,sBAAsB,EAAE,CAAC;IACzB,sCAAsC;IACtC,OAAO,CAAC,IAAI,CAAC,gHAAgH,CAAC,CAAC;AACnI,CAAC;AAgDD,MAAM,cAAc,GAAG,CAAC,MAAW,EAAQ,EAAE;IACzC,mHAAmH;IACnH,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChI,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,EAAE,CAAC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,CAAC,GAAG,CAAC,wCAAwC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAA,6BAAe,EAAC,yBAAyB,CAAC,CAAC,CAAC;IAE/H,uEAAuE;IACvE,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAA,6BAAe,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;IAE9F,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,oCAAoC,CAAC,SAAc;IAC/D,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,OAAO,IAAI,GAAG,CAAC,wCAAwC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7E,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..05ec8485a59b38233a2179681c9c6a81554b5d50
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts
@@ -0,0 +1,32 @@
+/**
+ * Information about a validated access token, provided to request handlers.
+ */
+export interface AuthInfo {
+ /**
+ * The access token.
+ */
+ token: string;
+ /**
+ * The client ID associated with this token.
+ */
+ clientId: string;
+ /**
+ * Scopes associated with this token.
+ */
+ scopes: string[];
+ /**
+ * When the token expires (in seconds since epoch).
+ */
+ expiresAt?: number;
+ /**
+ * The RFC 8707 resource server identifier for which this token is valid.
+ * If set, this MUST match the MCP server's resource identifier (minus hash fragment).
+ */
+ resource?: URL;
+ /**
+ * Additional data associated with the token.
+ * This field should be used for any additional data that needs to be attached to the auth info.
+ */
+ extra?: Record;
+}
+//# sourceMappingURL=types.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..021e947401d30d4c55954c34b9e210d03ceddf31
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js
new file mode 100644
index 0000000000000000000000000000000000000000..11e638d1ee44ae0dcb1feb5aef676ea74a7d4df3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..0d8063dee456d17f8719e9954f76b5dca11da627
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/auth/types.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/server/auth/types.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b3159ac8f2e593ac24633b5e2681c0bf994d8a8
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts
@@ -0,0 +1,38 @@
+import { AnySchema, SchemaInput } from './zod-compat.js';
+export declare const COMPLETABLE_SYMBOL: unique symbol;
+export type CompleteCallback = (value: SchemaInput, context?: {
+ arguments?: Record;
+}) => SchemaInput[] | Promise[]>;
+export type CompletableMeta = {
+ complete: CompleteCallback;
+};
+export type CompletableSchema = T & {
+ [COMPLETABLE_SYMBOL]: CompletableMeta;
+};
+/**
+ * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.
+ * Works with both Zod v3 and v4 schemas.
+ */
+export declare function completable(schema: T, complete: CompleteCallback): CompletableSchema;
+/**
+ * Checks if a schema is completable (has completion metadata).
+ */
+export declare function isCompletable(schema: unknown): schema is CompletableSchema;
+/**
+ * Gets the completer callback from a completable schema, if it exists.
+ */
+export declare function getCompleter(schema: T): CompleteCallback | undefined;
+/**
+ * Unwraps a completable schema to get the underlying schema.
+ * For backward compatibility with code that called `.unwrap()`.
+ */
+export declare function unwrapCompletable(schema: CompletableSchema): T;
+export declare enum McpZodTypeKind {
+ Completable = "McpCompletable"
+}
+export interface CompletableDef {
+ type: T;
+ complete: CompleteCallback;
+ typeName: McpZodTypeKind.Completable;
+}
+//# sourceMappingURL=completable.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..83ea2f1e2704457a90ed761f77a6b49f6d8b6285
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAAsC,CAAC;AAE/E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,CAC5D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,EAAE;IACN,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,KACA,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAElD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI;IAC3D,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,GAAG;IACrD,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAQ/G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAErF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,CAG5F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAEtF;AAID,oBAAY,cAAc;IACtB,WAAW,mBAAmB;CACjC;AAED,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC3D,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC;CACxC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js
new file mode 100644
index 0000000000000000000000000000000000000000..58f187316e049baab3f1ccfce3a062a46c9f55f8
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js
@@ -0,0 +1,48 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.McpZodTypeKind = exports.COMPLETABLE_SYMBOL = void 0;
+exports.completable = completable;
+exports.isCompletable = isCompletable;
+exports.getCompleter = getCompleter;
+exports.unwrapCompletable = unwrapCompletable;
+exports.COMPLETABLE_SYMBOL = Symbol.for('mcp.completable');
+/**
+ * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.
+ * Works with both Zod v3 and v4 schemas.
+ */
+function completable(schema, complete) {
+ Object.defineProperty(schema, exports.COMPLETABLE_SYMBOL, {
+ value: { complete },
+ enumerable: false,
+ writable: false,
+ configurable: false
+ });
+ return schema;
+}
+/**
+ * Checks if a schema is completable (has completion metadata).
+ */
+function isCompletable(schema) {
+ return !!schema && typeof schema === 'object' && exports.COMPLETABLE_SYMBOL in schema;
+}
+/**
+ * Gets the completer callback from a completable schema, if it exists.
+ */
+function getCompleter(schema) {
+ const meta = schema[exports.COMPLETABLE_SYMBOL];
+ return meta?.complete;
+}
+/**
+ * Unwraps a completable schema to get the underlying schema.
+ * For backward compatibility with code that called `.unwrap()`.
+ */
+function unwrapCompletable(schema) {
+ return schema;
+}
+// Legacy exports for backward compatibility
+// These types are deprecated but kept for existing code
+var McpZodTypeKind;
+(function (McpZodTypeKind) {
+ McpZodTypeKind["Completable"] = "McpCompletable";
+})(McpZodTypeKind || (exports.McpZodTypeKind = McpZodTypeKind = {}));
+//# sourceMappingURL=completable.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..6b20bd6e6a1527bae81a482006f81022c46dcd87
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/completable.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"completable.js","sourceRoot":"","sources":["../../../src/server/completable.ts"],"names":[],"mappings":";;;AAuBA,kCAQC;AAKD,sCAEC;AAKD,oCAGC;AAMD,8CAEC;AApDY,QAAA,kBAAkB,GAAkB,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAiB/E;;;GAGG;AACH,SAAgB,WAAW,CAAsB,MAAS,EAAE,QAA6B;IACrF,MAAM,CAAC,cAAc,CAAC,MAAgB,EAAE,0BAAkB,EAAE;QACxD,KAAK,EAAE,EAAE,QAAQ,EAAwB;QACzC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,KAAK;KACtB,CAAC,CAAC;IACH,OAAO,MAA8B,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,MAAe;IACzC,OAAO,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,0BAAkB,IAAK,MAAiB,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAsB,MAAS;IACvD,MAAM,IAAI,GAAI,MAAmE,CAAC,0BAAkB,CAAC,CAAC;IACtG,OAAO,IAAI,EAAE,QAA2C,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAsB,MAA4B;IAC/E,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,4CAA4C;AAC5C,wDAAwD;AACxD,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,gDAA8B,CAAA;AAClC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7746e823b08213b390effe89cd0597256bb15ea8
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts
@@ -0,0 +1,45 @@
+import { Express } from 'express';
+/**
+ * Options for creating an MCP Express application.
+ */
+export interface CreateMcpExpressAppOptions {
+ /**
+ * The hostname to bind to. Defaults to '127.0.0.1'.
+ * When set to '127.0.0.1', 'localhost', or '::1', DNS rebinding protection is automatically enabled.
+ */
+ host?: string;
+ /**
+ * List of allowed hostnames for DNS rebinding protection.
+ * If provided, host header validation will be applied using this list.
+ * For IPv6, provide addresses with brackets (e.g., '[::1]').
+ *
+ * This is useful when binding to '0.0.0.0' or '::' but still wanting
+ * to restrict which hostnames are allowed.
+ */
+ allowedHosts?: string[];
+}
+/**
+ * Creates an Express application pre-configured for MCP servers.
+ *
+ * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'),
+ * DNS rebinding protection middleware is automatically applied to protect against
+ * DNS rebinding attacks on localhost servers.
+ *
+ * @param options - Configuration options
+ * @returns A configured Express application
+ *
+ * @example
+ * ```typescript
+ * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection
+ * const app = createMcpExpressApp();
+ *
+ * // Custom host - DNS rebinding protection only applied for localhost hosts
+ * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection
+ * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled
+ *
+ * // Custom allowed hosts for non-localhost binding
+ * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] });
+ * ```
+ */
+export declare function createMcpExpressApp(options?: CreateMcpExpressAppOptions): Express;
+//# sourceMappingURL=express.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..5f607a9a972c762cd36693a36b18942acc2d373a
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,OAAO,CA0BrF"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js
new file mode 100644
index 0000000000000000000000000000000000000000..1d37a8dace615afc4f69a9d5d018e36bc5a03728
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js
@@ -0,0 +1,56 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.createMcpExpressApp = createMcpExpressApp;
+const express_1 = __importDefault(require("express"));
+const hostHeaderValidation_js_1 = require("./middleware/hostHeaderValidation.js");
+/**
+ * Creates an Express application pre-configured for MCP servers.
+ *
+ * When the host is '127.0.0.1', 'localhost', or '::1' (the default is '127.0.0.1'),
+ * DNS rebinding protection middleware is automatically applied to protect against
+ * DNS rebinding attacks on localhost servers.
+ *
+ * @param options - Configuration options
+ * @returns A configured Express application
+ *
+ * @example
+ * ```typescript
+ * // Basic usage - defaults to 127.0.0.1 with DNS rebinding protection
+ * const app = createMcpExpressApp();
+ *
+ * // Custom host - DNS rebinding protection only applied for localhost hosts
+ * const app = createMcpExpressApp({ host: '0.0.0.0' }); // No automatic DNS rebinding protection
+ * const app = createMcpExpressApp({ host: 'localhost' }); // DNS rebinding protection enabled
+ *
+ * // Custom allowed hosts for non-localhost binding
+ * const app = createMcpExpressApp({ host: '0.0.0.0', allowedHosts: ['myapp.local', 'localhost'] });
+ * ```
+ */
+function createMcpExpressApp(options = {}) {
+ const { host = '127.0.0.1', allowedHosts } = options;
+ const app = (0, express_1.default)();
+ app.use(express_1.default.json());
+ // If allowedHosts is explicitly provided, use that for validation
+ if (allowedHosts) {
+ app.use((0, hostHeaderValidation_js_1.hostHeaderValidation)(allowedHosts));
+ }
+ else {
+ // Apply DNS rebinding protection automatically for localhost hosts
+ const localhostHosts = ['127.0.0.1', 'localhost', '::1'];
+ if (localhostHosts.includes(host)) {
+ app.use((0, hostHeaderValidation_js_1.localhostHostValidation)());
+ }
+ else if (host === '0.0.0.0' || host === '::') {
+ // Warn when binding to all interfaces without DNS rebinding protection
+ // eslint-disable-next-line no-console
+ console.warn(`Warning: Server is binding to ${host} without DNS rebinding protection. ` +
+ 'Consider using the allowedHosts option to restrict allowed hosts, ' +
+ 'or use authentication to protect your server.');
+ }
+ }
+ return app;
+}
+//# sourceMappingURL=express.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f15b40d7151c48c41b5ae1cc1d98ae7c8e7bcc7d
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/express.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"express.js","sourceRoot":"","sources":["../../../src/server/express.ts"],"names":[],"mappings":";;;;;AA+CA,kDA0BC;AAzED,sDAA2C;AAC3C,kFAAqG;AAuBrG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,mBAAmB,CAAC,UAAsC,EAAE;IACxE,MAAM,EAAE,IAAI,GAAG,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IACtB,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB,kEAAkE;IAClE,IAAI,YAAY,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,CAAC,IAAA,8CAAoB,EAAC,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACJ,mEAAmE;QACnE,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,GAAG,CAAC,IAAA,iDAAuB,GAAE,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC7C,uEAAuE;YACvE,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACR,iCAAiC,IAAI,qCAAqC;gBACtE,oEAAoE;gBACpE,+CAA+C,CACtD,CAAC;QACN,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cfa236eb0fd090cb5a015009cf2b245fbbdb74d3
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts
@@ -0,0 +1,196 @@
+import { Protocol, type NotificationOptions, type ProtocolOptions, type RequestOptions } from '../shared/protocol.js';
+import { type ClientCapabilities, type CreateMessageRequest, type CreateMessageResult, type CreateMessageResultWithTools, type CreateMessageRequestParamsBase, type CreateMessageRequestParamsWithTools, type ElicitRequestFormParams, type ElicitRequestURLParams, type ElicitResult, type Implementation, type ListRootsRequest, type LoggingMessageNotification, type ResourceUpdatedNotification, type ServerCapabilities, type ServerNotification, type ServerRequest, type ServerResult, type Request, type Notification, type Result } from '../types.js';
+import type { jsonSchemaValidator } from '../validation/types.js';
+import { AnyObjectSchema, SchemaOutput } from './zod-compat.js';
+import { RequestHandlerExtra } from '../shared/protocol.js';
+import { ExperimentalServerTasks } from '../experimental/tasks/server.js';
+export type ServerOptions = ProtocolOptions & {
+ /**
+ * Capabilities to advertise as being supported by this server.
+ */
+ capabilities?: ServerCapabilities;
+ /**
+ * Optional instructions describing how to use the server and its features.
+ */
+ instructions?: string;
+ /**
+ * JSON Schema validator for elicitation response validation.
+ *
+ * The validator is used to validate user input returned from elicitation
+ * requests against the requested schema.
+ *
+ * @default AjvJsonSchemaValidator
+ *
+ * @example
+ * ```typescript
+ * // ajv (default)
+ * const server = new Server(
+ * { name: 'my-server', version: '1.0.0' },
+ * {
+ * capabilities: {}
+ * jsonSchemaValidator: new AjvJsonSchemaValidator()
+ * }
+ * );
+ *
+ * // @cfworker/json-schema
+ * const server = new Server(
+ * { name: 'my-server', version: '1.0.0' },
+ * {
+ * capabilities: {},
+ * jsonSchemaValidator: new CfWorkerJsonSchemaValidator()
+ * }
+ * );
+ * ```
+ */
+ jsonSchemaValidator?: jsonSchemaValidator;
+};
+/**
+ * An MCP server on top of a pluggable transport.
+ *
+ * This server will automatically respond to the initialization flow as initiated from the client.
+ *
+ * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
+ *
+ * ```typescript
+ * // Custom schemas
+ * const CustomRequestSchema = RequestSchema.extend({...})
+ * const CustomNotificationSchema = NotificationSchema.extend({...})
+ * const CustomResultSchema = ResultSchema.extend({...})
+ *
+ * // Type aliases
+ * type CustomRequest = z.infer
+ * type CustomNotification = z.infer
+ * type CustomResult = z.infer
+ *
+ * // Create typed server
+ * const server = new Server({
+ * name: "CustomServer",
+ * version: "1.0.0"
+ * })
+ * ```
+ * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases.
+ */
+export declare class Server extends Protocol {
+ private _serverInfo;
+ private _clientCapabilities?;
+ private _clientVersion?;
+ private _capabilities;
+ private _instructions?;
+ private _jsonSchemaValidator;
+ private _experimental?;
+ /**
+ * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification).
+ */
+ oninitialized?: () => void;
+ /**
+ * Initializes this server with the given name and version information.
+ */
+ constructor(_serverInfo: Implementation, options?: ServerOptions);
+ /**
+ * Access experimental features.
+ *
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+ get experimental(): {
+ tasks: ExperimentalServerTasks;
+ };
+ private _loggingLevels;
+ private readonly LOG_LEVEL_SEVERITY;
+ private isMessageIgnored;
+ /**
+ * Registers new capabilities. This can only be called before connecting to a transport.
+ *
+ * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
+ */
+ registerCapabilities(capabilities: ServerCapabilities): void;
+ /**
+ * Override request handler registration to enforce server-side validation for tools/call.
+ */
+ setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ServerResult | ResultT | Promise): void;
+ protected assertCapabilityForMethod(method: RequestT['method']): void;
+ protected assertNotificationCapability(method: (ServerNotification | NotificationT)['method']): void;
+ protected assertRequestHandlerCapability(method: string): void;
+ protected assertTaskCapability(method: string): void;
+ protected assertTaskHandlerCapability(method: string): void;
+ private _oninitialize;
+ /**
+ * After initialization has completed, this will be populated with the client's reported capabilities.
+ */
+ getClientCapabilities(): ClientCapabilities | undefined;
+ /**
+ * After initialization has completed, this will be populated with information about the client's name and version.
+ */
+ getClientVersion(): Implementation | undefined;
+ private getCapabilities;
+ ping(): Promise<{
+ _meta?: {
+ [x: string]: unknown;
+ progressToken?: string | number | undefined;
+ "io.modelcontextprotocol/related-task"?: {
+ taskId: string;
+ } | undefined;
+ } | undefined;
+ }>;
+ /**
+ * Request LLM sampling from the client (without tools).
+ * Returns single content block for backwards compatibility.
+ */
+ createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise;
+ /**
+ * Request LLM sampling from the client with tool support.
+ * Returns content that may be a single block or array (for parallel tool calls).
+ */
+ createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise;
+ /**
+ * Request LLM sampling from the client.
+ * When tools may or may not be present, returns the union type.
+ */
+ createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise;
+ /**
+ * Creates an elicitation request for the given parameters.
+ * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`.
+ * @param params The parameters for the elicitation request.
+ * @param options Optional request options.
+ * @returns The result of the elicitation request.
+ */
+ elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise;
+ /**
+ * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
+ * notification for the specified elicitation ID.
+ *
+ * @param elicitationId The ID of the elicitation to mark as complete.
+ * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
+ * @returns A function that emits the completion notification when awaited.
+ */
+ createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise;
+ listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<{
+ [x: string]: unknown;
+ roots: {
+ uri: string;
+ name?: string | undefined;
+ _meta?: Record | undefined;
+ }[];
+ _meta?: {
+ [x: string]: unknown;
+ progressToken?: string | number | undefined;
+ "io.modelcontextprotocol/related-task"?: {
+ taskId: string;
+ } | undefined;
+ } | undefined;
+ }>;
+ /**
+ * Sends a logging message to the client, if connected.
+ * Note: You only need to send the parameters object, not the entire JSON RPC message
+ * @see LoggingMessageNotification
+ * @param params
+ * @param sessionId optional for stateless and backward compatibility
+ */
+ sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise;
+ sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise;
+ sendResourceListChanged(): Promise;
+ sendToolListChanged(): Promise;
+ sendPromptListChanged(): Promise;
+}
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..fe0fa658914c75464c0eb8dd2248f88d2d087c38
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACzI,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,4BAA4B,EAEjC,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAIjB,KAAK,cAAc,EAMnB,KAAK,gBAAgB,EAIrB,KAAK,0BAA0B,EAE/B,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EAQjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,MAAM,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAkB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACH,eAAe,EAIf,YAAY,EAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC1C;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,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AAY,CAAC;IAgD5H;;;;;;;OAOG;IACH,mCAAmC,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;IAiBxG,SAAS,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;IAI7E;;;;;;OAMG;IACG,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM;IAQnF,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC;IAOjE,uBAAuB;IAMvB,mBAAmB;IAInB,qBAAqB;CAG9B"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..e183dd4df87dab70f89d3ef677614e895356350b
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js
@@ -0,0 +1,444 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Server = void 0;
+const protocol_js_1 = require("../shared/protocol.js");
+const types_js_1 = require("../types.js");
+const ajv_provider_js_1 = require("../validation/ajv-provider.js");
+const zod_compat_js_1 = require("./zod-compat.js");
+const server_js_1 = require("../experimental/tasks/server.js");
+const helpers_js_1 = require("../experimental/tasks/helpers.js");
+/**
+ * An MCP server on top of a pluggable transport.
+ *
+ * This server will automatically respond to the initialization flow as initiated from the client.
+ *
+ * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
+ *
+ * ```typescript
+ * // Custom schemas
+ * const CustomRequestSchema = RequestSchema.extend({...})
+ * const CustomNotificationSchema = NotificationSchema.extend({...})
+ * const CustomResultSchema = ResultSchema.extend({...})
+ *
+ * // Type aliases
+ * type CustomRequest = z.infer
+ * type CustomNotification = z.infer
+ * type CustomResult = z.infer
+ *
+ * // Create typed server
+ * const server = new Server({
+ * name: "CustomServer",
+ * version: "1.0.0"
+ * })
+ * ```
+ * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases.
+ */
+class Server extends protocol_js_1.Protocol {
+ /**
+ * Initializes this server with the given name and version information.
+ */
+ constructor(_serverInfo, options) {
+ super(options);
+ this._serverInfo = _serverInfo;
+ // Map log levels by session id
+ this._loggingLevels = new Map();
+ // Map LogLevelSchema to severity index
+ this.LOG_LEVEL_SEVERITY = new Map(types_js_1.LoggingLevelSchema.options.map((level, index) => [level, index]));
+ // Is a message with the given level ignored in the log level set for the given session id?
+ this.isMessageIgnored = (level, sessionId) => {
+ const currentLevel = this._loggingLevels.get(sessionId);
+ return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
+ };
+ this._capabilities = options?.capabilities ?? {};
+ this._instructions = options?.instructions;
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new ajv_provider_js_1.AjvJsonSchemaValidator();
+ this.setRequestHandler(types_js_1.InitializeRequestSchema, request => this._oninitialize(request));
+ this.setNotificationHandler(types_js_1.InitializedNotificationSchema, () => this.oninitialized?.());
+ if (this._capabilities.logging) {
+ this.setRequestHandler(types_js_1.SetLevelRequestSchema, async (request, extra) => {
+ const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined;
+ const { level } = request.params;
+ const parseResult = types_js_1.LoggingLevelSchema.safeParse(level);
+ if (parseResult.success) {
+ this._loggingLevels.set(transportSessionId, parseResult.data);
+ }
+ return {};
+ });
+ }
+ }
+ /**
+ * Access experimental features.
+ *
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+ get experimental() {
+ if (!this._experimental) {
+ this._experimental = {
+ tasks: new server_js_1.ExperimentalServerTasks(this)
+ };
+ }
+ return this._experimental;
+ }
+ /**
+ * Registers new capabilities. This can only be called before connecting to a transport.
+ *
+ * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
+ */
+ registerCapabilities(capabilities) {
+ if (this.transport) {
+ throw new Error('Cannot register capabilities after connecting to transport');
+ }
+ this._capabilities = (0, protocol_js_1.mergeCapabilities)(this._capabilities, capabilities);
+ }
+ /**
+ * Override request handler registration to enforce server-side validation for tools/call.
+ */
+ setRequestHandler(requestSchema, handler) {
+ const shape = (0, zod_compat_js_1.getObjectShape)(requestSchema);
+ const methodSchema = shape?.method;
+ if (!methodSchema) {
+ throw new Error('Schema is missing a method literal');
+ }
+ // Extract literal value using type-safe property access
+ let methodValue;
+ if ((0, zod_compat_js_1.isZ4Schema)(methodSchema)) {
+ const v4Schema = methodSchema;
+ const v4Def = v4Schema._zod?.def;
+ methodValue = v4Def?.value ?? v4Schema.value;
+ }
+ else {
+ const v3Schema = methodSchema;
+ const legacyDef = v3Schema._def;
+ methodValue = legacyDef?.value ?? v3Schema.value;
+ }
+ if (typeof methodValue !== 'string') {
+ throw new Error('Schema method literal must be a string');
+ }
+ const method = methodValue;
+ if (method === 'tools/call') {
+ const wrappedHandler = async (request, extra) => {
+ const validatedRequest = (0, zod_compat_js_1.safeParse)(types_js_1.CallToolRequestSchema, request);
+ if (!validatedRequest.success) {
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
+ throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage}`);
+ }
+ const { params } = validatedRequest.data;
+ const result = await Promise.resolve(handler(request, extra));
+ // When task creation is requested, validate and return CreateTaskResult
+ if (params.task) {
+ const taskValidationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CreateTaskResultSchema, result);
+ if (!taskValidationResult.success) {
+ const errorMessage = taskValidationResult.error instanceof Error
+ ? taskValidationResult.error.message
+ : String(taskValidationResult.error);
+ throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
+ }
+ return taskValidationResult.data;
+ }
+ // For non-task requests, validate against CallToolResultSchema
+ const validationResult = (0, zod_compat_js_1.safeParse)(types_js_1.CallToolResultSchema, result);
+ if (!validationResult.success) {
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
+ throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage}`);
+ }
+ return validationResult.data;
+ };
+ // Install the wrapped handler
+ return super.setRequestHandler(requestSchema, wrappedHandler);
+ }
+ // Other handlers use default behavior
+ return super.setRequestHandler(requestSchema, handler);
+ }
+ assertCapabilityForMethod(method) {
+ switch (method) {
+ case 'sampling/createMessage':
+ if (!this._clientCapabilities?.sampling) {
+ throw new Error(`Client does not support sampling (required for ${method})`);
+ }
+ break;
+ case 'elicitation/create':
+ if (!this._clientCapabilities?.elicitation) {
+ throw new Error(`Client does not support elicitation (required for ${method})`);
+ }
+ break;
+ case 'roots/list':
+ if (!this._clientCapabilities?.roots) {
+ throw new Error(`Client does not support listing roots (required for ${method})`);
+ }
+ break;
+ case 'ping':
+ // No specific capability required for ping
+ break;
+ }
+ }
+ assertNotificationCapability(method) {
+ switch (method) {
+ case 'notifications/message':
+ if (!this._capabilities.logging) {
+ throw new Error(`Server does not support logging (required for ${method})`);
+ }
+ break;
+ case 'notifications/resources/updated':
+ case 'notifications/resources/list_changed':
+ if (!this._capabilities.resources) {
+ throw new Error(`Server does not support notifying about resources (required for ${method})`);
+ }
+ break;
+ case 'notifications/tools/list_changed':
+ if (!this._capabilities.tools) {
+ throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);
+ }
+ break;
+ case 'notifications/prompts/list_changed':
+ if (!this._capabilities.prompts) {
+ throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);
+ }
+ break;
+ case 'notifications/elicitation/complete':
+ if (!this._clientCapabilities?.elicitation?.url) {
+ throw new Error(`Client does not support URL elicitation (required for ${method})`);
+ }
+ break;
+ case 'notifications/cancelled':
+ // Cancellation notifications are always allowed
+ break;
+ case 'notifications/progress':
+ // Progress notifications are always allowed
+ break;
+ }
+ }
+ assertRequestHandlerCapability(method) {
+ // Task handlers are registered in Protocol constructor before _capabilities is initialized
+ // Skip capability check for task methods during initialization
+ if (!this._capabilities) {
+ return;
+ }
+ switch (method) {
+ case 'completion/complete':
+ if (!this._capabilities.completions) {
+ throw new Error(`Server does not support completions (required for ${method})`);
+ }
+ break;
+ case 'logging/setLevel':
+ if (!this._capabilities.logging) {
+ throw new Error(`Server does not support logging (required for ${method})`);
+ }
+ break;
+ case 'prompts/get':
+ case 'prompts/list':
+ if (!this._capabilities.prompts) {
+ throw new Error(`Server does not support prompts (required for ${method})`);
+ }
+ break;
+ case 'resources/list':
+ case 'resources/templates/list':
+ case 'resources/read':
+ if (!this._capabilities.resources) {
+ throw new Error(`Server does not support resources (required for ${method})`);
+ }
+ break;
+ case 'tools/call':
+ case 'tools/list':
+ if (!this._capabilities.tools) {
+ throw new Error(`Server does not support tools (required for ${method})`);
+ }
+ break;
+ case 'tasks/get':
+ case 'tasks/list':
+ case 'tasks/result':
+ case 'tasks/cancel':
+ if (!this._capabilities.tasks) {
+ throw new Error(`Server does not support tasks capability (required for ${method})`);
+ }
+ break;
+ case 'ping':
+ case 'initialize':
+ // No specific capability required for these methods
+ break;
+ }
+ }
+ assertTaskCapability(method) {
+ (0, helpers_js_1.assertClientRequestTaskCapability)(this._clientCapabilities?.tasks?.requests, method, 'Client');
+ }
+ assertTaskHandlerCapability(method) {
+ // Task handlers are registered in Protocol constructor before _capabilities is initialized
+ // Skip capability check for task methods during initialization
+ if (!this._capabilities) {
+ return;
+ }
+ (0, helpers_js_1.assertToolsCallTaskCapability)(this._capabilities.tasks?.requests, method, 'Server');
+ }
+ async _oninitialize(request) {
+ const requestedVersion = request.params.protocolVersion;
+ this._clientCapabilities = request.params.capabilities;
+ this._clientVersion = request.params.clientInfo;
+ const protocolVersion = types_js_1.SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : types_js_1.LATEST_PROTOCOL_VERSION;
+ return {
+ protocolVersion,
+ capabilities: this.getCapabilities(),
+ serverInfo: this._serverInfo,
+ ...(this._instructions && { instructions: this._instructions })
+ };
+ }
+ /**
+ * After initialization has completed, this will be populated with the client's reported capabilities.
+ */
+ getClientCapabilities() {
+ return this._clientCapabilities;
+ }
+ /**
+ * After initialization has completed, this will be populated with information about the client's name and version.
+ */
+ getClientVersion() {
+ return this._clientVersion;
+ }
+ getCapabilities() {
+ return this._capabilities;
+ }
+ async ping() {
+ return this.request({ method: 'ping' }, types_js_1.EmptyResultSchema);
+ }
+ // Implementation
+ async createMessage(params, options) {
+ // Capability check - only required when tools/toolChoice are provided
+ if (params.tools || params.toolChoice) {
+ if (!this._clientCapabilities?.sampling?.tools) {
+ throw new Error('Client does not support sampling tools capability.');
+ }
+ }
+ // Message structure validation - always validate tool_use/tool_result pairs.
+ // These may appear even without tools/toolChoice in the current request when
+ // a previous sampling request returned tool_use and this is a follow-up with results.
+ if (params.messages.length > 0) {
+ const lastMessage = params.messages[params.messages.length - 1];
+ const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
+ const hasToolResults = lastContent.some(c => c.type === 'tool_result');
+ const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
+ const previousContent = previousMessage
+ ? Array.isArray(previousMessage.content)
+ ? previousMessage.content
+ : [previousMessage.content]
+ : [];
+ const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use');
+ if (hasToolResults) {
+ if (lastContent.some(c => c.type !== 'tool_result')) {
+ throw new Error('The last message must contain only tool_result content if any is present');
+ }
+ if (!hasPreviousToolUse) {
+ throw new Error('tool_result blocks are not matching any tool_use from the previous message');
+ }
+ }
+ if (hasPreviousToolUse) {
+ const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id));
+ const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId));
+ if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) {
+ throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match');
+ }
+ }
+ }
+ // Use different schemas based on whether tools are provided
+ if (params.tools) {
+ return this.request({ method: 'sampling/createMessage', params }, types_js_1.CreateMessageResultWithToolsSchema, options);
+ }
+ return this.request({ method: 'sampling/createMessage', params }, types_js_1.CreateMessageResultSchema, options);
+ }
+ /**
+ * Creates an elicitation request for the given parameters.
+ * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`.
+ * @param params The parameters for the elicitation request.
+ * @param options Optional request options.
+ * @returns The result of the elicitation request.
+ */
+ async elicitInput(params, options) {
+ const mode = (params.mode ?? 'form');
+ switch (mode) {
+ case 'url': {
+ if (!this._clientCapabilities?.elicitation?.url) {
+ throw new Error('Client does not support url elicitation.');
+ }
+ const urlParams = params;
+ return this.request({ method: 'elicitation/create', params: urlParams }, types_js_1.ElicitResultSchema, options);
+ }
+ case 'form': {
+ if (!this._clientCapabilities?.elicitation?.form) {
+ throw new Error('Client does not support form elicitation.');
+ }
+ const formParams = params.mode === 'form' ? params : { ...params, mode: 'form' };
+ const result = await this.request({ method: 'elicitation/create', params: formParams }, types_js_1.ElicitResultSchema, options);
+ if (result.action === 'accept' && result.content && formParams.requestedSchema) {
+ try {
+ const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema);
+ const validationResult = validator(result.content);
+ if (!validationResult.valid) {
+ throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
+ }
+ }
+ catch (error) {
+ if (error instanceof types_js_1.McpError) {
+ throw error;
+ }
+ throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`);
+ }
+ }
+ return result;
+ }
+ }
+ }
+ /**
+ * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
+ * notification for the specified elicitation ID.
+ *
+ * @param elicitationId The ID of the elicitation to mark as complete.
+ * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
+ * @returns A function that emits the completion notification when awaited.
+ */
+ createElicitationCompletionNotifier(elicitationId, options) {
+ if (!this._clientCapabilities?.elicitation?.url) {
+ throw new Error('Client does not support URL elicitation (required for notifications/elicitation/complete)');
+ }
+ return () => this.notification({
+ method: 'notifications/elicitation/complete',
+ params: {
+ elicitationId
+ }
+ }, options);
+ }
+ async listRoots(params, options) {
+ return this.request({ method: 'roots/list', params }, types_js_1.ListRootsResultSchema, options);
+ }
+ /**
+ * Sends a logging message to the client, if connected.
+ * Note: You only need to send the parameters object, not the entire JSON RPC message
+ * @see LoggingMessageNotification
+ * @param params
+ * @param sessionId optional for stateless and backward compatibility
+ */
+ async sendLoggingMessage(params, sessionId) {
+ if (this._capabilities.logging) {
+ if (!this.isMessageIgnored(params.level, sessionId)) {
+ return this.notification({ method: 'notifications/message', params });
+ }
+ }
+ }
+ async sendResourceUpdated(params) {
+ return this.notification({
+ method: 'notifications/resources/updated',
+ params
+ });
+ }
+ async sendResourceListChanged() {
+ return this.notification({
+ method: 'notifications/resources/list_changed'
+ });
+ }
+ async sendToolListChanged() {
+ return this.notification({ method: 'notifications/tools/list_changed' });
+ }
+ async sendPromptListChanged() {
+ return this.notification({ method: 'notifications/prompts/list_changed' });
+ }
+}
+exports.Server = Server;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..32ed405e753752bef9bb65b104066f270768f0ce
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","s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EAAE,SAAkB;QACrF,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;IACL,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAA6C;QACnE,OAAO,IAAI,CAAC,YAAY,CAAC;YACrB,MAAM,EAAE,iCAAiC;YACzC,MAAM;SACT,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,uBAAuB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC;YACrB,MAAM,EAAE,sCAAsC;SACjD,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,qBAAqB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAC/E,CAAC;CACJ;AA5hBD,wBA4hBC"}
\ No newline at end of file
diff --git a/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1bc0c68298e388a0ec505fa2bfa84dbe44820b35
--- /dev/null
+++ b/loan-advisor-chatgpt-app/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.d.ts
@@ -0,0 +1,364 @@
+import { Server, ServerOptions } from './index.js';
+import { AnySchema, AnyObjectSchema, ZodRawShapeCompat, SchemaOutput, ShapeOutput } from './zod-compat.js';
+import { Implementation, CallToolResult, Resource, ListResourcesResult, GetPromptResult, ReadResourceResult, ServerRequest, ServerNotification, ToolAnnotations, LoggingMessageNotification, Result, ToolExecution } from '../types.js';
+import { UriTemplate, Variables } from '../shared/uriTemplate.js';
+import { RequestHandlerExtra } from '../shared/protocol.js';
+import { Transport } from '../shared/transport.js';
+import { ExperimentalMcpServerTasks } from '../experimental/tasks/mcp-server.js';
+import type { ToolTaskHandler } from '../experimental/tasks/interfaces.js';
+/**
+ * High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
+ * For advanced usage (like sending notifications or setting custom request handlers), use the underlying
+ * Server instance available via the `server` property.
+ */
+export declare class McpServer {
+ /**
+ * The underlying Server instance, useful for advanced operations like sending notifications.
+ */
+ readonly server: Server;
+ private _registeredResources;
+ private _registeredResourceTemplates;
+ private _registeredTools;
+ private _registeredPrompts;
+ private _experimental?;
+ constructor(serverInfo: Implementation, options?: ServerOptions);
+ /**
+ * Access experimental features.
+ *
+ * WARNING: These APIs are experimental and may change without notice.
+ *
+ * @experimental
+ */
+ get experimental(): {
+ tasks: ExperimentalMcpServerTasks;
+ };
+ /**
+ * Attaches to the given transport, starts it, and starts listening for messages.
+ *
+ * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
+ */
+ connect(transport: Transport): Promise;
+ /**
+ * Closes the connection.
+ */
+ close(): Promise;
+ private _toolHandlersInitialized;
+ private setToolRequestHandlers;
+ /**
+ * Creates a tool error result.
+ *
+ * @param errorMessage - The error message.
+ * @returns The tool error result.
+ */
+ private createToolError;
+ /**
+ * Validates tool input arguments against the tool's input schema.
+ */
+ private validateToolInput;
+ /**
+ * Validates tool output against the tool's output schema.
+ */
+ private validateToolOutput;
+ /**
+ * Executes a tool handler (either regular or task-based).
+ */
+ private executeToolHandler;
+ /**
+ * Handles automatic task polling for tools with taskSupport 'optional'.
+ */
+ private handleAutomaticTaskPolling;
+ private _completionHandlerInitialized;
+ private setCompletionRequestHandler;
+ private handlePromptCompletion;
+ private handleResourceCompletion;
+ private _resourceHandlersInitialized;
+ private setResourceRequestHandlers;
+ private _promptHandlersInitialized;
+ private setPromptRequestHandlers;
+ /**
+ * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests.
+ * @deprecated Use `registerResource` instead.
+ */
+ resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource;
+ /**
+ * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests.
+ * @deprecated Use `registerResource` instead.
+ */
+ resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource;
+ /**
+ * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests.
+ * @deprecated Use `registerResource` instead.
+ */
+ resource(name: string, template: ResourceTemplate, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
+ /**
+ * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests.
+ * @deprecated Use `registerResource` instead.
+ */
+ resource(name: string, template: ResourceTemplate, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
+ /**
+ * Registers a resource with a config object and callback.
+ * For static resources, use a URI string. For dynamic resources, use a ResourceTemplate.
+ */
+ registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource;
+ registerResource(name: string, uriOrTemplate: ResourceTemplate, config: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate;
+ private _createRegisteredResource;
+ private _createRegisteredResourceTemplate;
+ private _createRegisteredPrompt;
+ private _createRegisteredTool;
+ /**
+ * Registers a zero-argument tool `name`, which will run the given function when the client calls it.
+ * @deprecated Use `registerTool` instead.
+ */
+ tool(name: string, cb: ToolCallback): RegisteredTool;
+ /**
+ * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it.
+ * @deprecated Use `registerTool` instead.
+ */
+ tool(name: string, description: string, cb: ToolCallback): RegisteredTool;
+ /**
+ * Registers a tool taking either a parameter schema for validation or annotations for additional metadata.
+ * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases.
+ *
+ * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate
+ * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types.
+ * @deprecated Use `registerTool` instead.
+ */
+ tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool;
+ /**
+ * Registers a tool `name` (with a description) taking either parameter schema or annotations.
+ * This unified overload handles both `tool(name, description, paramsSchema, cb)` and
+ * `tool(name, description, annotations, cb)` cases.
+ *
+ * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate
+ * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types.
+ * @deprecated Use `registerTool` instead.
+ */
+ tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback