Bedolaga MCP Server
Enables retrieving user balance in rubles from the Bedolaga Bot using Telegram ID.
README
Bedolaga MCP Server
MCP-сервер для получения баланса пользователя из Bedolaga Bot по Telegram ID.
Возможности
bedolaga_balance— получить баланс пользователя в рублях по Telegram IDbedolaga_transactions— получить историю пополнений пользователя по Telegram ID
Транспорты
Сервер поддерживает два транспортных протокола:
| Транспорт | Файл | Порт | Протокол |
|---|---|---|---|
| Streamable HTTP (новый) | http_server.py |
3100 | HTTP (REST + SSE) |
| Stdio (legacy) | bedolaga_server.py |
— | stdin/stdout JSON |
Streamable HTTP — это современный транспорт MCP, рекомендованный для production. Он позволяет подключаться по HTTP без необходимости запускать дочерний процесс на клиенте.
Требования
- Python 3.11+
- Docker (опционально)
- Развёрнутый Bedolaga Bot с Web API
- API-ключ от Bedolaga (выдаётся в админ-панели бота)
Быстрый старт
1. Клонировать
git clone https://github.com/mitetenov/bedolaga-mcp.git
cd bedolaga-mcp
2. Настроить
cp .env.example .env
# Заполнить BEDOLAGA_API_URL и BEDOLAGA_API_KEY
3. Запустить
Streamable HTTP (рекомендуется):
# Установить зависимости
pip install -r requirements.txt
# Запустить HTTP-сервер
BEDOLAGA_API_URL=https://your-bot.example.com \
BEDOLAGA_API_KEY=your-key \
python3 http_server.py
Сервер будет слушать на http://0.0.0.0:3100, MCP endpoint доступен по POST /mcp.
Stdio (legacy):
BEDOLAGA_API_URL=https://your-bot.example.com \
BEDOLAGA_API_KEY=your-key \
python3 bedolaga_server.py
Через Docker:
docker compose up -d
Docker-образ по умолчанию запускает Streamable HTTP сервер на порту 3100.
Подключение как MCP-сервер
Streamable HTTP (новый транспорт)
Сервер доступен по HTTP на порту 3100, endpoint: /mcp.
Hermes Agent
# ~/.hermes/config.yaml
mcp_servers:
bedolaga:
transport: streamable-http
url: "http://localhost:3100/mcp"
env:
BEDOLAGA_API_URL: "https://your-bot.example.com"
BEDOLAGA_API_KEY: "your-api-key"
Claude Desktop
{
"mcpServers": {
"bedolaga": {
"type": "streamableHttp",
"url": "http://localhost:3100/mcp"
}
}
}
Cursor / VS Code
{
"mcpServers": {
"bedolaga": {
"transport": "streamable-http",
"url": "http://localhost:3100/mcp"
}
}
}
Проверка через curl
# Инициализация (получить session ID)
curl -s -X POST http://localhost:3100/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{}},"id":1}' \
-D - | grep -i mcp-session-id
# Список инструментов (с session ID)
curl -s -X POST http://localhost:3100/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: <SESSION_ID>" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":2}'
# Вызов инструмента
curl -s -X POST http://localhost:3100/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: <SESSION_ID>" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"bedolaga_balance","arguments":{"telegram_id":123456789}},"id":3}'
Stdio (legacy транспорт)
Hermes Agent
# ~/.hermes/config.yaml
mcp_servers:
bedolaga:
command: "python3"
args: ["/path/to/bedolaga-mcp/bedolaga_server.py"]
env:
BEDOLAGA_API_URL: "https://your-bot.example.com"
BEDOLAGA_API_KEY: "your-api-key"
Claude Desktop
{
"mcpServers": {
"bedolaga": {
"command": "python3",
"args": ["/path/to/bedolaga-mcp/bedolaga_server.py"],
"env": {
"BEDOLAGA_API_URL": "https://your-bot.example.com",
"BEDOLAGA_API_KEY": "your-api-key"
}
}
}
}
Cursor / VS Code
Добавить в .cursor/mcp.json или settings.json:
{
"mcpServers": {
"bedolaga": {
"command": "python3",
"args": ["/path/to/bedolaga-mcp/bedolaga_server.py"],
"env": {
"BEDOLAGA_API_URL": "https://your-bot.example.com",
"BEDOLAGA_API_KEY": "your-api-key"
}
}
}
}
Управление сессиями
Streamable HTTP транспорт использует stateful-сессии по умолчанию (stateless_http=False). После инициализации сервер возвращает заголовок mcp-session-id, который клиент должен передавать во всех последующих запросах.
Если нужен stateless-режим (без отслеживания сессий), отредактируйте http_server.py и установите stateless_http=True.
Переменные окружения
| Переменная | Назначение |
|---|---|
BEDOLAGA_API_URL |
URL Bedolaga Web API |
BEDOLAGA_API_KEY |
API-ключ Bedolaga |
PORT |
Порт HTTP-сервера (по умолчанию: 3100) |
HOST |
Адрес для bind (по умолчанию: 0.0.0.0) |
API
Bedolaga Web API: X-API-Key в заголовке, endpoint /users/by-telegram-id/{telegram_id}. Подробнее: https://docs.bedolagam.ru
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.