Home / patterns

MCP servers in vibe-coded apps: no auth, token passthrough and tools you never vetted

A developer typing on a laptop at a home-office desk at night, the screen showing a blurred code editor with one line highlighted in red, two monitors with blurred tool and settings panels behind, sticky notes and a mug nearby, no brand logos
Quick answer: Lots of vibe-coded apps now ship a Model Context Protocol (MCP) server so ChatGPT, Claude or a coding agent can use the app’s data and actions, and lots of builders plug third-party MCP servers into their own AI features and editors. The common mistakes: an HTTP MCP endpoint anyone can call, a server that accepts whatever token the client sends and forwards it to your API (“token passthrough”, which the MCP authorization spec forbids), one all-powerful access token behind every tool, and third-party servers whose tool descriptions or responses carry hidden instructions (“tool poisoning”). The fix is the same discipline as any API: authenticate every request, check permissions in code, and treat everything a tool says as untrusted.

Last updated November 16, 2026

Steps

  1. List every MCP server you run and every one your app or editor connects to, with what each can read and change.
  2. For your own server over HTTP: require authorization on every request and verify the token on the server. The MCP security guidance says servers that implement authorization must verify all inbound requests and must not use sessions for authentication. A guessable or reused session ID is not a login.
  3. Only accept tokens that were issued for your MCP server (check the audience). Don’t take a user’s token from the client and pass it straight through to your database or a downstream API; the MCP guidance calls this token passthrough and says servers must not accept tokens not explicitly issued for them.
  4. Give each tool the narrowest permission it needs. Read tools get read-only credentials; anything that deletes, pays, emails or changes accounts checks the signed-in user’s rights in your code, not in the model’s instructions.
  5. If your server runs locally, prefer the stdio transport. If it listens over HTTP on localhost, require a token anyway; the MCP guidance warns that local servers left running can be reached by other processes and via DNS rebinding.
  6. Before connecting a third-party MCP server, read its full tool list, descriptions and parameter schemas, keep an allowlist of approved servers, and re-review when a tool definition changes. OWASP recommends pinning reviewed tool definitions and requiring review on change.
  7. Treat tool descriptions and tool responses as untrusted input. Don’t let a response from an outside server trigger your privileged tools without a check, and require a human confirmation, showing the full arguments, for destructive or data-sharing actions.
  8. Don’t install MCP servers with one-click commands you haven’t read. A local server runs with your user’s privileges and can read files, keys and SSH credentials on your machine.
  9. Log every tool call (who, which tool, which arguments) so you can spot abuse, and rate-limit tools that cost money.

Why it matters

The MCP specification says tools represent arbitrary code execution and must be treated with caution, that tool descriptions such as annotations should be considered untrusted unless they come from a trusted server, and that hosts must get explicit user consent before invoking any tool. The project’s security best-practices page covers confused-deputy problems in proxy servers, token passthrough, session hijacking, local server compromise and over-broad scopes. OWASP’s MCP Security Cheat Sheet describes tool poisoning (malicious instructions hidden in tool descriptions, parameter schemas or return values), tool shadowing across servers, and the confused deputy problem where a server acts with its own broad privileges instead of the user’s. This page is for checking and fixing your own app and setup.

Sources

Model Context Protocol: Specification (2025-11-25), Security and Trust & Safety — https://modelcontextprotocol.io/specification/2025-11-25

Model Context Protocol: Security Best Practices — https://modelcontextprotocol.io/docs/2025-11-25/tutorials/security/security_best_practices

OWASP Cheat Sheet Series: MCP Security Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html

Checked at the source on November 16, 2026.

Related patterns

FAQ

My MCP server is only for me. Does auth matter?

Yes, if it listens over HTTP. Anything else on your machine or network that can reach the port can call it. Use stdio for local-only servers, or require a token.

Can I tell the model “never call the delete tool without asking”?

Use that as a hint, not a control. Put the permission check and the confirmation step in your code, where an injected instruction can’t talk its way past it.

Found a problem you'd rather not fix yourself?

Tell us what's wrong. A StorenTech engineer reviews your app and replies with a fixed quote, so you know the cost before any work starts.

Get it fixed by StorenTech

Vibe Security Weekly

One email a week with new failure patterns and how to fix them.

By joining you agree we may email you this newsletter. See our privacy policy. Free. Unsubscribe anytime. We'll never sell your email.