Skip to main content
Glama
pholex

Qinglong MCP Server

by pholex

list_subscriptions

Retrieve all subscription lists from Qinglong Panel to monitor and manage scheduled tasks.

Instructions

查询青龙面板中的所有订阅列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for the 'list_subscriptions' tool. It authenticates with a Bearer token, makes a GET request to the Qinglong panel's /open/subscriptions endpoint, parses the response, formats the subscription list (ID, name, URL, type, schedule, status) into a readable text output, and returns it in the MCP response format. Handles errors appropriately.
    elif tool_name == "list_subscriptions":
        try:
            url = f"{QINGLONG_URL}/open/subscriptions"
            headers = {"Authorization": f"Bearer {token}"}
            resp = requests.get(url, headers=headers, timeout=10)
            result = resp.json()
        except Exception as e:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"请求失败: {str(e)}"}
            }
            print(json.dumps(response), flush=True)
            continue
        
        if result.get("code") == 200:
            subscriptions = result["data"] if isinstance(result["data"], list) else []
            subscriptions.sort(key=lambda x: x.get('id', 0))
            total = len(subscriptions)
            
            output = f"青龙面板: {QINGLONG_URL}\n共 {total} 个订阅:\n\n"
            for sub in subscriptions:
                output += f"ID: {sub.get('id')}\n"
                output += f"名称: {sub.get('name')}\n"
                output += f"URL: {sub.get('url')}\n"
                output += f"类型: {sub.get('type')}\n"
                output += f"定时: {sub.get('schedule')}\n"
                output += f"状态: {'启用' if sub.get('is_disabled') == 0 else '禁用'}\n"
                output += "-" * 50 + "\n"
            
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "result": {"content": [{"type": "text", "text": output}]}
            }
        else:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"获取订阅列表失败: {result}"}
            }
  • server.py:134-141 (registration)
    Registration of the 'list_subscriptions' tool in the tools/list MCP method response. Includes name, description, and empty input schema (no parameters required).
    {
        "name": "list_subscriptions",
        "description": "查询青龙面板中的所有订阅列表",
        "inputSchema": {
            "type": "object",
            "properties": {}
        }
    },
  • Input schema for 'list_subscriptions' tool: an empty object, indicating no input parameters are required.
    "inputSchema": {
        "type": "object",
        "properties": {}
    }

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/pholex/qinglong-mcp-server'

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