viber-mcp

viber-mcp

MCP server for the Viber Bot REST API — drive a Viber bot from Claude Desktop, Claude Code, or any MCP client

Category
访问服务器

README

<p align="center"> <img src="https://upload.wikimedia.org/wikipedia/commons/5/5d/Viber_logo_2018_%28without_text%29.svg" width="80" alt="Viber" /> <br/> <strong>viber-mcp</strong> </p>

<p align="center"> Model Context Protocol server for the Viber Bot API </p>

<p align="center"> <a href="https://github.com/serhiizghama/viber-mcp/actions/workflows/ci.yml"><img src="https://github.com/serhiizghama/viber-mcp/actions/workflows/ci.yml/badge.svg" alt="CI" /></a> <a href="https://github.com/serhiizghama/viber-mcp"><img src="https://img.shields.io/github/stars/serhiizghama/viber-mcp?style=social" alt="GitHub stars" /></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License" /></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="Node.js >= 20" /></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-strict-blue" alt="TypeScript strict" /></a> </p>


The first MCP server for Viber. Connect any MCP-compatible client -- Claude Desktop, Claude Code, Cursor, Windsurf, and others -- to the Viber Bot REST API and control your Viber bot through natural language.

Viber has over 1 billion registered users, particularly strong in Ukraine, Eastern Europe, Greece, and Southeast Asia. This server gives AI assistants full access to the bot API: send messages, media, files, broadcast to groups, manage webhooks, and query user data.

How it works

┌──────────────────────┐         stdio           ┌──────────────────────┐
│                      │  ◄───────────────────►  │                      │
│   MCP Client         │    JSON-RPC over        │   viber-mcp          │
│                      │    stdin/stdout         │                      │
│   - Claude Desktop   │                         │   13 tools           │
│   - Claude Code      │                         │   Zod validation     │──── HTTPS ───►  Viber API
│   - Cursor           │                         │   Error handling     │                 chatapi.viber.com
│   - Any MCP client   │                         │   Typed responses    │
│                      │                         │                      │
└──────────────────────┘                         └──────────────────────┘

Quick start

Try it instantly -- no install required:

VIBER_AUTH_TOKEN=your-token npx @serhii.zghama/viber-mcp

Or install globally:

npm install -g @serhii.zghama/viber-mcp

Setup

Claude Desktop

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "viber": {
      "command": "npx",
      "args": ["-y", "@serhii.zghama/viber-mcp"],
      "env": {
        "VIBER_AUTH_TOKEN": "your-bot-token-here",
        "VIBER_SENDER_NAME": "MyBot"
      }
    }
  }
}

Windows note: Replace "command": "npx" with "command": "cmd" and "args" with ["/c", "npx", "-y", "@serhii.zghama/viber-mcp"].

Restart Claude Desktop. The Viber tools will appear in the tools menu.

Claude Code

claude mcp add viber-mcp -e VIBER_AUTH_TOKEN=your-bot-token-here -- npx -y @serhii.zghama/viber-mcp

Cursor

Open Settings > MCP Servers, click + Add, and paste:

{
  "viber": {
    "command": "npx",
    "args": ["-y", "@serhii.zghama/viber-mcp"],
    "env": {
      "VIBER_AUTH_TOKEN": "your-bot-token-here"
    }
  }
}

VS Code (Copilot)

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "viber": {
      "command": "npx",
      "args": ["-y", "@serhii.zghama/viber-mcp"],
      "env": {
        "VIBER_AUTH_TOKEN": "your-bot-token-here"
      }
    }
  }
}

Tools

13 tools covering the full Viber Bot API surface:

Messaging

Tool Description Key parameters
send_message Send a text message receiver, text (up to 7000 chars)
send_picture Send an image with optional caption receiver, media (URL), text (caption)
send_video Send a video receiver, media (URL), size (bytes)
send_file Send a file attachment receiver, media (URL), size, file_name
send_url Send a clickable link receiver, media (URL, max 2000 chars)
send_location Send GPS coordinates receiver, latitude, longitude
send_contact Send a contact card receiver, name, phone_number
broadcast_message Broadcast to up to 300 users receivers (array), text

Account & Users

Tool Description Key parameters
get_account_info Get bot profile and subscriber count none
get_user_details Fetch user profile (rate-limited: 2/12h per user) id
get_online Check online status of up to 100 users ids (array)

Webhooks

Tool Description Key parameters
set_webhook Register a webhook URL url, event_types (optional)
remove_webhook Disable the current webhook none

All tools validate inputs with Zod schemas before calling the Viber API. On errors, tools return human-readable messages with isError: true so the AI can decide how to proceed.

Full schema details and examples in docs/API_REFERENCE.md.

Configuration

Environment variables, read once at startup:

Variable Required Default Description
VIBER_AUTH_TOKEN yes -- Bot auth token from the Viber Admin Panel
VIBER_SENDER_NAME no Bot Default sender display name (max 28 chars)
VIBER_SENDER_AVATAR no -- Default sender avatar URL
VIBER_BASE_URL no https://chatapi.viber.com/pa API base URL override
VIBER_REQUEST_TIMEOUT_MS no 15000 Per-request timeout in milliseconds

Getting a Viber bot token

  1. Open the Viber Admin Panel
  2. Create a new bot account (or select an existing one)
  3. Copy the token from the bot's settings page
  4. Set it as VIBER_AUTH_TOKEN in your MCP client config

Note: Since February 2024, new Viber bot accounts may require commercial onboarding through Viber partners. Existing bot tokens continue to work.

Development

git clone https://github.com/serhiizghama/viber-mcp.git
cd viber-mcp
pnpm install
Command Description
pnpm build Build with tsup (ESM, Node 20+)
pnpm dev Build with file watching
pnpm typecheck Run TypeScript strict checks
pnpm test Run vitest (36 tests)

Project structure

src/
  index.ts           -- Entrypoint: config -> client -> server -> stdio
  config.ts          -- Environment variable parsing
  errors.ts          -- ViberApiError class
  server.ts          -- MCP server builder with tool registration
  viber/
    client.ts        -- Typed HTTP client for the Viber REST API
    types.ts         -- Request/response TypeScript interfaces
  tools/
    send-message.ts  -- One file per tool, Zod schema + handler
    ...              -- 12 more tool files
tests/
  viber-client.test.ts   -- Client unit tests (mocked fetch)
  server.test.ts         -- Integration test (spawns server, queries tools/list)
  tools/*.test.ts        -- Per-tool success + error path tests

Architecture decisions

  • Zero console.log -- stdout is the MCP protocol channel; only console.error for diagnostics
  • Native fetch -- no axios/node-fetch; minimal runtime dependencies
  • No retries -- Viber REST calls are user-driven via MCP; silent retries would hide real problems from the AI
  • Zod validation -- every tool input is validated before reaching the Viber API
  • Tools never throw -- errors are caught and returned as { isError: true } so the AI can handle them gracefully

Roadmap

Future work -- contributions welcome:

  • [ ] Rich media / carousels -- send_rich_media tool with carousel layout
  • [ ] Keyboards -- interactive button keyboards on messages
  • [ ] Webhook receiver -- sibling package for incoming events via HTTP
  • [ ] Stickers -- send_sticker tool
  • [ ] HTTP transport -- Streamable HTTP for remote MCP deployments

License

MIT © Serhii Zghama

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选