Should MCP Tools Ever Expose Credentials to the Model? A Proxy-Injection Design

lordVader1138 · reddit · 2026-10-12

A developer building an MCP server that lets coding agents run disposable checks against a real dev backend asks whether tools making authenticated API calls should ever expose credentials to the model.

His design: credentials stay outside the model, injected by a proxy only when requests leave the worker; neither secrets nor source code reach the model; tool output (report, replay curls) never contains auth headers — the agent only sees what was called, what came back, and pass/fail.

He asks other MCP builders how they handle credentials (client env vars vs server-side vaults), whether a tool's report can be trusted as evidence in a PR or only as a hint, and what's missing from the report. He's also extending the approach to frontend/mobile sync and browser testing.

Original post →

More from coding & agent

coding & agent channel →