Skip to main content

QQ MCP Server

PyPI version Python

通过 HTTP API 向 QQ 群发送消息的 MCP 服务端。基于 python-sdk 构建。

安装

pip install qq-mcp

配置

两种方式任选其一,优先级:环境变量 > config.json

方式一:config.json(推荐)

在当前工作目录创建 config.json:

{
  "qq_api_url": "http://your-api:3000",
  "qq_token": "your-bearer-token",
  "qq_group_id": "123456789",
  "message_type": "text"
}

方式二:环境变量

export QQ_API_URL="http://your-api:3000"
export QQ_TOKEN="your-bearer-token"
export QQ_GROUP_ID="123456789"
export QQ_MESSAGE_TYPE="text"      # 可选,默认 text

使用

Claude Code

在项目根目录创建 .mcp.json:

{
  "mcpServers": {
    "qq-mcp": {
      "command": "qq-mcp"
    }
  }
}

命令行

qq-mcp                        # stdio 模式(默认)
qq-mcp --transport sse        # SSE HTTP 模式
python -m qq_mcp              # 模块方式启动

手动调用

from qq_mcp import mcp

mcp.run()        # stdio
mcp.run("sse")   # SSE

工具

send_qq_message

向 QQ 群发送消息。

参数 类型 必填 说明
message str 是 消息内容
group_id str 否 覆盖默认群号
message_type str 否 覆盖消息类型
api_url str 否 覆盖 API 地址
token str 否 覆盖 Bearer token

示例:

send_qq_message(message="Hello, QQ!")
send_qq_message(message="Hi", group_id="987654321")

hello

返回问候语。

hello(name="world")    # → "Hello, world!"

add

两数相加。

add(a=1, b=2)          # → 3.0

API 规范

服务端对接的 QQ API 接口:

POST {qq_api_url}/send_msg
Content-Type: application/json
Authorization: Bearer {qq_token}

{
  "message_type": "text",
  "group_id": "123456789",
  "message": "消息内容"
}

License

MIT

Metadata

Release files for qq-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for qq-mcp 0.1.1
File Interpreter ABI Platform
qq_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / qq_mcp-0.1.1-py3-none-any.whl

Download URL qq_mcp-0.1.1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b6b1069f2a699a320ebbc8bb0f07e89e7e9899cd83f6e9210c5c62d22d788f3
BLAKE2b-256 checksum
How to use checksums
35265739753e6d0ec6807d6e48fadaedcc7cdc5e2e2c8b14bd23749ec3cd9e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for qq-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page