boss-mcp-server

squishier8123/boss-mcp-server

3.1

If you are the rightful owner of boss-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Boss MCP Server is a minimal Node.js Express server implementing the Model Context Protocol with features like Bearer token authentication, health monitoring, and Server-Sent Events (SSE) streaming.

Boss MCP Server

A minimal Node.js Express MCP (Model Context Protocol) server with Bearer token authentication, health monitoring, and Server-Sent Events (SSE) streaming.

Features

  • Health Endpoint: /health - Returns server status and uptime
  • SSE Endpoint: /sse - Streams test messages with Bearer token authentication
  • Authentication: Bearer token validation using AUTH_BEARER environment variable
  • CORS Support: Cross-origin requests enabled

Setup

  1. Install dependencies:

    npm install
    
  2. Set environment variables:

    # Set your Bearer token (default: 'default-bearer-token')
    export AUTH_BEARER=your-secure-token-here
    
    # Optional: Set port (default: 3000)
    export PORT=3000
    
  3. Start the server:

    # Production
    npm start
    
    # Development (with auto-restart)
    npm run dev
    

API Endpoints

GET /health

Returns server health status.

Response:

{
  "status": "healthy",
  "timestamp": "2024-01-01T12:00:00.000Z",
  "uptime": 123.456
}

GET /sse

Streams test messages via Server-Sent Events.

Headers Required:

Authorization: Bearer your-token-here

Response: Server-Sent Events stream with JSON messages:

{
  "message": "Connected to MCP server",
  "timestamp": "2024-01-01T12:00:00.000Z"
}

Testing

Health Check

curl http://localhost:3000/health

SSE Stream (with authentication)

curl -H "Authorization: Bearer your-token-here" http://localhost:3000/sse

JavaScript Client Example

const eventSource = new EventSource('http://localhost:3000/sse', {
  headers: {
    'Authorization': 'Bearer your-token-here'
  }
});

eventSource.onmessage = function(event) {
  const data = JSON.parse(event.data);
  console.log('Received:', data);
};

Environment Variables

  • AUTH_BEARER: Bearer token for authentication (required)
  • PORT: Server port (default: 3000)

Security Notes

  • Change the default Bearer token in production
  • Consider using HTTPS in production
  • Implement rate limiting for production use