mcp-sse
MCP Server com SSE e Autenticação Bearer
claude mcp add --transport stdio br-silvano-mcp-sse node dist/index.js \ --env PORT="3001" \ --env BEARER_TOKEN="your-bearer-token"
How to use
This MCP Server implements a Bearer Token authenticated MCP over Server-Sent Events (SSE). It exposes a set of example tools that demonstrate the four basic arithmetic operations, registered as MCP tools and usable by clients over the /sse and /messages endpoints. Clients connect via SSE to establish a session, receive the list of available tools, and then send messages to invoke those tools. Authentication is performed by including an Authorization header with a Bearer token for the initial connection. The server is designed to be developer-friendly, using ts-node for development and a compiled dist/index.js for production deployments.
How to install
Prerequisites:
- Node.js 20 or newer
- npm
- TypeScript (for development)
Install and run in development:
git clone <REPO_URL>
cd mcp-sse
npm install
# Run in development (uses ts-node via npm scripts)
npm run dev
Run in production (after building):
npm run build
node dist/index.js
Configuration:
- Create a .env file at the project root and define your Bearer token and port:
BEARER_TOKEN=your-token-goes-here
PORT=3001
Notes:
- Ensure the PORT in your environment matches any reverse proxy or firewall rules.
- The server reads BEARER_TOKEN from environment variables for authentication.
Additional notes
Tips:
- If you encounter authentication issues, confirm that the Authorization header follows the format: Authorization: Bearer <token>.
- For local development, you can use the inspector tool via npm run dev:inspect to view tools in a web interface at http://127.0.0.1:6274.
- The server uses SSE for real-time communication; ensure your client supports EventSource and maintains the connection for ongoing messages.
- Common issue: forgetting to set BEARER_TOKEN in .env or mismatch between the token used by the client and the one configured on the server.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
mcp-typescript-sdk
A TypeScript SDK for implementing Model Context Protocol (MCP) over MQTT, supporting both browser and Node.js environments.
awsome_kali_MCPServers
awsome kali MCPServers is a set of MCP servers tailored for Kali Linux
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
mcp -chart-minio
mcp-server-chart私有化部署方案
codemesh
The Self-Improving MCP Server - Agents write code to orchestrate multiple MCP servers with intelligent TypeScript execution and auto-augmentation