FunPay MCP Server
Click on "Deploy 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., "@FunPay MCP Server show me my recent sales"
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.
FunPay MCP Server
FunPay MCP Server — это MCP-сервер (Model Context Protocol), предоставляющий AI-агентам полный программный доступ к аккаунту FunPay: чтение чатов и заказов, создание и редактирование лотов, возвраты средств и многое другое.
Сервер работает напрямую с web-API FunPay, без Telegram и сторонних зависимостей, и реализует тот же поток запросов, что и FunPayCardinal, но без наследования его кода.
FunPay MCP Server is an MCP server that gives AI agents full programmatic access to a FunPay account: read chats and orders, create and edit lots, refund payments, and more. It talks directly to FunPay's web API, with no Telegram or third-party dependencies, and reproduces the request flow used by FunPayCardinal without forking its code.
⚡ Возможности / Features
💬 Чаты и сообщения / Chats and messages
get_chats()— список всех чатов с превью последнего сообщения и отметкой непрочитанных.get_chat_history(chat_id, last_message_id=None)— история сообщений конкретного чата (входящие/исходящие, автор, таймстамп, изображения).get_chats_histories(chat_ids)— пакетное чтение историй нескольких чатов одним запросом.send_message(chat_id, text, interlocutor_id=None)— отправка сообщения в чат.get_chats()/get_chat_history()/get_chats_histories()/send_message()— full chat read/write via FunPay'srunner/long-polling endpoint, same approach as FunPayCardinal.
📦 Заказы / Orders
get_orders_counters()— счётчики активных продаж и покупок черезrunner/orders_counters.get_sales(include_paid, include_closed, include_refunded, limit)— список заказов со страницы «Мои продажи» с полным описанием, ценой, валютой, покупателем, статусом и датой.get_order(order_id)— детальная карточка заказа: описание, цена, параметры заказа, продавец, покупатель, статус.refund(order_id)— оформление возврата средств покупателю.
🏪 Лоты и категории / Lots and categories
get_my_lots(subcategory_id)— все ваши лоты в указанной подкатегории.get_lot_fields(lot_id)— текущие значения полей формы редактирования лота.save_lot(lot_id, fields)— создание или обновление лота.delete_lot(lot_id)— деактивация (удаление) лота.raise_lots(lot_ids)— поднятие лотов в каталоге (rate-limited).get_categories()— список категорий (по играм) с подкатегориями.get_subcategories(category_id)— подкатегории конкретной категории.
👤 Профиль и баланс / Profile and balance
get_me()— собственный профиль: id, username, активные счётчики.get_user(user_id)— публичный профиль любого пользователя FunPay.get_balance()— баланс в RUB, USD и EUR (доступно и всего). FunPay в новом UI не различает «доступно» и «всего», поэтомуtotal_*иavailable_*возвращают одно и то же значение (выводимый баланс).
Related MCP server: fiverr-mcp
📦 Установка / Installation
Требования / Requirements
Python 3.10+
Действующий аккаунт FunPay
golden_keycookie иUser-Agentиз браузера, в котором вы авторизованы на FunPay
Установка из исходного кода / Install from source
git clone https://github.com/fakelag28/funpay-mcp-server.git
cd funpay-mcp-server
python -m venv .venv
source .venv/bin/activate
pip install -e .⚙️ Первичная настройка / Setup
1. Получите golden_key / Get the golden_key
Авторизуйтесь на https://funpay.com в браузере Chromium.
Откройте DevTools (F12) → Application → Cookies →
https://funpay.com.Скопируйте значение cookie
golden_key.Также скопируйте значение User-Agent браузера: DevTools → Network → любой запрос → Headers → User-Agent.
2. Запуск сервера / Run the server
golden_key никогда не принимается через аргументы CLI и не хранится в коде. Используйте переменные окружения:
export FUNPAY_GOLDEN_KEY="<ваш golden_key>"
export FUNPAY_USER_AGENT="<ваш User-Agent>"
python -m funpay_mcpИли через .env:
cp .env.example .env
# отредактируйте .env, затем:
export $(cat .env | xargs)
python -m funpay_mcpПеременные окружения / Environment variables
Переменная | Обязательна | По умолчанию | Описание |
| ✅ | — | Значение cookie |
| ❌ | Chrome 124 Linux | User-Agent браузера с активной сессией |
| ❌ |
| HTTP timeout, секунды |
| ❌ |
|
|
| ❌ | — | Один URL, например |
🧩 Подключение к MCP-клиенту / Connecting an MCP client
Claude Desktop
В claude_desktop_config.json:
{
"mcpServers": {
"funpay": {
"command": "python",
"args": ["-m", "funpay_mcp"],
"env": {
"FUNPAY_GOLDEN_KEY": "<ваш ключ>",
"FUNPAY_USER_AGENT": "<ваш UA>"
}
}
}
}Cursor / любой MCP-клиент
Аналогично: зарегистрируйте сервер как funpay и передайте FUNPAY_GOLDEN_KEY / FUNPAY_USER_AGENT через env.
🔧 Разработка / Development
pip install -e .[dev]
pytest # 7 unit-тестов
FUNPAY_GOLDEN_KEY=*** \
FUNPAY_USER_AGENT=*** \
python tests/test_live.py # live-тест против реального FunPayСтруктура проекта / Project layout
funpay-mcp-server/
├── src/funpay_mcp/
│ ├── client.py # HTTP-клиент, golden_key, PHPSESSID, CSRF, runner/ polling
│ ├── parsers.py # JSON-парсер runner-ответов + HTML-парсер trade-страницы
│ ├── account.py # 17 методов бизнес-логики
│ ├── models.py # 10 Pydantic-моделей
│ └── server.py # FastMCP: 17 @mcp.tool() регистраций
├── tests/
│ ├── test_smoke.py # 7 unit-тестов
│ └── test_live.py # live-тест (требует golden_key)
├── pyproject.toml
├── .env.example
└── .gitignoreАрхитектура / Architecture
HTTP-клиент использует
runner/long-polling endpoint (как в FunPayCardinal) для получения реальных данных чатов и счётчиков заказов.runner/возвращает JSON с типизированными объектами, а не HTML, что упрощает парсинг и позволяет читать сразу несколько чатов одним запросом.CSRF-токен извлекается из атрибута
data-app-dataна главной странице и автоматически обновляется при каждом успешном ответе.Throttle 400 мс между запросами защищает от FunPay anti-flood правил.
golden_keyхранится только в env, не логируется, не пишется в файлы, не коммитится.
🔒 Безопасность / Security
golden_key— это эквивалент вашего пароля от FunPay. Никогда не коммитьте его, не вставляйте в публичные чаты и не логируйте. Если ключ утёк — немедленно смените его в настройках аккаунта FunPay (выйдите из всех сессий).Все mutating-операции (
send_message,refund,save_lot,delete_lot,raise_lots) рекомендуется вызывать только по явному одобрению пользователя в чате с AI-агентом.Сервер single-account: один
golden_keyна один процесс.
📄 Лицензия / License
Этот проект распространяется под лицензией AGPL-3.0. См. файл LICENSE. This project is licensed under the AGPL-3.0 License. See LICENSE.
Available Tools
16 toolsdelete_lotD
Inputs: lot_id (required). Returns: lot_id, message, success
get_balanceD
Inputs: lot_id. Returns: total_eur, total_rub, total_usd, available_eur, +2 more
get_categoriesD
Inputs: no named parameters. Returns: result
get_chat_historyD
Inputs: chat_id (required), last_message_id. Returns: result
get_chatsD
Inputs: no named parameters. Returns: result
get_lot_fieldsD
Inputs: lot_id (required). Returns: fields, lot_id
get_meD
Inputs: no named parameters. Returns: id, username, active_sales, active_purchases
get_my_lotsD
Inputs: subcategory_id (required). Returns: result
get_orderD
Inputs: order_id (required). Returns: id, raw, date, price, +11 more
get_salesD
Inputs: limit, start_from, include_paid, include_closed, +1 more. Returns: result
get_subcategoriesD
Inputs: category_id (required). Returns: result
get_userD
Inputs: user_id (required). Returns: id, avatar, banned, status, +2 more
raise_lotsD
Inputs: lot_ids (required).
refundD
Inputs: order_id (required). Returns: message, success, order_id
save_lotD
Inputs: fields (required), lot_id (required). Returns: lot_id, message, success
send_messageD
Inputs: text (required), chat_id (required), interlocutor_id. Returns: chat_id, message
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools are clearly distinct, such as get_me vs get_user and get_chats vs get_chat_history. However, get_sales and get_order could be confused since both relate to transactions, and get_my_lots vs get_lot_fields might be ambiguous without clear descriptions.
All tool names follow a consistent verb_noun pattern with lowercase and underscores (e.g., get_balance, send_message, delete_lot). Even exceptions like refund and raise_lots still adhere to the pattern, creating a predictable and uniform naming scheme.
With 16 tools, the server is slightly above the ideal 3-15 range, but the breadth is justified by the need to cover user, order, lot, chat, and category management. No tools feel redundant, and the count is not overwhelming.
The toolset covers core marketplace workflows well: user profiles, balance, refunds, sales/orders, lot CRUD (save/delete/get), and categories. Missing operations like explicit lot search or order creation are minor gaps, as buyers would normally initiate these actions.
Maintenance
Related MCP Connectors
Russian APIs for AI agents: YooKassa, CDEK, Bitrix24 and more. Ready scenarios with code. No key.
Read-only MetaTrader 5 for AI agents: balances, positions, history and prices. Sign in with OAuth.
Verified, pay-per-use API tools for AI agents through one authenticated connection.
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Related MCP Servers
AlicenseAqualityDmaintenanceEnables AI agents to directly operate ChainPay cryptocurrency payment system, including order creation, balance checks, and withdrawals.630 npmMIT- AlicenseAqualityDmaintenanceEnables AI assistants to manage Fiverr seller accounts directly from the browser session. Supports gig management, order tracking, messaging, analytics, and profile updates without API keys.141MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Wildberries and Ozon seller accounts for real-time access to sales, stocks, prices, finances, and reviews through official APIs.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to read and work with Wildberries, Ozon, and Yandex Market seller accounts through typed tools, multi-account support, unified data schemas, rate limiting, audit, and encrypted credential storage.1765 npmMIT