Math Expression MCP Server
Integrates with Google's Gemini-2.0-flash model for natural language processing and interpretation of user queries.
Enables creation of chains that connect language models with external tools via Multi-Chain Protocol, allowing for tool augmented responses.
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., "@Math Expression MCP Serversolve 3 * (4 + 2) / 2"
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.
LangChain + Gemini + MCP (Tool Server)
Este projeto demonstra como criar um chain com LangChain usando o modelo gemini-2.0-flash do Google e integrá-lo com ferramentas customizadas usando o MCP (Multi-Chain Protocol), via conexão stdio.
✨ Funcionalidade
A chain é capaz de:
Interpretar linguagem natural com o Gemini.
Usar ferramentas externas via MCP — neste exemplo, uma calculadora de expressões matemáticas.
Executar localmente um servidor de ferramentas que se conecta à chain automaticamente.
Related MCP server: calculator-mcp
🔧 Requisitos
Python 3.10+
uv (ou
piptradicional)
📦 Instalação
Com uv (recomendado)
uv venv
source .venv/bin/activate
uv pip install -r requirements.txtOu com pip tradicional
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCrie um arquivo .env:
GOOGLE_API_KEY=sua_chave_google_api🚀 Execução
1. Execute o servidor de ferramentas (MCP)
Primeiro, execute o servidor de ferramentas. Este servidor vai processar as expressões matemáticas.
python server.py2. Execute o cliente
Em seguida, execute o cliente, que se conecta ao servidor e faz as requisições, passando a pergunta para a chain e recebendo o resultado do cálculo.
python client.pyComo Funciona?
O chain usa o modelo Gemini-Pro do Google para interpretar a linguagem natural.
Uma LLMChain é criada usando o modelo e um PromptTemplate para extrair a expressão matemática de uma pergunta.
A expressão extraída é então passada para uma ferramenta de cálculo via o protocolo MCP.
O servidor MCP calcula a expressão matemática e retorna o resultado.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
MCP server for building and testing AI agents with multi-model experimentation and insights.
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.-
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes 16 calculator operations as tools, enabling arithmetic, rounding, and root calculations via natural language.817 PyPIMIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that exposes 8 mathematical tools (arithmetic, algebra, calculus, matrix operations, statistics, probability, unit conversions) to any MCP-compatible AI agent, enabling mathematical computations without code.88 npm1MIT
- AlicenseBqualityCmaintenanceA Model Context Protocol (MCP) server that provides basic mathematical, statistical and trigonometric functions to Large Language Models (LLMs).5918 npm1MIT