---
title: "Discussion on \"Securing MCP Tools with OAuth 2.1: Scopes per Tool in Spring AI\" | Hashnode"
description: "Discussion on \"Securing MCP Tools with OAuth 2.1: Scopes per Tool in Spring AI\". TL;DR\n\nAn AI agent calling your tools is a client like any other, and it needs a token. With Spring Security 7 your MCP server becomes an OAuth 2.1 Resource Server, and each tool declares the scope it"
url: "https://hashnode.com/posts/securing-mcp-tools-with-oauth-2-1-scopes-per-tool-in-spring-ai/6af790c957e7f6667519af66"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Securing MCP Tools with OAuth 2.1: Scopes per Tool in Spring AI](https://cbuelvasc.hashnode.dev/securing-mcp-tools-with-oauth-2-1-scopes-per-tool-in-spring-ai?utm_source=hashnode&utm_medium=feed)

TL;DR An AI agent calling your tools is a client like any other, and it needs a token. With Spring Security 7 your MCP server becomes an OAuth 2.1 Resource Server, and each tool declares the scope it

1d ago · 7 min read · cbuelvasc.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#spring-boot](https://hashnode.com/tag/spring-boot)
-   [#mcp](https://hashnode.com/tag/mcp)
-   [#oauth](https://hashnode.com/tag/oauth)
-   [#security](https://hashnode.com/tag/security)

## Written by

[Carmelo Buelvas Comas](https://hashnode.com/@cbuelvasc)

@cbuelvasc · Colombia

  
[View profile](https://hashnode.com/@cbuelvasc)

Senior Backend Engineer · Java, Go & AI (MCP) · Building production-grade systems

Senior Software Engineer with 14+ years building backend systems in Java (8 to 25) and Spring Boot, now also working with Go. I write about MCP, AI agents, cloud-native architecture, observability and taking systems to production. Based in Colombia.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
