currency-bot-db
Currency MCP Bot (学習プロジェクト)
Telegram Bot + 公開API + Docker/PostgreSQL + MCP + Cursor のシンプルな連携例です。
構成
Telegram
↓
Python Bot
↓
API курса валют
Python Bot
↓
PostgreSQL
↑
MCP
↑
CursorRelated MCP server: postgres-mcp
Telegram Bot の役割
/start、/usd、/eur、/cny コマンドを受け付け、通貨のルーブルに対するレートを返します。
API の役割
ボットは無料の公開API(open.er-api.com)から最新レートを取得します。キー不要・登録不要です。
Docker の役割
docker compose が PostgreSQL をコンテナで起動します。ボット自体はローカルでPythonとして実行されます。
MCP の役割
MCPサーバーは Cursor に同じデータベースへの2つのツールを提供します:
get_recent_requests— ユーザーの最近のリクエストget_currency_stats— USD / EUR / CNY が何回尋ねられたか
ファイル
ファイル | 説明 |
| Telegram ボット (aiogram) |
| ORMなしのPostgreSQL |
| Cursor用のMCPサーバー |
| Docker内のPostgreSQL |
| このプロジェクトでのMCP接続 |
| シークレットと設定(Gitには含めない) |
クイックスタート
1. Python の依存関係
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt2. 環境変数
サンプルをコピーしてボットのトークンを貼り付けます:
copy .env.example .env.env に次の内容を入力します:
TELEGRAM_BOT_TOKEN=ваш_токен_от_BotFather3. Docker で PostgreSQL を起動
docker compose up -d確認:
docker compose ps4. ボットの起動
python bot.pyTelegram でボットに /start を送信し、次に /usd、/eur、/cny を送信します。
5. Cursor での MCP
プロジェクトには .cursor/mcp.json があります。Windows では、サーバーが Connected リストに確実に表示されるよう、ユーザー用の ~/.cursor/mcp.json にも追加されています。
最初に venv を作成し、依存関係をインストールします(上記ステップ1)
Ctrl+Shift+P→ Developer: Reload WindowSettings → MCP を開きます
currency-bot-dbを見つけます — ステータスが緑色で、tools:get_recent_requests、get_currency_statsとなっているはずです。
サーバーがない場合やステータスが赤い場合は、PostgreSQL(docker compose ps)と .venv がインストールされていることを確認してください。
Telegram Bot Token の入手方法
Telegram を開いて @BotFather を探します
/newbotを送信しますボットの名前と username を決めます
BotFather から
123456:ABC...のようなトークンが送られてきますそれを
.envにTELEGRAM_BOT_TOKEN=...として貼り付けます
トークンを Git にコミットしないでください。.env ファイルはすでに .gitignore に含まれています。
Cursor での MCP へのテストリクエスト
ボットにいくつかコマンドを送信した後、Cursor のチャットに次のように書いてください:
「ユーザーの最近のリクエストを表示して」
「ユーザーが最もよくリクエストした通貨はどれ?」
「get_recent_requests を limit=5 で呼び出して」
「get_currency_stats を呼び出して」
Cursor は MCP ツールの get_recent_requests と 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