/**
* Test script for video publishing functionality
* This script demonstrates how to use the new xhs_publish_video tool
*/
const { spawn } = require('child_process');
// Test video publishing
async function testVideoPublish() {
console.log('Testing video publishing functionality...\n');
// Example video publish request
const videoPublishRequest = {
jsonrpc: '2.0',
id: 1,
method: 'tools/call',
params: {
name: 'xhs_publish_video',
arguments: {
title: '测试视频标题',
content: '这是一个测试视频的描述内容',
video_path: 'examples/test_video.mp4', // You would need to provide a real video file
tags: '测试,视频,自动化',
browser_path: undefined // Use default browser
}
}
};
console.log('Video Publish Request:');
console.log(JSON.stringify(videoPublishRequest, null, 2));
console.log('\nNote: This is a demonstration. You need to:');
console.log('1. Provide a real video file at the specified path');
console.log('2. Ensure you are logged in to XiaoHongShu');
console.log('3. Run the MCP server to test the actual functionality');
}
// Example of how to call the tool via MCP
async function callVideoPublishTool() {
console.log('\nTo test the video publishing tool, you can:');
console.log('1. Start the MCP server: npm run dev:mcp:stdio');
console.log('2. Send the request above to the server');
console.log('3. Or use the CLI: npx xhs-cli mcp');
}
testVideoPublish();
callVideoPublishTool();