The problem nobody’s talking about
You have an OpenAPI spec. You want to expose it as MCP tools. You search npm, find a library that promises “OpenAPI to MCP in 5 minutes,” paste your configuration, and boom—you’re done. Except you just created a security nightmare. Here’s what’s happening behind the scenes in most OpenAPI-to-MCP libraries:- Your JWT tokens are exposed in tool input schemas, visible to every MCP client
- Headers are mixed between requests, leaking credentials across different API calls
- Your traffic routes through someone else’s cloud, sending customer tokens outside your infrastructure
- No validation of security configurations, leaving you vulnerable without warnings
Exhibit A: The credential exposure problem
Most OpenAPI-to-MCP libraries take the “easy” approach: if your OpenAPI spec has security requirements, they add those fields to the tool’s input schema.- Logging disasters: Your MCP client logs every tool call. Now you’re logging JWTs, API keys, and OAuth tokens.
- Client-side exposure: AI agents see these fields. Some might cache or transmit them insecurely.
- Developer confusion: Your API consumers think they need to manually provide auth for every call.
- Compliance violations: GDPR, SOC2, and PCI-DSS don’t care that “the library made you do it.”
Exhibit B: The header mixing catastrophe
Some libraries try to be “clever” and manage authentication for you. But they don’t isolate requests properly:- User A calls GitHub API → sets
authorization: Bearer github_token_123 - User B calls Slack API → still has User A’s GitHub token in headers
- User B’s Slack request now has both their Slack token AND User A’s GitHub token
Exhibit C: The infrastructure control problem
Here’s the architectural decision that catches teams off-guard: Self-hosted libraries that convert OpenAPI to MCP run in your infrastructure. Your data stays in your VPC. You control the execution environment. Cloud-based converters route your API traffic through external infrastructure. Your requests, responses, and authentication tokens pass through someone else’s systems.- Where does authentication happen? In your infrastructure or theirs?
- Who has access to tokens? Just you, or the service provider too?
- What’s their security posture? SOC2? ISO 27001? GDPR-compliant?
- What’s in their logs? Are customer tokens being logged externally?
- Can you audit traffic? Do you have visibility into what’s being proxied?
- Regulated industries (banking, healthcare): Customer tokens can’t leave your infrastructure
- Data sovereignty: EU customer data routing through non-EU servers
- Enterprise contracts: “All customer data must remain within our VPC”
- Audit requirements: Need complete visibility into where tokens traveled
Important distinction: Enterprise-grade identity platforms (like Frontegg’s AgentLink) are purpose-built for
secure token management with SOC2/ISO compliance, audit trails, and enterprise SLAs. Generic OpenAPI-to-MCP converter
tools typically aren’t.
Exhibit D: The “it works on my machine” security
Here’s another pattern I see constantly:- No validation: Library doesn’t check if auth config matches spec requirements
- Silent failures: Requests fail with generic 401s, no hint why
- Mixed environments: Dev keys in prod, prod keys in dev
- Multi-provider chaos: GitHub token used for Slack API, no errors, just failures
The actual cost
Let me make this concrete with a real-world scenario: Company: SaaS platform with 50,000 customers APIs: GitHub, Slack, Stripe, internal APIs MCP Tools: 200+ endpoints exposed via OpenAPI specs What happened:- Used popular OpenAPI-to-MCP library
- Didn’t realize it exposed auth in input schemas
- MCP client logs included customer OAuth tokens for 6 months
- Security audit discovered it during SOC2 compliance review
- $500K+ cost: Forensic analysis, customer notification, legal fees
- 3 weeks downtime: Full security review, credential rotation
- Lost customers: 12 enterprise customers left immediately
- Regulatory fines: GDPR violations for EU customers
- Reputation damage: Security blog posts, HN discussion, vendor trust loss
How FrontMCP solves this
FrontMCP’s OpenAPI adapter was built from day one with security as the foundation, not an afterthought.1. Authentication never exposed to clients
2. Request isolation + multi-provider authentication
Each request gets fresh headers with the correct auth provider—no global state, no mixing:3. Security validation with risk scoring
FrontMCP validates your security configuration and warns you:| Risk | Configuration | What it means |
|---|---|---|
| LOW ✅ | authProviderMapper, securityResolver | Auth from context, not exposed |
| MEDIUM ⚠️ | staticAuth, additionalHeaders | Static credentials (acceptable for server-to-server) |
| HIGH 🚨 | includeSecurityInInput: true | Auth exposed to clients (NOT RECOMMENDED) |
4. Defense-in-depth security protections
Beyond authentication, FrontMCP protects against common attack vectors:| Protection | What it prevents |
|---|---|
| SSRF Prevention | Blocks dangerous protocols (file://, javascript:, data:) in server URLs |
| Header Injection | Rejects control characters (\r, \n, \x00) that could inject headers |
| Prototype Pollution | Blocks reserved JS keys (__proto__, constructor) in input transforms |
| Integer Overflow | Content-Length validated with isFinite() to prevent size bypass |
| Query Param Collision | Detects conflicts between security and user input parameters |
openapi.executor.ts for implementation details.
5. Runs on YOUR infrastructure
6. Headers and body mapping for tenant isolation
- Tenant isolation guaranteed
- User context injected server-side
- Hidden from MCP clients
- Impossible to forge or bypass
Core security principles
FrontMCP’s OpenAPI adapter is built on five security principles:- Least Exposure — Auth never exposed to MCP clients
- Isolation — Fresh headers per request, no global state
- Validation — Config validated at startup, not runtime
- Transparency — Risk levels explicit (LOW/MEDIUM/HIGH)
- Control — Runs in your infrastructure, no external routing
Migration guide: From insecure to secure
If you’re using another OpenAPI-to-MCP library, here’s how to migrate:Step 1: Audit your current setup
Step 2: Install FrontMCP
Step 3: Replace your adapter
Step 4: Rotate credentials
Step 5: Validate security
The comprehensive test suite
We take security seriously. FrontMCP’s OpenAPI adapter has 193 comprehensive tests covering:- ✅ All authentication strategies
- ✅ Request isolation
- ✅ Multi-provider scenarios
- ✅ Security validation
- ✅ Missing mappings detection
- ✅ Headers and body mapping
- ✅ Defense-in-depth protections (SSRF, header injection, prototype pollution)
- ✅ Error handling
- ✅ Edge cases
Conclusion: Security isn’t optional
If you’re using OpenAPI-to-MCP tools in production, ask yourself:- ❓ Are my JWT tokens exposed in tool input schemas?
- ❓ Are headers being mixed between different API requests?
- ❓ Is my traffic routing through someone else’s cloud?
- ❓ Is my security configuration validated at startup?
- ❓ Do I have visibility into security risk levels?
- ✅ Zero credential exposure — Auth resolved from context, never exposed
- ✅ Request isolation — Fresh headers per request, no mixing
- ✅ Multi-provider support — Map each security scheme to the right auth provider
- ✅ Validation at startup — Know immediately if config is wrong
- ✅ Risk scoring — Understand your security posture
- ✅ Your infrastructure — No external dependencies, no cloud routing
Get started with FrontMCP
OpenAPI Adapter Docs
Comprehensive guide to the OpenAPI adapter with security best practices
Quick Start
Get your secure MCP server running in 5 minutes
View Source
Review the security implementation yourself
Join Community
Discuss security patterns with other developers
Don’t let your OpenAPI-to-MCP integration become a security nightmare.
Choose FrontMCP. Choose security.

