VK MCP服务器
Model Context Protocol (MCP) server for VK (VKontakte) social network API
Enables AI assistants like Claude to interact with VK through a standardized interface.
______________________________________________________________________
特性
- 读取操作:获取用户、墙帖、群组、好友、新闻推送、照片
- 写入操作:创建帖子,添加评论
- 分析:获取社区统计数据
- 安全:通过环境变量进行基于令牌的身份验证
- 已测试:全面的测试覆盖率
- 简易安装:可在npm和MCP注册表上使用
快速开始
安装
npm install -g vk-mcp-server或者直接使用npx运行:
npx vk-mcp-serverMCP注册表
也可在MCP官方注册表中找到:
io.github.bulatko/vk获取VK访问令牌
- 首选 VK开发人员 并创建独立应用程序
- 获取您的应用ID
- 打开此URL(替换
YOUR_APP_ID):
https://oauth.vk.com/authorize?client_id=YOUR_APP_ID&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=friends,wall,groups,photos,stats,offline&response_type=token&v=5.199- 授权并复制
access_token从URL
配置
克劳德桌面版
添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"vk": {
"command": "npx",
"args": ["-y", "vk-mcp-server"],
"env": {
"VK_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}克劳德代码
添加到您的项目 .mcp.json:
{
"mcpServers": {
"vk": {
"command": "npx",
"args": ["-y", "vk-mcp-server"],
"env": {
"VK_ACCESS_TOKEN": "your_access_token_here"
}
}
}
}可用工具
| 工具 | 说明 |
|---|---|
vk_users_get | 通过ID或屏幕名称获取用户配置文件 |
vk_wall_get | 从用户/社区墙获取帖子 |
vk_wall_post | 发布新帖子 |
vk_wall_create_comment | 在帖子中添加评论 |
vk_groups_get | 获取用户的社区列表 |
vk_groups_get_by_id | 通过ID获取社区信息 |
vk_friends_get | 获取用户的好友列表 |
vk_newsfeed_get | 获取用户的新闻推送 |
vk_stats_get | 获取社区统计数据(仅限管理员) |
vk_photos_get | 从相册中获取照片 |
使用示例
配置后,您可以询问Claude:
- “获取有关Pavel Durov的VK个人资料的信息”
- “显示VK官方社区的最新5篇帖子”
- “在我的墙上贴上‘Hello World!’”
- “获取我所属的社区列表”
- “显示我的新闻源”
对话示例
User: What's on Pavel Durov's wall?
Claude: I'll check Pavel Durov's VK wall for recent posts.
[Uses vk_wall_get with domain="durov"]
Here are the latest posts from Pavel Durov's wall:
1. [Post content...]
2. [Post content...]测试
运行测试套件:
npm test运行覆盖率测试:
npm run test:coverageAPI 参考
此服务器包装VK API v5.199。有关详细的参数文档,请参阅:
安全须知
- 永远不要共享您的访问令牌
- 这
offline作用域提供一个不过期的令牌 - 授权前检查权限
- 对于生产,考虑使用服务令牌
贡献
欢迎投稿!请阅读 贡献指南 第一。
- 分叉存储库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -m 'Add some amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
麻省理工学院 ©2026布拉特科
链接
______________________________________________________________________
Made with ❤️ for the MCP ecosystem
