Skip to main content
Glama
ptrel1

NapCat MCP Server

by ptrel1

NapCat MCP Server

An MCP server that encapsulates all NapCat HTTP APIs, supporting both HTTP and WebSocket modes.

Based on the napcat-group-info-mcp extension, adding full API support for message sending, group management, friend management, system management, and more.

Features

  • 📋 Group chat information retrieval (read-only)

  • 👥 Group member information retrieval (read-only)

  • 📁 Group file management (read/write)

  • 💬 Message sending and management

  • 📢 Group announcement management

  • ⭐ Group essence message management

  • 👤 Friend/user management

  • 🔧 Group management operations (kick, ban, admin, etc.)

  • 🖥️ System management (login info, status, etc.)

  • 🎨 Napcat extended functions (OCR, images, voice, etc.)

  • 🔒 Supports group ID access restrictions

  • 🔐 Supports read-only mode

  • 🌐 Supports both HTTP and WebSocket modes

Related MCP server: Xadeus-QQ-MCP

Installation

git clone https://github.com/1021143806/napcat_mcp.git
cd napcat_mcp
pip install -e .

Configuration

Add to your MCP client configuration file:

{
  "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"
      }
    }
  }
}

Environment Variables

Variable

Description

Default Value

NAPCAT_HOST

NapCat server address

http://localhost:3000

NAPCAT_TOKEN

NapCat access token

Empty

ALLOWED_GROUPS

Allowed group IDs (comma-separated), leave empty for all

Empty

READONLY_MODE

Read-only mode (true/false)

false

Connection Modes

Automatically selected based on the NAPCAT_HOST prefix:

  • http:// or https:// → HTTP mode

  • ws:// or wss:// → WebSocket mode

Security Features

Group ID Access Restrictions

ALLOWED_GROUPS=                    # 允许所有群
ALLOWED_GROUPS=628101497           # 只允许单个群
ALLOWED_GROUPS=628101497,123456789 # 允许多个群

Read-only Mode

READONLY_MODE=true                 # 禁用所有写入操作

Available Tools (55)

Group Chat Information (16)

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

Message Sending and Management (8)

send_msg send_group_msg send_private_msg delete_msg get_msg get_forward_msg send_group_forward_msg mark_msg_as_read

Group Management (13)

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

Friend/User (5)

get_friend_list get_stranger_info get_friend_msg_history send_like set_friend_add_request

System Management (6)

get_login_info get_status get_version_info get_cookies get_csrf_token get_credentials

Napcat Extensions (7)

ocr_image get_image get_record can_send_image can_send_record get_online_client set_qq_profile

NapCat Configuration

Ensure that the HTTP server is enabled in NapCat's OneBot11 configuration:

{
  "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
    }]
  }
}

Technical Details

  • Based on the OneBot11 standard

  • Compatible with NapCat 4.9.91+

  • HTTP mode uses httpx asynchronous client

  • WebSocket mode uses websockets library

  • Uses Pydantic for parameter validation

License

AGPL-3.0

F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that enables AI clients to send and receive QQ messages through NapCatQQ (OneBot v11) for both private and group chats. It supports message context management, real-time WebSocket listening, and human-like typing simulation.
    7
    24
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    QQ MCP Server with Auto-Wake, message send/receive, group management, file sharing, and timed tasks. Connects via NapCatQQ (OneBot v11). One-click setup with quickstart.ps1.Based on Amadeus-QQ-MCP.
    33
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A MCP server that exposes QQ bot capabilities over Streamable HTTP, enabling clients to query bot status, read group and friend info, fetch chat history, and send group/private text messages.
    2
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Connects QQ via NapCat OneBot v11 to an Astral Code app-server, exposing MCP tools for sending messages, files, images, and fetching conversation history.
    10
    1
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Create and manage CodeQR short links, QR codes, and analytics from any MCP client.

  • MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.

  • Multi-tenant Telegram gateway for AI agents — HTTP+stdio, 8 tools, MTProto User API

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ptrel1/napcat_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server