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 "Install 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 installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/eriktilio/mcp-langchain-integration'
If you have feedback or need assistance with the MCP directory API, please join our Discord server