my-calculator-mcp-project
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@my-calculator-mcp-projectWhat is 12 + 18?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
My MCP Project
A simple Model Context Protocol (MCP) proof-of-concept that exposes calculator tools through an MCP server and connects to them from a LangChain-powered client using Groq.
Quick Start
git clone <your-repo-url>
cd my-mcp-project
python -m venv .venv
.venv\Scripts\activate
pip install -e .Create a .env file:
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=openai/gpt-oss-20bStart the server:
python server.pyIn a second terminal, run the client:
python client.pyThen ask questions like:
You: What is 12 + 18?
Assistant: 30This project demonstrates how to:
Start an MCP server with tools such as add, subtract, multiply, and divide
Expose those tools over HTTP using
streamable-httpConnect a client to the MCP server
Use a Groq LLM to call MCP tools dynamically from natural-language prompts
Related MCP server: MathServer
Project Structure
server.py– MCP server that exposes calculator toolsclient.py– client that connects to the server and uses a Groq modelpyproject.toml– project metadata and Python dependencies.env– local environment file for your Groq API key
Requirements
Before you run the project, make sure you have:
Python 3.13 or newer
A Groq account and API key
Git installed
Clone the Repository
git clone <your-repo-url>
cd my-mcp-projectSet Up a Virtual Environment
From the project root:
python -m venv .venvOn Windows:
.venv\Scripts\activateOn macOS/Linux:
source .venv/bin/activateInstall Dependencies
This project uses pyproject.toml, so install the package and dependencies like this:
pip install -e .If you want to verify the installation afterwards:
python -c "import mcp, langchain_groq; print('Dependencies ready')"Configure Environment Variables
Create a .env file in the root folder with the following values:
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=openai/gpt-oss-20bNotes:
GROQ_API_KEYis required for the client to work.GROQ_MODELis optional; if omitted, the app falls back toopenai/gpt-oss-20b.
Run the MCP Server
Open a terminal in the project folder and run:
python server.pyYou should see output similar to:
[MCP SERVER] Starting on http://127.0.0.1:8001/mcpThis starts the MCP server and exposes the tools on:
http://127.0.0.1:8001/mcpRun the Client
Open a second terminal, activate the virtual environment if needed, and run:
python client.pyThe client will:
read the Groq key from
.envconnect to the MCP server
list available tools
start an interactive chat session
Example interaction:
You: What is 12 + 18?
Assistant: 30You can also ask things like:
"Multiply 7 by 9"
"Divide 20 by 4"
"Subtract 50 from 120"
Type exit to quit the client.
Example Tools Exposed by the Server
The server exposes these tools:
add(a, b)subtract(a, b)multiply(a, b)divide(a, b)validate_call(token, message)
Troubleshooting
1. GROQ_API_KEY is missing
Make sure your .env file exists and contains the correct key.
2. Server does not start
Check whether port 8001 is free and whether you are running the server from the project root.
3. Client cannot connect to the server
Ensure the MCP server is already running before starting the client.
4. Module not found errors
Reinstall dependencies:
pip install -e .Notes
This project is a simple MCP proof-of-concept intended for learning and experimentation. It is useful for understanding how to:
build tool-calling MCP servers
connect a client to an MCP endpoint
integrate MCP tools with LangChain and Groq
Screenshots
These sample images show the expected project behavior:
Server startup
Client interaction
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome. Please see CONTRIBUTING.md for development and pull request guidelines.
This server cannot be deployed
Maintenance
Related MCP Connectors
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
MCP server for langchain documentation, generated by doc2mcp.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that demonstrates mathematical capabilities through a LangChain integration, allowing clients to perform math operations via the MCP protocol.-
- FlicenseNot gradedqualityDmaintenanceProvides basic mathematical operations (addition, subtraction, multiplication, division) through a Model Context Protocol server. Enables MCP-compatible clients like chatbots to perform calculations by sending structured math requests.-
- AlicenseNot gradedqualityDmaintenanceEnables basic arithmetic operations (add, subtract, multiply, divide, modulo) via natural language, with a FastMCP-based server and client for exploring MCP tool calling.MIT
- FlicenseNot gradedqualityDmaintenanceEnables performing arithmetic operations (add, subtract, multiply, divide, power, modulo) via natural language through HTTP SSE transport, allowing integration with Claude or other MCP clients for AI-powered calculations.-