wechat WebMCP
Browser tool configuration for wechat
Tools (3)
insert_article()
Insert content into WeChat Official Account article editor (must be on editor page with action=edit)
Parameters
JavaScript Handler
(params) => {
// Set title if provided
if (params.title) {
const titleInput = document.querySelector('#title') || document.querySelector('[placeholder*="标题"]');
if (titleInput) {
titleInput.value = params.title;
titleInput.dispatchEvent(new Event('input', { bubbles: true }));
}
}
// Find editor (ProseMirror or UEditor)
const editor = document.querySelector('.ProseMirror') || document.querySelector('.edui-body-container');
if (!editor) {
return { success: false, message: 'Editor not found. Make sure you are on the article edit page (URL contains action=edit)' };
}
// Insert content
editor.focus();
editor.innerHTML = params.content;
editor.dispatchEvent(new Event('input', { bubbles: true }));
return { success: true, message: 'Content inserted into WeChat editor' };
}
navigate_to_draft()
Navigate from WeChat home to draft page
Parameters
No parameters
JavaScript Handler
() => {
// Click 内容管理 menu
const contentMgmt = document.querySelector('[title="内容管理"]');
if (contentMgmt) {
contentMgmt.click();
setTimeout(() => {
const draftLink = Array.from(document.querySelectorAll('a')).find(a => a.textContent.includes('草稿箱'));
if (draftLink) draftLink.click();
}, 800);
return { success: true, message: 'Navigating to draft page...' };
}
return { success: false, message: 'Content management menu not found' };
}
create_new_article()
Click to create new article from draft page
Parameters
No parameters
JavaScript Handler
() => {
const newCreateCard = document.querySelector('.weui-desktop-card_new');
if (newCreateCard) {
newCreateCard.click();
setTimeout(() => {
const writeLink = document.querySelector('li[data-type="0"] a');
if (writeLink) {
writeLink.click();
}
}, 500);
return { success: true, message: 'Opening new article editor...' };
}
return { success: false, message: 'New creation card not found' };
}
🔌 Chrome MCP Server Extension
Use these tools with Claude, ChatGPT, and other AI assistants.
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.wechat.com/...