Skip to content

[CHORE]: Cleanup unused Federation module and duplicate Forwarding logic #1912

@kevalmahajan

Description

@kevalmahajan

🐞 Bug Summary

The mcpgateway.federation module (containing DiscoveryService and ForwardingService) is currently unused and not wired into the application lifecycle.

  • DiscoveryService (mDNS auto-discovery) is not required for the current deployment model.
  • ForwardingService logic is largely duplicated by ToolService, which implements a more advanced version of tool invocation (supporting OAuth, Plugins, SSE).

To reduce technical debt and confusion, this unused code should be removed.

Note: Check all the corresponding dependencies, documentation, env variables and more related to federation for cleanup


🧩 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

  1. Inspect mcpgateway/main.py and observe that DiscoveryService and ForwardingService are never instantiated.
  2. Inspect mcpgateway/services/tool_service.py (invoke_tool method) and verify it manages its own connections to remote gateways, bypassing ForwardingService.
  3. Check mcpgateway/federation/ directory to see the dead code.

🤔 Expected Behavior

The codebase should be clean and devoid of large blocks of unused or duplicate code. The mcpgateway.federation package should be deleted.


📓 Logs / Error Output

Paste any relevant stack traces or logs here.
⚠️ Do not paste secrets, credentials, or tokens.


🧠 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 working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions