loading…
Search for a command to run...
loading…
Enables interaction with NapCat QQ bot APIs for group management, messaging, and system operations. Supports HTTP and WebSocket modes with security features lik
Enables interaction with NapCat QQ bot APIs for group management, messaging, and system operations. Supports HTTP and WebSocket modes with security features like group restrictions and readonly mode.
封装 NapCat 所有 HTTP API 的 MCP 服务器,支持 HTTP 和 WebSocket 双模式。
基于 napcat-group-info-mcp 扩展,新增消息发送、群管理、好友管理、系统管理等全量 API。
git clone https://github.com/1021143806/napcat_mcp.git
cd napcat_mcp
pip install -e .
在 MCP 客户端配置文件中添加:
{
"mcpServers": {
"napcat-mcp": {
"command": "python",
"args": ["path/to/run_direct.py"],
"env": {
"NAPCAT_HOST": "http://localhost:3000",
"NAPCAT_TOKEN": "your_token_here",
"ALLOWED_GROUPS": "",
"READONLY_MODE": "false"
}
}
}
}
| 变量 | 说明 | 默认值 |
|---|---|---|
NAPCAT_HOST |
NapCat 服务器地址 | http://localhost:3000 |
NAPCAT_TOKEN |
NapCat 访问令牌 | 空 |
ALLOWED_GROUPS |
允许访问的群号(逗号分隔),留空=全部 | 空 |
READONLY_MODE |
只读模式(true/false) | false |
根据 NAPCAT_HOST 前缀自动选择:
http:// 或 https:// → HTTP 模式ws:// 或 wss:// → WebSocket 模式ALLOWED_GROUPS= # 允许所有群
ALLOWED_GROUPS=628101497 # 只允许单个群
ALLOWED_GROUPS=628101497,123456789 # 允许多个群
READONLY_MODE=true # 禁用所有写入操作
get_group_info get_group_info_ex get_group_list get_group_honor_info get_group_at_all_remain get_group_member_list get_group_member_info get_group_root_files get_group_files_by_folder get_group_file_system_info get_group_file_url get_group_msg_history get_group_announcement_list get_essence_msg_list get_group_system_msg get_group_ignore_add_request
send_msg send_group_msg send_private_msg delete_msg get_msg get_forward_msg send_group_forward_msg mark_msg_as_read
set_group_kick set_group_ban set_group_whole_ban set_group_admin set_group_card set_group_name set_group_leave set_group_special_title set_group_add_request upload_group_file delete_group_file send_group_notice set_essence_msg delete_essence_msg
get_friend_list get_stranger_info get_friend_msg_history send_like set_friend_add_request
get_login_info get_status get_version_info get_cookies get_csrf_token get_credentials
ocr_image get_image get_record can_send_image can_send_record get_online_client set_qq_profile
确保 NapCat 的 OneBot11 配置中启用了 HTTP 服务器:
{
"network": {
"httpServers": [{
"enable": true,
"name": "napcat mcp",
"host": "127.0.0.1",
"port": 3000,
"enableCors": true,
"enableWebsocket": true,
"messagePostFormat": "array",
"token": "your_token_here",
"debug": false
}]
}
}
httpx 异步客户端websockets 库AGPL-3.0
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"napcat-mcp-server": {
"command": "npx",
"args": []
}
}
}