calculadora-combustivel
Enables calculation of the most economical fuel (gasoline, ethanol, or natural gas) based on prices and vehicle consumption, following the 70% rule for ethanol and 60% for GNV.
README
Calculadora de Combustivel
Servidor MCP (Model Context Protocol) para calcular qual combustivel abastecer com base nos precos e rendimento real.
Sobre
Este servidor MCP roda na Cloudflare Workers e pode ser integrado com:
- ChatGPT (via Actions/GPTs)
- Claude Desktop
- Cursor IDE
- Cloudflare AI Playground
A Regra dos 70%
O etanol tem aproximadamente 70% do poder calorifico da gasolina. Isso significa que voce precisa de mais etanol para percorrer a mesma distancia.
- Etanol compensa se custar ate 70% do preco da gasolina
- GNV compensa se custar ate 60% do preco da gasolina
- Gasolina e melhor quando os alternativos custam mais que esses limites
Ferramentas Disponiveis
1. qual_combustivel_abastecer
Calcula qual combustivel e mais economico considerando o rendimento real.
Parametros:
| Parametro | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| preco_gasolina | number | Sim | Preco do litro (R$ 2.50 - 10.00) |
| preco_etanol | number | Sim | Preco do litro (R$ 2.50 - 10.00) |
| preco_gnv | number | Nao | Preco do m3 (R$ 2.50 - 10.00) |
| modo_saida | string | Nao | "completo" ou "resumido" |
Exemplo:
Gasolina: R$ 5.89, Etanol: R$ 3.99
Resultado: Etanol e 3.2% mais economico
2. calcular_economia
Calcula a economia em reais para um volume especifico.
Parametros:
| Parametro | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| preco_gasolina | number | Sim | Preco do litro |
| preco_etanol | number | Sim | Preco do litro |
| litros | number | Sim | Quantidade (1 - 1000) |
| preco_gnv | number | Nao | Preco do m3 |
3. comparar_viagem
Compara custos para uma viagem especifica.
Parametros:
| Parametro | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| distancia | number | Sim | Distancia em km (1 - 10000) |
| consumo_gasolina | number | Sim | Consumo do veiculo em km/L (3 - 30) |
| preco_gasolina | number | Sim | Preco do litro |
| preco_etanol | number | Sim | Preco do litro |
| preco_gnv | number | Nao | Preco do m3 |
Exemplo:
Viagem: 500 km, Consumo: 12 km/L
Gasolina: 41.7L = R$ 245.42
Etanol: 59.5L = R$ 237.50
Economia: R$ 7.92 (3.2%)
4. dicas_economia_combustivel
Retorna 7 dicas praticas para economizar combustivel.
Instalacao
# Clonar repositorio
git clone https://github.com/SEU_USUARIO/calculadora-combustivel.git
cd calculadora-combustivel
# Instalar dependencias
npm install
# Gerar tipos do Cloudflare
npm run cf-typegen
# Rodar localmente
npm run dev
Deploy
# Login na Cloudflare (primeira vez)
npx wrangler login
# Deploy
npm run deploy
Endpoints
| Endpoint | Descricao |
|---|---|
/sse |
MCP via Server-Sent Events |
/mcp |
MCP via HTTP |
/health |
Health check com versao e tools |
Integracoes
ChatGPT (Actions/GPTs)
- Crie um GPT personalizado
- Adicione uma Action com a URL:
https://seu-worker.workers.dev/sse - As 4 ferramentas serao importadas automaticamente
Claude Desktop
Adicione ao arquivo de configuracao:
{
"mcpServers": {
"calculadora-combustivel": {
"command": "npx",
"args": ["mcp-remote", "https://seu-worker.workers.dev/sse"]
}
}
}
Cloudflare AI Playground
- Acesse: https://playground.ai.cloudflare.com/
- Conecte usando a URL do seu worker
Tecnologias
- Cloudflare Workers - Serverless edge computing
- MCP Protocol - Model Context Protocol
- TypeScript - Type safety
- Zod - Schema validation
Scripts
npm run dev # Desenvolvimento local
npm run deploy # Deploy para Cloudflare
npm run type-check # Verificar tipos TypeScript
npm run cf-typegen # Gerar tipos do Cloudflare
Licenca
MIT
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.