currency-bot-db
Currency MCP Bot (proyecto educativo)
Un ejemplo sencillo de integración de Telegram Bot + API pública + Docker/PostgreSQL + MCP + Cursor.
Esquema
Telegram
↓
Python Bot
↓
API курса валют
Python Bot
↓
PostgreSQL
↑
MCP
↑
CursorRelated MCP server: postgres-mcp
Qué hace aquí el Telegram Bot
Acepta los comandos /start, /usd, /eur, /cny y responde con el tipo de cambio de la moneda frente al rublo.
Qué hace aquí la API
El bot solicita el tipo de cambio actual a una API pública gratuita (open.er-api.com), sin clave y sin registro.
Qué hace aquí Docker
docker compose levanta PostgreSQL en un contenedor. El propio bot se ejecuta localmente en Python.
Qué hace aquí MCP
El servidor MCP proporciona a Cursor dos herramientas sobre la misma base de datos:
get_recent_requests— últimas solicitudes de los usuariosget_currency_stats— cuántas veces se ha preguntado por USD / EUR / CNY
Archivos
Archivo | Descripción |
| Bot de Telegram (aiogram) |
| PostgreSQL sin ORM |
| Servidor MCP para Cursor |
| PostgreSQL en Docker |
| Conexión MCP en este proyecto |
| Secretos y ajustes (no en Git) |
Inicio rápido
1. Dependencias de Python
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt2. Variables de entorno
Copie el ejemplo y pegue el token del bot:
copy .env.example .envEn .env, rellene:
TELEGRAM_BOT_TOKEN=ваш_токен_от_BotFather3. PostgreSQL mediante Docker
docker compose up -dComprobación:
docker compose ps4. Ejecución del bot
python bot.pyEn Telegram, envíe al bot /start, luego /usd, /eur, /cny.
5. MCP en Cursor
En el proyecto está .cursor/mcp.json. En Windows, el servidor también se ha añadido al ~/.cursor/mcp.json del usuario para que aparezca con seguridad en la lista Connected.
Primero cree el venv e instale las dependencias (paso 1 anterior)
Ctrl+Shift+P→ Developer: Reload WindowAbra Settings → MCP
Busque
currency-bot-db— el estado debe ser verde, tools:get_recent_requests,get_currency_stats
Si el servidor no está o el estado es rojo: compruebe PostgreSQL (docker compose ps) y que .venv esté instalado.
Dónde obtener el token del bot de Telegram
Abra Telegram y busque @BotFather
Envíe
/newbotInvente un nombre y un username para el bot
BotFather le enviará un token de la forma
123456:ABC...Péguelo en
.envcomoTELEGRAM_BOT_TOKEN=...
No haga commit del token en Git — el archivo .env ya está en .gitignore.
Consultas de prueba al MCP en Cursor
Después de enviarle varios comandos al bot, escriba en el chat de Cursor:
«Muestra las últimas solicitudes de los usuarios»
«¿Qué divisas han solicitado los usuarios con más frecuencia?»
«Llama a get_recent_requests con limit=5»
«Llama a get_currency_stats»
Cursor debe usar las herramientas MCP get_recent_requests y get_currency_stats.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Read-only analytics for Convex apps, queryable via MCP from Claude, Cursor, and other clients.
Query your real net worth, spending, transactions, budgets and portfolio from any MCP client.
A paid remote MCP for AI SDK data query MCP, built to return verdicts, receipts, usage logs, and aud
MCP server for Modern Treasury — payment orders, transactions, counterparties and ledgers.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables querying PostgreSQL database metadata including table lists and schema information through the MCP protocol. Supports stdio transport for Cursor/IDE integration as well as HTTP transport with health check endpoints.2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for PostgreSQL that enables Cursor and other MCP clients to execute SQL queries, list tables, and explore database schemas via HTTP.2,422MIT
- FlicenseNot gradedqualityFmaintenanceProvides read-only SQL query access to Postgres and DuckDB databases via MCP tools, with extensive security hardening for public endpoints.1
- FlicenseNot gradedqualityDmaintenanceEnables querying and interacting with PostgreSQL databases using natural language through MCP. Supports configuration via environment variables and Cursor IDE integration.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Andrei-Blagov/MCP_HW'
If you have feedback or need assistance with the MCP directory API, please join our Discord server