xiaohongshu WebMCP
Browser tool configuration for xiaohongshu
Tools (2)
insert_note()
Insert content into Xiaohongshu note editor (must upload images first on creator.xiaohongshu.com/publish/publish)
Parameters
JavaScript Handler
(params) => {
// Set title
if (params.title) {
const titleInput = document.querySelector('#titleBox') || document.querySelector('#title') || document.querySelector('[placeholder*="标题"]');
if (titleInput) {
titleInput.value = params.title;
titleInput.dispatchEvent(new Event('input', { bubbles: true }));
}
}
// Find content editor
const editor = document.querySelector('#descBox') || document.querySelector('#post-textarea') || document.querySelector('.c-input_inner') || document.querySelector('[contenteditable="true"]');
if (!editor) {
return { success: false, message: 'Editor not found. Please upload images first, then the content editor will appear.' };
}
if (editor.tagName === 'TEXTAREA' || editor.tagName === 'INPUT') {
editor.value = params.content;
} else {
editor.textContent = params.content;
}
editor.dispatchEvent(new Event('input', { bubbles: true }));
editor.focus();
return { success: true, message: 'Content inserted into Xiaohongshu editor' };
}
open_publish_page()
Navigate to Xiaohongshu publish page
Parameters
No parameters
JavaScript Handler
() => {
window.location.href = 'https://creator.xiaohongshu.com/publish/publish';
return { success: true, message: 'Opening Xiaohongshu publish page...' };
}
WebMCP clients
Use mcp-chrome, or fetch the same tools from the public API in your own browser automation runtime.
How to Use WebMCP
WebMCP tools are designed for browser extensions or automation frameworks. The browser extension matches the current URL against the pattern and executes the JavaScript handler when the tool is invoked.
API Endpoint:
GET /api/webmcp/match?url=https://www.xiaohongshu.com/...
Third-party clients can use the same endpoint as mcp-chrome. Execute the returned JavaScript handler in your own browser page context.