Cloud MCP Calculator
A cloud-deployable math tool server that provides calculator capabilities to local LLM agents via the Model Context Protocol and Server-Sent Events. It allows instructors to host a centralized calculation engine that students can connect to from their local development environments.
README
Cloud MCP Calculator: Student & Instructor Guide
This repository contains a cloud-deployable math tool server using the Model Context Protocol (MCP) via Server-Sent Events (SSE). This architecture allows students to connect their local local LLM agents (via VS Code Continue) to a centralized, instructor-managed tool.
Distributed Architecture
The following diagram shows how the system is distributed between the instructor's cloud infrastructure and the students' local machines.
graph TB
subgraph "Cloud Infrastructure (Instructor)"
VM[Cloud Virtual Machine]
Docker[Docker Container]
Uvicorn[Uvicorn / SSE Server]
CalcTool[Calculator Logic]
VM --> Docker
Docker --> Uvicorn
Uvicorn --> CalcTool
end
subgraph "Student Machine"
VSCode[VS Code + Continue]
LLM[Local LLM / Ollama]
NB[01_math_agent.ipynb]
end
VSCode -- "HTTP-SSE / Port 8080" --> Uvicorn
NB -- "Standard Logic" --> OpenAI[OpenAI / API]
Protocol Interaction Flow
When a student asks a math question, the following exchange occurs via the SSE protocol:
sequenceDiagram
participant S as Student (VS Code)
participant C as Cloud server (VM)
participant T as Calculator Tool
S->>C: GET /sse (Connect)
C-->>S: SSE Stream Opened
S->>C: POST /sse?sessionId=... (Initialize)
C-->>S: JSON-RPC (Capabilites & ServerInfo)
S->>C: POST /sse (tools/call: calculate)
C->>T: eval(expression)
T-->>C: Result (e.g., "42")
C-->>S: JSON-RPC Result
S->>S: Display "The answer is 42."
Student Setup (config.yaml)
To connect to the cloud tool, update your ~/.continue/config.yaml as follows:
mcpServers:
- name: cloud-calc
type: sse
url: http://<YOUR-VM-PUBLIC-IP>:8080/sse
experimental:
autoExecuteTools: true
Instructor Setup (Makefile)
Use the provided Makefile on your VM to manage the service easily:
| Command | Action |
|---|---|
make build |
Builds the mcp-calculator Docker image. |
make run |
Starts the server in background (detached) on port 8080. |
make logs |
Follows the live server logs (useful for debugging student connections). |
make stop |
Gracefully stops and removes the running container. |
VM Security Note:
Ensure your VM's Cloud Firewall (Security Group) allows Inbound TCP traffic on Port 8080.
Debug:
curl -v http://YOUR-VM-PUBLIC-IP>:8080/sse
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.