mcp-server-playground
Verified Safeby chrisleekr
Overview
A playground and reference implementation for a Model Context Protocol (MCP) server, featuring streamable HTTP transport, OAuth proxy for third-party authorization servers like Auth0, and stateful session management.
Installation
npm run docker:runEnvironment Variables
- MCP_CONFIG_TOOLS_PROJECT_PATH
- MCP_CONFIG_SERVER_AUTH_ENABLED
- MCP_CONFIG_SERVER_AUTH_JWTSECRET
- MCP_CONFIG_SERVER_AUTH_AUTH0_DOMAIN
- MCP_CONFIG_SERVER_AUTH_AUTH0_CLIENTID
- MCP_CONFIG_SERVER_AUTH_AUTH0_CLIENTSECRET
- MCP_CONFIG_SERVER_AUTH_AUTH0_AUDIENCE
- MCP_CONFIG_SERVER_AUTH_AUTH0_SCOPE
- MCP_CONFIG_TOOLS_AWS_REGION
- MCP_CONFIG_TOOLS_AWS_PROFILE
- MCP_CONFIG_TOOLS_AWS_CREDENTIALS_ACCESSKEYID
- MCP_CONFIG_TOOLS_AWS_CREDENTIALS_SECRETACCESSKEY
- MCP_CONFIG_TOOLS_AWS_BEDROCK_REGION
- MCP_CONFIG_TOOLS_AWS_BEDROCK_PROFILE
- MCP_CONFIG_TOOLS_AWS_BEDROCK_CREDENTIALS_ACCESSKEYID
- MCP_CONFIG_TOOLS_AWS_BEDROCK_CREDENTIALS_SECRETACCESSKEY
- MCP_CONFIG_TOOLS_AWS_BEDROCK_MODEL
- MCP_LOG_LEVEL
Security Notes
The server uses standard security practices for Express applications, including `helmet` for security headers and `express-rate-limit` for rate limiting. Input validation is rigorously enforced using Zod schemas for all tool and API inputs, significantly reducing injection risks. Secrets such as JWT keys and Auth0 credentials are designed to be loaded from environment variables, preventing hardcoding. The OAuth proxy implementation addresses the security concerns of dynamic client registration by delegating authorization to a third-party provider (Auth0) while managing local client registration and token flows using PKCE. The CORS header `Access-Control-Allow-Origin: *` is broadly permissive, which is acceptable for a 'playground' but would typically be narrowed in a production environment. The integration with AWS Bedrock for the `aws-ecs` tool has a maximum output token limit, and the prompt construction relies on stringifying internal data, reducing direct injection risk into the LLM prompt itself.
Similar Servers
mcp-openapi-server
A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP tools, along with optional support for MCP prompts and resources, enabling Large Language Models to interact with REST APIs.
example-remote-server
A reference server demonstrating all Model Context Protocol (MCP) features and OAuth 2.0 authentication patterns.
mcp-typescript-template
This project provides a foundational TypeScript template for developing remote Model Context Protocol (MCP) servers with robust tooling and best practices.
mcp-oauth-server
This server provides an OAuth 2.1 Authorization Server implementation, compliant with the MCP Authorization Spec, to handle authentication and authorization for MCP clients and resource servers.