6 releases
Uses new Rust 2024
| 0.4.1 | Sep 7, 2025 |
|---|---|
| 0.4.0 | Aug 19, 2025 |
| 0.3.4 | Jul 5, 2025 |
| 0.3.2 | Jun 28, 2025 |
| 0.1.4 |
|
#240 in HTTP client
1,005 downloads per month
730KB
17K
SLoC
VKTeams Bot MCP Server
A Model Context Protocol (MCP) server for VK Teams Bot API. Easily integrate VK Teams bots with LLM agents, automation systems, or any external service via a universal protocol.
✨ Features
- 🔄 Interactive Setup: Automatic chat ID elicitation from MCP clients
- 📤 Send Messages: Send text messages to VK Teams chats via MCP
- 📎 Enhanced File Uploads: Upload files directly from LLM with multiple formats
- 📝 Smart File Handling: Base64 upload, text-to-file, JSON uploads
- 🤖 Bot Info: Retrieve bot information and diagnostics
- 💬 Chat Management: Full chat control (members, admins, settings)
- 📁 File Operations: File uploads, voice messages, media handling
- 📡 Event Streaming: Receive chat and bot events
- 🔍 Storage Operations: Semantic search, text search, message retrieval
- 🎛️ Session Management: Reset session data and cached configurations
- 🔌 Universal Integration: Works over stdin/stdout, perfect for LLMs and automation
Quick Start
1. Set Environment Variables
export VKTEAMS_BOT_API_TOKEN=your_token_here
export VKTEAMS_BOT_API_URL=https://your-api-url
# Chat ID is now optional - will be requested interactively if needed
export VKTEAMS_BOT_CHAT_ID=your_chat_id # Optional
2. Build and Run
cargo build --release
./target/release/vkteams-bot-mcp
3. Interactive Setup
When you first use any tool that requires a chat ID, the MCP server will automatically request it from your client:
- Chat ID: Enter your VK Teams chat ID (e.g.,
751987654321@chat.agent) - The chat ID will be cached for the current session
- Use
reset_sessiontool to clear cached data
4. Example MCP Requests
Send a text message (chat ID requested automatically)
{
"tool": "send_text",
"params": {
"text": "Hello, world!"
}
}
Upload a file from base64
{
"tool": "upload_file_from_base64",
"params": {
"file_name": "document.txt",
"base64_content": "SGVsbG8gV29ybGQh",
"caption": "Here's the document you requested"
}
}
Upload text as a file
{
"tool": "upload_text_as_file",
"params": {
"file_name": "script.py",
"content": "print('Hello from Python!')",
"caption": "Python script generated by AI"
}
}
Reset session (clear cached chat ID)
{
"tool": "reset_session",
"params": {}
}
Usage
The server communicates via the MCP protocol over standard input/output. You can connect it to LLM agents, automation scripts, or use it as a standalone service.
Supported Tools
Core Bot Operations
self_get— Get bot information and statusfile_info— Get file information and metadataevents_get— Get events from the chatdaemon_status— Get daemon status and statistics
Messaging Operations
send_text— Send a text message to the chatsend_file— Send file to chatsend_voice— Send voice messageedit_message— Edit existing messagedelete_message— Delete message from chatpin_message— Pin message in chatunpin_message— Unpin message in chatsend_action— Send typing/looking indicators
File Upload Operations
upload_file_from_base64— Upload file from base64 encoded contentupload_text_as_file— Create and upload text content as a fileupload_json_file— Create and upload structured JSON files
Chat Management
chat_info— Get chat informationget_chat_members— Get list of chat membersget_chat_admins— Get chat administratorsset_chat_title— Set chat titleset_chat_about— Set chat description
Storage Operations
search_semantic— Search messages using semantic similaritysearch_text— Search messages using text searchget_database_stats— Get database statisticsget_context— Get conversation contextget_recent_messages— Get recent messages from storage
Session Management
reset_session— Reset session data including cached chat ID
Interactive Chat ID Configuration
The MCP server now features automatic chat ID elicitation:
How It Works
- First Use: When you call any tool that requires a chat ID, the server automatically prompts your MCP client
- User Input: You enter the VK Teams chat ID (e.g.,
751987654321@chat.agent) in the client interface - Session Cache: The chat ID is stored for the entire session
- Reset Option: Use
reset_sessionto clear the cached chat ID and configure a new one
Benefits
- No Manual Configuration: No need to set
VKTEAMS_BOT_CHAT_IDenvironment variable - Session Persistence: Chat ID is remembered throughout your session
- Easy Switching: Reset and reconfigure for different chats as needed
- Client Integration: Works seamlessly with any MCP-compatible client (Claude Desktop, Continue, etc.)
File Upload Capabilities
The server includes smart file handling capabilities:
Supported Upload Methods
- Base64 Upload: Upload any file from base64 encoded content
- Text-to-File: Create text files directly from content
- JSON Upload: Create and upload structured JSON files
- Voice Messages: Send voice files (.ogg, .mp3, .wav, .m4a)
File Features
- Automatic filename handling
- Caption and reply message support
- Multiple file format support
- Safe file validation
MCP Client Compatibility
This server works with any MCP-compatible client:
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"vkteams-bot": {
"command": "path/to/vkteams-bot-mcp",
"env": {
"VKTEAMS_BOT_API_TOKEN": "your_token_here",
"VKTEAMS_BOT_API_URL": "https://your-api-url"
}
}
}
}
Continue (VS Code)
Add to your config.json:
{
"tools": [
{
"title": "VK Teams Bot",
"description": "VK Teams Bot MCP Server",
"params": {
"command": "path/to/vkteams-bot-mcp"
}
}
]
}
Direct Integration
# Run server directly
./vkteams-bot-mcp
# Or with environment variables
VKTEAMS_BOT_API_TOKEN=token VKTEAMS_BOT_API_URL=url ./vkteams-bot-mcp
Documentation
Dependencies
~21–39MB
~546K SLoC