Menu

1 / 2

Throw These 8 Tokens at Your .NET MCP Server Before Someone Else Does

DEV Community: dotnet·MICHAEL-MAURICE·4 days ago
#oAZM8hQk
#devtodotnet#devto#dev#token#server
Long article (1474 words) — no AI summary yet.
Reading 0:00
15s threshold

Here's the cheapest security test I now run against every MCP server I build: I hand it eight access tokens it should refuse, and I count how many it accepts.

The first time I did it, my support-desk MCP server was protected the way most samples protect it: validate the JWT signature and move on. A plain signature check accepted 5 of the 8. All five were signed by our real identity provider, because one identity provider signs tokens for every app in the company.

This post is the drill itself: the eight tokens, what each one looks like, which validation setting stops it, and the shape of the xUnit test that keeps it stopped. It's not the full server build.

Tech Skill Builder is $5/month for a very limited time only (normally $10). Grab it now before it goes back to $10. Join Tech Skill Builder . The complete, tested OAuth-protected MCP server behind this post is in there.

Does your agent also read ticket text or tool results?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.