-
Notifications
You must be signed in to change notification settings - Fork 310
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage
Description
🐞 Bug Summary
The current MCP Gateway Wrapper implementation is functional but slow and not optimized for production.
Problems observed in the old code:
- Instead of forwarding message across transport, each message was analyzed and specific api calls were executed.
For eg. for list_tools, the flow included:
Extracting base url, create the url for getting all tools and servers, then filtering the tools in the wrapper. - Inefficient handling of NDJSON and SSE streams, causing unnecessary delays.
- Extra overhead in stdio <-> HTTP forwarding, impacting throughput.
- Lack of structured error handling, blocking behavior on transient failures.
🧩 Affected Component
Select the area of the project impacted:
-
mcpgateway
- API -
mcpgateway
- UI (admin panel) -
mcpgateway.wrapper
- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- The wrapper is not able to connect deployed gateways in cline and claude.
📓 Proposed Optimization
- Refactor event streaming (NDJSON + SSE) for non-blocking async I/O.
- Introduce a lightweight, optimized HTTP client wrapper for retries/backoff without adding overhead.
- Add structured logging to detect latency hotspots.
- Simplify and decouple bridge logic, easier to extend and profile.
- Allow configurable runtime parameters (env + CLI args) to fine-tune retries, timeouts, concurrency.
🧠 Environment Info
You can retrieve most of this from the /version
endpoint.
Key | Value |
---|---|
Version or commit | e.g. v0.9.0 or main@a1b2c3d |
Runtime | e.g. Python 3.11, Gunicorn |
Platform / OS | e.g. Ubuntu 22.04, macOS |
Container | e.g. Docker, Podman, none |
🧩 Additional Context (optional)
Add any configuration details, flags, or related issues.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage