GuidesMCP

Securing a remote MCP server

By the Banzai Labs teamUpdated on 2 min read

AI clientOAuthHTTPSRemote MCP serverread_ordersreadupdate_priceconfirmationdelete_customernot exposedAuthentication, per-tool rights, limits and logs
A remote MCP server protected by OAuth and HTTPS exposes only the authorised tools.

Layers of protection

  1. 1HTTPSNo traffic in clear text.
  2. 2AuthenticationOAuth, token checked on every call.
  3. 3Per-tool rightsRead, write and admin kept separate.
  4. 4ValidationEvery argument checked server side.
  5. 5LogWho called what, when, with what.

Tools, ranked by risk

Tool Exposure
Read orders Open to authenticated users
Update a price Dedicated right, user confirmation
Delete a customer Not exposed through MCP
Export the whole database Not exposed through MCP

Settings often forgotten

  • Rate limitPer client and per tool.
  • Response sizeNo unlimited lists.
  • Origin checkedAgainst calls from a booby-trapped page.
  • Secrets kept apartNever in tool descriptions.

The basics: the MCP server and build an MCP server in TypeScript. The risks: prompt injection. Throughput: rate-limit an API.

Frequently asked questions

Which authentication should I use?
The MCP specification relies on OAuth for remote servers. The server checks that each token is meant for it, is valid and grants the requested rights.
Can the client’s token be passed on to another API?
No. The server must not relay the token it received as is to a third-party service. It uses its own credentials for the APIs it calls.
How do I protect against prompt injection?
By limiting what each tool can do, requiring confirmation for irreversible actions and validating every argument server side, as with any API.

Read next

All guides