Back to Home
Diags icon

mcp-server-oauth2

Verified Safe

by Diags

Overview

A complete microservices architecture for Model Context Protocol (MCP) with OAuth2 security, built on Spring Boot 3.4.0 and Spring AI 1.0.1.

Installation

Run Command
No command provided

Environment Variables

  • OPENAI_API_KEY
  • SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI
  • SPRING_DATASOURCE_URL
  • SPRING_DATASOURCE_USERNAME
  • SPRING_DATASOURCE_PASSWORD
  • SPRING_VECTOR_DATASOURCE_URL
  • SPRING_VECTOR_DATASOURCE_USERNAME
  • SPRING_VECTOR_DATASOURCE_PASSWORD
  • SPRING_MINIO_URL
  • SPRING_MINIO_ACCESS_KEY
  • SPRING_MINIO_SECRET_KEY
  • SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_AUTHSERVER_ISSUER_URI
  • SPRING_AI_MCP_CLIENT_STREAMABLE_HTTP_CONNECTIONS_MATH_SERVER_URL
  • REDIS_HOST
  • REDIS_PORT
  • KEYCLOAK_JWK_SET_URI
  • SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KEYCLOAK_ISSUER_URI
  • KEYCLOAK_ADMIN
  • KEYCLOAK_ADMIN_PASSWORD

Security Notes

Multiple critical security risks for production environments are present. Hardcoded credentials for Keycloak (admin/admin), MinIO (minioadmin/minioadmin123), PostgreSQL (meta/metapass, vector/vectorpass), and the OAuth2 client secret ('secret') are found in `docker-compose.yml`, `keycloak/realm-config.json`, and initialization scripts. Additionally, SSL certificate verification is explicitly disabled across `mcp-server`, `mcp-client`, and `gateway-server` for development convenience with self-signed certificates. While these are documented as development-only practices, they represent significant vulnerabilities if deployed without modification. CSRF protection is disabled for API services, which is common with JWTs but should be noted. Fine-grained authorization with `@PreAuthorize` is a positive aspect for internal access control.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassHigh
Avg Tokens750
Stars0
Forks0
Last Update2025-12-02

Tags

microservicesOAuth2Spring BootSpring AILLMRAGKeycloak