SSE Calculator
A stateful calculator server using Server-Sent Events (SSE) for real-time communication.
SSE Calculator MCP Server
A stateful calculator server that uses Server-Sent Events (SSE) for real-time communication. This server implements the Model Context Protocol (MCP) for integration with AI assistants.
Features
- Real-time calculator operations using SSE
- Stateful sessions for ongoing calculations
- History tracking for all calculations
- Web-based calculator interface
- MCP integration for AI assistants
Architecture
The server is built using NestJS and implements the following components:
- Session Service: Manages calculator sessions and state
- Calculator Service: Performs calculation operations
- SSE Controller: Handles client connections and event streaming
Getting Started
Prerequisites
- Node.js (v14 or higher)
- npm (v6 or higher)
Installation
- Clone the repository
- Install dependencies:
npm install
- Start the server:
npm run start:dev
- Open the calculator interface in your browser:
http://localhost:3000
API Endpoints
SSE Stream
GET /calculator/stream
Establishes an SSE connection and creates a new calculator session.
Calculate
POST /calculator/calculate/:sessionId
Performs a calculation operation on the specified session.
Request body:
{
"operation": "add", // add, subtract, multiply, divide, clear
"a": 5,
"b": 3
}
History
GET /calculator/history/:sessionId
Retrieves the calculation history for the specified session.
Sessions
GET /calculator/sessions
Retrieves all active calculator sessions.
MCP Integration
To use this server as an MCP server, add the following configuration to your MCP settings file:
{
"mcpServers": {
"remote-calculator": {
"url": "http://localhost:3000/calculator/stream",
"disabled": false,
"alwaysAllow": [],
"timeout": 60
}
}
}
Deployment Options
For production deployment, you can use the following options:
-
Docker: A Dockerfile is provided for containerized deployment
- See
Dockerfileanddocker-compose.ymlfor configuration
- See
-
Smithery.ai: Deploy directly from GitHub
- See
SMITHERY_DEPLOYMENT.mdfor detailed instructions - Configuration provided in
smithery.json
- See
-
Heroku/DigitalOcean: Cloud platform deployment
- See
DEPLOYMENT.mdfor step-by-step instructions
- See
-
Self-hosted: Use NGINX or similar for SSL termination and load balancing
Hosting Your Own MCP Server
After deploying your server, update your MCP client configuration to point to your hosted URL:
{
"mcpServers": {
"remote-calculator": {
"url": "https://your-deployed-url.com/calculator/stream",
"disabled": false,
"alwaysAllow": [],
"timeout": 60
}
}
}
License
MIT
相关服务器
Kone.vc
赞助Monetize your AI agent with contextual product recommendations
ActivityWatch MCP Server (Swift)
Provides structured access to ActivityWatch time tracking data for AI assistants.
Sequential Thinking Tools
Guides problem-solving by breaking down complex problems and recommending the best MCP tools for each step.
Redmine
An MCP server for interacting with the Redmine project management system.
MCPCalc
Hosted MCP server providing a library of calculators spanning finance, math, health, construction, engineering, food, automotive, a full Computer Algebra System (CAS) and Spreadsheet.
Logseq
Control and interact with a local Logseq graph for knowledge management and note-taking.
Asana
Interact with Asana tasks, projects, workspaces, and comments using the Asana API.
n8n Video Compilation
Automate AI-powered video compilation workflows using n8n.
Excel to PDF MCP Server
Convert Excel and Apple Numbers files to PDF format.
Ookcite MCP
Validate DOIs against a real citation database, format references in 2900+ CSL styles (APA, IEEE, Chicago, Nature, etc.), and catch hallucinated academic references before they reach your paper or documentation or pitch deck. Manage citation collections, import/export BibTeX, and batch-process references. 29 tools.
Rebrandly MCP Tool (Go)
Generate short URLs using the Rebrandly API.