Skip to content

fix connection refused error message #554

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nabuskey
Copy link

This PR makes the proxy server print "Connection refused" when the error message contains ECONNREFUSED only.

Motivation and Context

Currently, proxy server prints Connection refused. Is the MCP server running? under two circumstances:

  1. Error message contains Error POSTing to endpoint (HTTP 404) OR
  2. Error message contains ECONNREFUSED.

The term "Connection Refused" usually means it could not make connections at all.
I think it makes sense to print the error message in case of ECONNREFUSED because that's how node defines it.

I don't think it makes sense to print that when the connection was successful but a 404 was returned by the server.

fixes: #543

How Has This Been Tested?

  1. Have a MCP running.
  2. Open Inspector. Confirm it's accessible at /mcp.
  3. Change endpoint to /mcp1, then attempt to connect

Breaking Changes

No breaking changes.

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

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.

Improve connection refused error message
1 participant