mcp-boilerplate-node
Verified Safeby timescale
Overview
Provides a robust boilerplate for building Node.js servers compatible with the Model Context Protocol (MCP) for exposing AI tools, prompts, and resources.
Installation
node dist/index.js httpEnvironment Variables
- OTEL_SERVICE_NAME
- MCP_ENABLED_TOOLS
- MCP_DISABLED_TOOLS
- MCP_ENABLED_PROMPTS
- MCP_DISABLED_PROMPTS
- MCP_ENABLED_RESOURCES
- MCP_DISABLED_RESOURCES
- PORT
- INSTRUMENT
- LOGFIRE_ENVIRONMENT
- NODE_ENV
- HOSTNAME
- OTEL_EXPORTER_OTLP_ENDPOINT
- JAEGER_TRACES_ENDPOINT
- LOGFIRE_TRACES_ENDPOINT
- LOGFIRE_LOGS_ENDPOINT
- LOGFIRE_TOKEN
Security Notes
The server uses `process.env` for sensitive configurations (e.g., API keys for observability, feature flags), which is a good practice. Input validation for tools is enforced through Zod schemas, mitigating common injection vulnerabilities. Request body size is limited to 4MB using `raw-body`. OpenTelemetry integration is present but optional, and tracing context extraction (e.g., `traceparent` header) is standard for distributed tracing. No hardcoded secrets or explicit 'eval' statements were found. The system architecture involves exposing API endpoints, so deployment environment and external access controls (e.g., authentication) would be crucial for a production setup, but this boilerplate itself does not inherently introduce severe risks.
Similar Servers
mcp-server-starter-ts
A minimal TypeScript starter template for building Model Context Protocol (MCP) servers, enabling AI applications to connect with data sources and tools through a standardized interface.
mcp-sdk-functions-hosting-node
A Node.js server for hosting serverless functions, likely within a Managed Cloud Platform (MCP) SDK context.
generator-app-remote-mcp-server-generic
Provides backend services for a generic multi-cloud application generator, enabling remote application scaffolding and management across various cloud providers.
cloud-a2a-mcp-quickstart
The server provides A2A (Agent-to-Agent) and MCP (Model Context Protocol) services, enabling agentic interactions and managing various profiles (venture, volunteer, reputation, wallet, location, activity) with AI integration via AWS Bedrock.