communication-mcp-server
MCP server that provides email communication tools (send email, health check, list providers) via SMTP, accessible over HTTP/SSE for remote AI clients like Claude Desktop.
README
š” Remote Communication MCP Server
A production-ready Model Context Protocol (MCP) server built with Node.js and TypeScript that exposes email communication tools over HTTP/SSE Transport (using StreamableHTTPServerTransport).
This remote implementation allows AI clients like Claude Desktop, Cursor, or MCP Inspector to connect to a publicly hosted instance (e.g., deployed on Render) rather than running the process locally.
š What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI applications to connect to external tools and data sources. While local MCP servers run as child processes over stdio, remote MCP servers expose a web server communicating over JSON-RPC streamed via HTTP Server-Sent Events (SSE).
āāāāāāāāāāāāāāāāāāāā HTTP / SSE āāāāāāāāāāāāāāāāāāāāāāā
ā AI Client ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāŗ ā Remote MCP Server ā
ā (Claude/Cursor/ ā JSON-RPC over POST ā (This Project) ā
ā MCP Inspector) ā & Event Stream (GET) ā ā
āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā
šļø Architecture
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā AI Client ā
ā (Claude Desktop / Cursor / Inspector) ā
āāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā²āāāāāāāāāāāāāāāāāāāāā
ā ā
ā HTTP POST /mcp ā GET /mcp (SSE Stream)
ā¼ ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāāāāā
ā Remote MCP Server (Express / Node.js) ā
ā ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā Active Sessions Store ā ā
ā ā Maps: Session ID āāāŗ MCP Server Session ā ā
ā ā ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā
ā ā ā MCP Server Session ā ā ā
ā ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā ā
ā ā ā ā Streamable Transport ā ā ā ā
ā ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā ā
ā ā ā ā¼ ā ā ā
ā ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā ā
ā ā ā ā McpServer ā ā ā ā
ā ā ā ā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā ā ā ā ā
ā ā ā ā ā health_check ā ā list_providers ā ā send_email ā ā ā ā ā
ā ā ā ā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāā āāāāāāāāā¬āāāāāāā ā ā ā ā
ā ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāā ā ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāā ā ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāā ā
ā ā ā
ā āāāāāāāāāāāāāā¼āāāāāāāāāāāāāā ā
ā ā EmailService ā ā
ā ā (Nodemailer) ā ā
ā āāāāāāāāāāāāāā¬āāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā SMTP Server ā
ā (Gmail, Outlook, etc.) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Project Structure
communication-mcp-server/
āāā src/
ā āāā server.ts # Entry point ā Express + Streamable HTTP Server
ā āāā config/
ā ā āāā index.ts # Environment configuration loader
ā āāā tools/
ā ā āāā index.ts # Tool registry (registers all tools)
ā ā āāā health.tool.ts # health_check tool
ā ā āāā providers.tool.ts # list_providers tool
ā ā āāā email.tool.ts # send_email tool
ā āāā services/
ā ā āāā email.service.ts # Email delivery via Nodemailer
ā āāā utils/
ā ā āāā logger.ts # Pino logger (writes to stderr)
ā ā āāā validators.ts # Email validation utilities
ā āāā types/
ā āāā index.ts # TypeScript type definitions
āāā .env.example # Environment variable template
āāā .gitignore # Git ignore rules
āāā package.json # Dependencies & scripts
āāā render.yaml # Render.com deployment blueprint
āāā tsconfig.json # TypeScript configuration
āāā README.md # This file
š ļø Available Endpoints & Tools
HTTP Endpoints
GET /health- Public endpoint returning server configuration and status.POST /mcp- MCP JSON-RPC message endpoint.GET /mcp- MCP Server-Sent Events (SSE) stream endpoint.DELETE /mcp- Terminates the MCP session.
Registered MCP Tools
| Tool | Description | Parameters |
|---|---|---|
health_check |
Returns server status, timestamp, version, and uptime | None |
list_providers |
Lists configured communication providers | None |
send_email |
Sends an email via SMTP | to, subject, text, html? |
š Installation
Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
- An SMTP email account (e.g., Gmail with App Password)
Setup
# 1. Clone the repository
git clone https://github.com/your-username/communication-mcp-server.git
cd communication-mcp-server
# 2. Install dependencies
npm install
# 3. Configure environment variables
cp .env.example .env
# Edit .env with your SMTP credentials, PORT, and optional API_KEY
# 4. Build the project
npm run build
āļø Configuration
Copy .env.example to .env and fill in your values:
| Variable | Description | Default / Example |
|---|---|---|
NODE_ENV |
Environment mode | development |
LOG_LEVEL |
Pino log level (debug, info, warn, error) |
info |
PORT |
HTTP Server port | 3000 |
API_KEY |
Optional token to secure the MCP endpoints | (None) |
CORS_ORIGIN |
CORS allowed origins | * |
SMTP_HOST |
SMTP server hostname | smtp.gmail.com |
SMTP_PORT |
SMTP server port | 587 |
SMTP_SECURE |
Use TLS (true for port 465) |
false |
SMTP_USER |
SMTP authentication username | ā |
SMTP_PASS |
SMTP authentication password (Gmail App Password) | ā |
SMTP_FROM |
Default sender address | ā |
š Running Locally
Development Mode (with hot reload)
npm run dev
Production Mode
npm run build
npm start
š Connecting to the Server
Remote HTTP MCP servers require a client that supports HTTP/SSE transport.
1. Connecting via Claude Desktop
Claude Desktop natively supports remote MCP servers. Add the server under the mcpServers object using the sse type:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"communication-remote": {
"url": "https://your-app-name.onrender.com/mcp",
"headers": {
"Authorization": "Bearer your-optional-api-key"
}
}
}
}
Note: Replace https://your-app-name.onrender.com/mcp with your actual local or deployed URL (e.g. http://localhost:3000/mcp for local testing).
2. Connecting via Cursor
Cursor supports connecting to remote MCP servers using the SSE server type:
- Open Cursor Settings ā Features ā MCP.
- Click + Add New MCP Server.
- Fill in the options:
- Name:
communication-remote - Type:
SSE - URL:
https://your-app-name.onrender.com/mcp
- Name:
If you secured your server with an API_KEY, make sure you configure your client or URL to pass the authorization header or use URL query params like https://your-app-name.onrender.com/mcp?api_key=your-key.
3. Connecting via MCP Inspector
Verify your remote server's functionality visually using the MCP Inspector:
npx @modelcontextprotocol/inspector http://localhost:3000/mcp
(Add headers if API key authentication is enabled)
š¢ Deployment to Render
The repository contains a render.yaml blueprint to quickly deploy this project as a Web Service on Render.
- Push your code to a Git repository (GitHub/GitLab).
- Go to your Render Dashboard.
- Click New + ā Blueprint.
- Select your connected repository.
- Configure the environment variables (
SMTP_HOST,SMTP_USER,SMTP_PASS,API_KEY, etc.) in the Render UI. - Click Deploy.
Render will build and deploy the application, setting up an HTTPS endpoint automatically (e.g. https://communication-mcp-server.onrender.com).
š® Future Improvements
- [ ] SMS Integration ā Add SMS support via Twilio or other professional SMS API gateway.
- [ ] Rate Limiting ā Add Express rate limiter middleware to prevent spam/abuse on the public route.
- [ ] Persistent Session Stores ā Move active sessions from in-memory map to Redis to allow multi-instance auto-scaling.
- [ ] JWT Authentication ā Implement OAuth2/JWT-based authorization for multi-tenant users.
- [ ] Message History ā Database integration to track email history and delivery logs.
š License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.