mcp-server-api-key
Verified Safeby horatiucd
Overview
Demonstrates how to secure a Model Context Protocol (MCP) Server with an API key using Spring MCP Server Security.
Installation
API_KEY_ID=<your-api-key-id> API_KEY_SECRET=<your-api-key-secret> mvn spring-boot:runEnvironment Variables
- api.key.id
- api.key.secret
Security Notes
The server correctly retrieves API key ID and secret from environment variables or configuration files, preventing hardcoding in source. It integrates Spring Security with MCP API Key authentication. The use of `InMemoryApiKeyEntityRepository` for key storage is acceptable for a demonstration but would require a more robust, persistent solution (e.g., database, vault) for a production environment.
Similar Servers
infobip-openapi-mcp
Exposes any OpenAPI documented HTTP API as a Model Context Protocol (MCP) server for AI agents, with support for mock mode and authentication.
hello-spring-mcp-server
This server provides a set of tools for AI agents to query employee skills and retrieve employees based on specific skills from an in-memory dataset.
spring-boot-ai
A Spring Boot application implementing a Model Context Protocol (MCP) server that provides a remote 'Booking Tool' for an AI agent.
springai-mcp-gateway
An OAuth 2.1 secured Spring AI MCP gateway enabling ChatGPT Connectors to interact with local development tools via a streamable HTTP endpoint.