GuidesMCP
Securing a remote MCP server
Layers of protection
- 1HTTPSNo traffic in clear text.
- 2AuthenticationOAuth, token checked on every call.
- 3Per-tool rightsRead, write and admin kept separate.
- 4ValidationEvery argument checked server side.
- 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.