Skip to main content
Glama
qiniu

Qiniu MCP Server

Official
by qiniu

live_streaming_bind_push_domain

Configure a push domain for RTMP/WHIP live streams by binding it to a LiveStreaming bucket in Qiniu Cloud.

Instructions

Bind a push domain to a LiveStreaming bucket for live streaming. This allows you to configure the domain for pushing RTMP/WHIP streams.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketYesLiveStreaming bucket name
domainYesThe push domain name (e.g., mcp-push1.qiniu.com)
domain_typeNoThe type of push domain (default: pushRtmp)pushRtmp

Implementation Reference

  • Core handler implementation in LiveStreamingService that performs the HTTP POST request to bind a push domain to a bucket.
    async def bind_push_domain(self, bucket: str, domain: str, domain_type: str = "pushRtmp") -> Dict[str, Any]:
        """
        Bind a push domain to the bucket
    
        Args:
            bucket: The bucket name
            domain: The push domain name
            domain_type: The type of push domain (default: pushRtmp)
    
        Returns:
            Dict containing the response status and message
        """
        url = f"{self._build_bucket_url(bucket)}/?pushDomain"
        data = {
            "domain": domain,
            "type": domain_type
        }
        body_str = json.dumps(data)
        headers = {
            **self._get_auth_header(method="POST", url=url, content_type="application/json", body=body_str),
            "Content-Type": "application/json"
        }
    
        logger.info(f"Binding push domain: {domain} (type: {domain_type}) to bucket: {bucket}")
    
        async with aiohttp.ClientSession() as session:
            async with session.post(url, headers=headers, json=data) as response:
                status = response.status
                text = await response.text()
    
                if status == 200 or status == 201:
                    logger.info(f"Successfully bound push domain: {domain} to bucket: {bucket}")
                    return {
                        "status": "success",
                        "bucket": bucket,
                        "domain": domain,
                        "type": domain_type,
                        "message": f"Push domain '{domain}' bound successfully to bucket '{bucket}'",
                        "status_code": status
                    }
                else:
                    logger.error(f"Failed to bind push domain: {domain}, status: {status}, response: {text}")
                    return {
                        "status": "error",
                        "bucket": bucket,
                        "domain": domain,
                        "type": domain_type,
                        "message": f"Failed to bind push domain: {text}",
                        "status_code": status
                    }
  • Tool schema defining input parameters, description, and name for the MCP tool.
    types.Tool(
        name="live_streaming_bind_push_domain",
        description="Bind a push domain to a LiveStreaming bucket for live streaming. This allows you to configure the domain for pushing RTMP/WHIP streams.",
        inputSchema={
            "type": "object",
            "properties": {
                "bucket": {
                    "type": "string",
                    "description": _BUCKET_DESC,
                },
                "domain": {
                    "type": "string",
                    "description": "The push domain name (e.g., mcp-push1.qiniu.com)",
                },
                "domain_type": {
                    "type": "string",
                    "description": "The type of push domain (default: pushRtmp)",
                    "default": "pushRtmp",
                },
            },
            "required": ["bucket", "domain"],
        },
    )
  • MCP tool handler wrapper in _ToolImpl that delegates to LiveStreamingService and formats response.
    async def bind_push_domain(self, **kwargs) -> list[types.TextContent]:
        result = await self.live_streaming.bind_push_domain(**kwargs)
        return [types.TextContent(type="text", text=str(result))]
  • Function to register all LiveStreaming MCP tools, including live_streaming_bind_push_domain.
    def register_tools(live_streaming: LiveStreamingService):
        tool_impl = _ToolImpl(live_streaming)
        tools.auto_register_tools(
            [
                tool_impl.create_bucket,
                tool_impl.create_stream,
                tool_impl.bind_push_domain,
                tool_impl.bind_play_domain,
                tool_impl.get_push_urls,
                tool_impl.get_play_urls,
                tool_impl.query_live_traffic_stats,
                tool_impl.list_buckets,
                tool_impl.list_streams,
            ]
        )
  • Helper method to construct the bucket URL used in bind_push_domain.
    def _build_bucket_url(self, bucket: str) -> str:
        """Build S3-style bucket URL"""
        if not self.live_endpoint:
            self.live_endpoint = "mls.cn-east-1.qiniumiku.com"
    
        # Remove protocol if present in live_endpoint
        endpoint = self.live_endpoint
        if endpoint.startswith("http://"):
            endpoint = endpoint[7:]
        elif endpoint.startswith("https://"):
            endpoint = endpoint[8:]
    
        # Build URL in format: https://<bucket>.<endpoint>
        return f"https://{bucket}.{endpoint}"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the configuration outcome without disclosing behavioral traits like required permissions, whether binding is reversible, rate limits, or error conditions. It mentions RTMP/WHIP streams but doesn't explain operational implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence and adds clarifying context in the second. Both sentences earn their place by explaining the action and its purpose, with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on success/failure responses, side effects, or integration with other tools like 'live_streaming_get_push_urls'. The context of live streaming is mentioned, but operational completeness is low.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema, such as format constraints or examples for 'bucket' or 'domain_type' beyond the default. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Bind') and resources involved ('push domain to a LiveStreaming bucket'), with a specific purpose for live streaming configuration. It distinguishes from sibling 'live_streaming_bind_play_domain' by specifying 'push' domain, though not explicitly contrasting them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'live_streaming_create_stream' or prerequisites. It mentions the outcome ('configure the domain for pushing RTMP/WHIP streams') but lacks explicit when/when-not instructions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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