Skip to content

Conversation

igoyalsamarth
Copy link

Added an env config reading so the env variables are readable during development.

Also added a .env.example so it's easy to understand.

Fixed a case where we expected

(!sessionId && isInitializeRequest(req.body)

to be just

(isInitializeRequest(req.body))

considering that we have to create a new transporter instance, we don't care if the sessionId already exists or not.

The old code was also not compatible with

import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp";

and was giving me errors around the sessionId every time it had to initiazlied when coupled with

import { experimental_createMCPClient } from "ai";

(Vercel AI SDK)

My Apologies for too many lints and formats, just biome things.

@filesmuggler
Copy link

@mquan Can we approve it ASAP? MCP is really broken because of the session ID issues

Copy link
Collaborator

@mquan mquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Can you please isolate the change to only sessionId. If there're needs for linting and env config, please open a separate PR

@igoyalsamarth
Copy link
Author

Thanks for the contribution! Can you please isolate the change to only sessionId. If there're needs for linting and env config, please open a separate PR

Sure thing, I can try to isolate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants