Skip to content

fix(use-mcp): connect to mcp fails with handleMessage function #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ksankaran
Copy link
Contributor

I'm trying to use the library to connect to the MCP Tools. However, I noticed that, handleMessage is not part of the client in typescript sdk and hence, the call fails when trying to initialize the same.

Motivation and Context

Without this change, the MCP Client wont be initialized.

How Has This Been Tested?

In vite app, where I'm trying to load the library.

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

image

@geelen
Copy link
Collaborator

geelen commented Jun 30, 2025

I'll have a look at this tomorrow. I've found that downgrading to SDK 1.13.1 fixed this issue, but didn't actually look at what changed yet (or the fix, is it really only one character? lol).

I'm building a proper E2E test suite (first bit is merged) cause I was getting such weird transient errors like this and I needed to get some hard data. So once that's ready I'll grab this commit and update the SDK to latest and see if everything passes.

For now, I think if you use use-mcp@latest with @modelcontextprotocol/[email protected] you should avoid this issue. Thanks for the PR tho!

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.

2 participants