> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Video-on-Demand MCP

## Overview

`vod_tools` (`from veadk.tools.builtin_tools.vod import vod_tools`) edits and processes video through the Volcengine Video-on-Demand MCP. See the [VOD MCP Server](https://github.com/volcengine/mcp-server/blob/main/server/mcp_server_vod/README_zh.md).

## Environment & prerequisites

<Warning>
  Requirements:

  1. Configure Volcengine AK / SK.
  2. (Optional) Choose capability groups via `TOOL_VOD_GROUPS`: `edit`, `intelligent_slicing`, `intelligent_matting`, `subtitle_processing`, `audio_processing`, `video_enhancement`, `upload`, `video_play`. Join multiple with commas; defaults to `edit,video_play`.
  3. (Optional) `TOOL_VOD_TIMEOUT`, the connection timeout, defaults to 10 seconds.
  4. The VOD tool cannot create a Space — create a [Video Cloud space](https://console.volcengine.com/vod/region:vod+cn-north-1/overview/) in the console first.
</Warning>

Environment variables:

* `VOLCENGINE_ACCESS_KEY`: Volcengine AccessKey
* `VOLCENGINE_SECRET_KEY`: Volcengine SecretKey
* `TOOL_VOD_GROUPS` (optional): capability groups
* `TOOL_VOD_TIMEOUT` (optional): connection timeout, defaults to 10.0 seconds

Or configure in `config.yaml`:

```yaml title="config.yaml" lines theme={null}
volcengine:
  access_key: your-access-key-here
  secret_key: your-secret-key-here
tool:
  vod:
    groups: edit,video_play
    timeout: 10.0
```

Install `uv`, verify `uvx --version`, and allow downloads of the VOD MCP server and dependencies. Replace the example URLs with valid service-accessible videos and the Space name with an existing Space. Configure the reasoning model as well.

## Usage

```python title="examples/tools/vod/agent.py" lines theme={null}
import asyncio

from veadk import Agent, Runner
from veadk.memory.short_term_memory import ShortTermMemory
from veadk.tools.builtin_tools.vod import vod_tools

agent = Agent(
    name="vod_agent",
    model_name="doubao-seed-2-1-pro-260628",
    description="A video editing assistant.",
    instruction="Use vod_tools to edit and process videos.",
    tools=[vod_tools],
)

runner = Runner(agent=agent, short_term_memory=ShortTermMemory())


async def main():
    response = await runner.run(
        "Merge these two videos: <your-url1>, <your-url2>, with space_name <your-space-name>"
    )
    print(response)


if __name__ == "__main__":
    asyncio.run(main())
```

## Notes

<Note>
  Some video-editing tasks take a while and return a `task_id` immediately. You can keep asking the agent whether the task is finished to retrieve the result.
</Note>

## Capability groups and configuration timing

| Group | Purpose |
| :- | :- |
| `edit` | Video editing |
| `intelligent_slicing` | Intelligent slicing |
| `intelligent_matting` | Intelligent matting |
| `subtitle_processing` | Subtitle processing |
| `audio_processing` | Audio processing |
| `video_enhancement` | Video enhancement |
| `upload` | Media uploads |
| `video_play` | Video playback |

Set `TOOL_VOD_GROUPS` and `TOOL_VOD_TIMEOUT` before importing `vod_tools`, or use the YAML configuration above; VeADK translates loaded configuration into environment variables. Restart the process after changes to rebuild the connection. The timeout controls MCP connection waiting, not completion of a video-processing job. The VOD MCP server supplies its own default capabilities when VeADK passes no groups.

This built-in connection launches the Volcengine VOD MCP server. Configuring BytePlus credentials does not establish BytePlus endpoint support; use MCP configuration matching the target video service. A `task_id` only confirms submission; query the task until success and obtain the result URL before treating it as complete.

## Verify the connection

```python lines theme={null}
import asyncio

from veadk.tools.builtin_tools.vod import vod_tools


async def main():
    try:
        tools = await vod_tools.get_tools()
        print([tool.name for tool in tools])
    finally:
        await vod_tools.close()


if __name__ == "__main__":
    asyncio.run(main())
```
