Back to Home
timescale icon

mcp-boilerplate-node

Verified Safe

by 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

Run Command
node dist/index.js http

Environment 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

Stats

Interest Score34
Security Score8
Cost ClassLow
Stars4
Forks0
Last Update2025-12-10

Tags

MCPNode.jsAIServerBoilerplate