Decision guide for hardening production MCP servers with the TypeScript SDK.
Integrations
mcp-http-auth-fallback-diagnosis
Try itDiagnose MCP HTTP 401/405 fallback errors by isolating credentials, transport, and runtime interpolation.
What it does
Diagnose MCP HTTP 401/405 fallback errors by isolating credentials, transport, and runtime interpolation.
The skill document
MCP HTTP authentication fallback diagnosis
When to use
Use when an HTTP MCP client reports 401, 405, or a fallback/SSE error and the endpoint previously worked or credentials may rotate.
Procedure
- Record the configured endpoint, transport, auth mode, and header shape. Never print credential values.
- Test the primary MCP endpoint directly with the configured credential and an MCP initialize request. Capture only HTTP status and protocol response.
- Repeat with the current trusted runtime credential, keeping endpoint and request identical.
- Interpret the split:
- configured credential fails, runtime credential succeeds: credential drift; do not blame transport.
- both fail identically: continue endpoint, protocol, and transport diagnosis.
- primary request returns 401 before a later 405: treat the 405 as possible fallback noise until authentication is resolved.
- Inspect the installed client's documentation or source to confirm whether HTTP headers support environment interpolation. Do not assume config interpolation matches command-argument interpolation.
- If supported, replace the static secret with the documented runtime environment placeholder. Keep the secret out of persisted config and logs.
- Ensure the launching process actually receives the environment variable; a correct placeholder with a missing variable is not a fix.
- Re-run the client's schema/list operation against the named server. For mcporter, the evidenced check is
mcporter list --schema --output json.
Pitfalls
- Diagnosing the final fallback status instead of the first primary-endpoint failure.
- Rotating the external token while leaving a copied Bearer token in client config.
- Claiming interpolation support from general docs without checking header materialization.
- Comparing or logging full tokens; compare presence or equality without exposing values.
- Declaring recovery from a raw HTTP 200 alone; verify through the actual MCP client.
Verification
Require both:
- Primary MCP initialize succeeds with the runtime-backed header and returns a protocol response.
- The actual client lists the server schema successfully without exposing the credential.
Related skills
Advanced MCP client enabling seamless integration with tools, data sources, and services via the Model Context Protocol. Supports dynamic discovery and invocation of remote capabilities, ensuring robust connectivity and interoperability across diverse external resources. Optimized for reliable, low-
Check MCP servers against the PolicyLayer registry before connecting to them. Use when you are about to add, install or configure any MCP server (editing .mc...
Diagnose und Einrichtung fremder, offizieller MCP-Server (Konnektoren) in der Claude-App. Nutze diesen Skill, wenn jemand fragt: gibt es für diesen Anbieter einen offiziellen MCP-Server, trag mir den als Konnektor ein, warum sehe ich die Tools von dem Dienst nicht, welche Scopes braucht er, mein Konnektor antwortet nicht, MCP-Server hinzufügen, Connector verbinden, Server hängt in "connecting", invalid_scope, 401 nach Wochen, Tools verschwunden. Unterscheidet fünf Zustände — offen ohne Konto, verbunden mit Tools, verbunden ohne Tools, installiert aber unangemeldet, gar nicht vorhanden — und nennt pro Zustand den konkreten nächsten Schritt. Nicht anwenden bei reinen Preisfragen zu einer API, bei Code-Anfragen oder bei der allgemeinen Frage, was MCP überhaupt ist.
Routes multi-tool workflows through MCP servers for large datasets and pipelines
MCP server configuration and diagnostics. add - add server (scope selection + registration) [add.md], move - change server scope (project→local, local→user) [move.md], format - JSON format reference (differences per agent) [format.md], catalog - list of commonly used servers [catalog.md], diagnostics - connection failure diagnosis and troubleshooting [diagnostics.md]. Use when: "add MCP", "mcp-config", "MCP server config", "add context7", "MCP format", "MCP server list", "move MCP", "MCP scope", "scope change", "MCP connection failed", "MCP error", "Failed to reconnect", "code-mode not working", "MCP server issue".