SA

spring-ai-community/mcp-security

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

121 stars 33 forks Качество 64 Тренд 24Apache-2.0

spring-ai-community/mcp-security — это кандидат на MCP-сервер, импортированный из https://github.com/spring-ai-community/mcp-security.

Обзор

spring-ai-community/mcp-security — это кандидат на MCP-сервер, импортированный из https://github.com/spring-ai-community/mcp-security.

Обзор (машинный перевод)

Поддержка безопасности и авторизации протокола Model Context в Spring AI.

⚠️ Версии 0.1.x mcp-security работают только по ветке Spring AI 2.0.x. Для Spring AI 1.1.x используйте версию 0.0.6.

Содержание

  • Обзор
  • Безопасность серверов MCP
  • Безопасность клиента MCP
  • Сервер авторизации
  • Сэмплы
  • Интеграции (Cursor, Claude Desktop, …)
  • Лицензия

Обзор

Этот репозиторий предоставляет Поддержка авторизации Интеграции Spring AI с протоколом Model Context Protocol (MCP). Он охватывает как MCP-клиенты, так и MCP-серверы и Spring Сервер авторизации.

Проект позволяет разработчикам:

  • Безопасные MCP-серверы с аутентификацией OAuth 2.0
  • Настройка MCP-клиентов с потоками авторизации OAuth 2.0
  • Настраивать серверы авторизации, специально разработанные для рабочих процессов MCP
  • Реализовать детализированный контроль доступа для инструментов и ресурсов MCP

Безопасность сервера MCP

Предоставляет возможности ресурсного сервера OAuth 2.0 для MCP-серверов Spring AI. Также он обеспечивает базовую поддержку серверов на основе API-ключей. Аутентификация OAuth2 и API-ключей совместима только с серверами на базе Spring WebMVC. Проверка происхождения также поддерживает Spring WebFlux.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Security

Security and Authorization support for Model Context Protocol in Spring AI.

⚠️ Versions 0.1.x of mcp-security only work Spring AI’s 2.0.x branch. For Spring AI 1.1.x, use version 0.0.6.

Table of Contents

Overview

This repository provides Authorization support for Spring AI integrations with the Model Context Protocol (MCP). It covers both MCP Clients, MCP Servers, and Spring Authorization Server.

The project enables developers to:

  • Secure MCP servers with OAuth 2.0 authentication
  • Configure MCP clients with OAuth 2.0 authorization flows
  • Set up authorization servers specifically designed for MCP workflows
  • Implement fine-grained access control for MCP tools and resources

MCP Server Security

Provides OAuth 2.0 resource server capabilities for Spring AI’s MCP servers. It also provides basic support for API-key based servers. OAuth2 and API-key authentication are compatible with Spring WebMVC-based servers only. Origin validation additionally supports Spring WebFlux.

Quick start with mcp-server-security-spring-boot (recommended)

The easiest way to add OAuth2 security to your MCP server is with the Boot auto-configuration module. It provides a default SecurityFilterChain that secures all endpoints, with no additional configuration required beyond setting the issuer URI.

Maven


    
        org.springaicommunity
        mcp-server-security-spring-boot
        0.1.14
    

Gradle

implementation("org.springaicommunity:mcp-server-security-spring-boot:0.1.14")

Then configure your application.properties:

spring.ai.mcp.server.name=my-cool-mcp-server
spring.ai.mcp.server.protocol=STREAMABLE

# The issuer URI of the authorization server
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:9000

That’s it. When spring.security.oauth2.resourceserver.jwt.issuer-uri is set, the auto-configuration creates a SecurityFilterChain that secures all endpoints using the McpServerOAuth2Configurer.

For a complete working example, see the

Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →