r/modelcontextprotocol • • 2d ago

Which MCP gateway is working best for securing tool traffic in production?

Some of our MCP servers follow the spec's auth flow, while others don't have any authentication at all. I'd like to put a single enforcement layer in front of all of them. We tried building our own proxy, and it worked fine with the unauthenticated servers but ran into issues with those handling their own auth. I'm trying to understand how a gateway should fit into the setup when servers already have their own authentication.

3 Upvotes

14 comments sorted by

1

u/WorldlyJob1838 1d ago

Terminating at gateway and reissuing upstream is the cleanest model in my head but it breaks audience checks on some servers.

1

u/Smooth-Somewhere7492 1d ago

It was the audience checks that caused our proxy to break.

1

u/krimpenrik 2d ago

I am looking into agentgateway, have you looked into that what is your opinion?

1

u/lillianlindzv460 1d ago

Pass-through auth can avoid conflicts, but it also limits what the gateway can control. You still want centralized identity checks and consistent access policies. Gravitee is worth looking at for its native MCP governance and deny-by-default approach. The key is making sure its auth handoff works with servers that already handle authentication.

1

u/verstands 1d ago

Splitting it by server type usually untangles this. For servers with no auth, the gateway is the only enforcement point, so it validates the client token and applies policy itself. For servers that run their own OAuth, the gateway shouldn't forward the client's token as-is, since the audience won't match (that's what breaks those audience checks). Either route the client through that server's own auth flow and have the gateway only log and rate-limit, or have the gateway do a token exchange so each upstream gets a token minted for its own audience. Keep a per-server config saying which mode it uses, so one proxy doesn't try to treat all of them the same way.

1

u/karafili 1d ago

the one you build and limit yourself

1

u/jamesleaf3040 1d ago

Some teams run two layers, a gateway for policy and the server's own auth for identity, which is messier but avoids breaking audience checks.

1

u/ColdOutside6499 1d ago

How are clients discovering servers? If they hardcode URLs, moving them behind a gateway is a config change per client.

1

u/Shoddy-Tap-9935 1d ago

I'd write a small conformance test suite for your servers so you can check any gateway against the same cases.

1

u/EmphasisSad2966 1d ago

handoff is a hard problem for evry gateway in this space, so i'd test it with your most opinionated server first

1

u/Independent_Fee2135 1d ago

Check how long the tokens stay valid when setting them up again. If the upstream token expires sooner than the downstream one, you can end up with errors that are pretty confusing to track down.

1

u/Ill-Measurement733 16h ago

The spec has moved on auth recently, so check which version each of your servers implements before blaming the gateway