weread WebMCP
Browser tool configuration for weread
Tools (4)
weread_search_books()
Search books on WeRead using the public web API
Parameters
JavaScript Handler
(params) => {
const limit = Math.max(1, Math.min(20, Number(params.limit || 10)));
return fetch('https://weread.qq.com/web/search/global?keyword=' + encodeURIComponent(params.query), { credentials: 'include' })
.then((resp) => resp.ok ? resp.json() : Promise.reject(new Error('HTTP ' + resp.status)))
.then((data) => {
const books = (data.books || []).slice(0, limit).map((item, index) => ({
rank: index + 1,
title: item.bookInfo?.title || '',
author: item.bookInfo?.author || '',
bookId: item.bookInfo?.bookId || '',
cover: item.bookInfo?.cover || null,
url: item.bookInfo?.bookId ? 'https://weread.qq.com/web/bookDetail/' + item.bookInfo.bookId : null
}));
return { success: true, query: params.query, count: books.length, books };
})
.catch((error) => ({ success: false, message: error.message }));
}
weread_ranking()
Get WeRead ranking results for a category
Parameters
JavaScript Handler
(params) => {
const category = params.category || 'all';
const limit = Math.max(1, Math.min(20, Number(params.limit || 10)));
return fetch('https://weread.qq.com/web/bookListInCategory/' + encodeURIComponent(category) + '?rank=1', { credentials: 'include' })
.then((resp) => resp.ok ? resp.json() : Promise.reject(new Error('HTTP ' + resp.status)))
.then((data) => {
const books = (data.books || []).slice(0, limit).map((item, index) => ({
rank: index + 1,
title: item.bookInfo?.title || '',
author: item.bookInfo?.author || '',
category: item.bookInfo?.category || '',
readingCount: item.readingCount || 0,
bookId: item.bookInfo?.bookId || ''
}));
return { success: true, category, count: books.length, books };
})
.catch((error) => ({ success: false, message: error.message }));
}
weread_open_book()
Open a WeRead book detail page by book ID
Parameters
JavaScript Handler
(params) => {
window.location.href = 'https://weread.qq.com/web/bookDetail/' + params.bookId;
return { success: true, message: 'Opening WeRead book detail...', bookId: params.bookId };
}
weread_get_current_book()
Extract the current book title, author, and summary from a WeRead book page
Parameters
No parameters
JavaScript Handler
() => {
const title = document.querySelector('h1')?.textContent?.trim() || document.querySelector('[class*="title"]')?.textContent?.trim() || document.title;
const author = document.querySelector('[class*="author"]')?.textContent?.trim() || '';
const summary = document.querySelector('[class*="intro"], [class*="summary"], [class*="description"]')?.textContent?.replace(/\s+/g, ' ').trim() || '';
const cover = document.querySelector('img')?.src || null;
return {
success: true,
book: {
title,
author,
summary,
cover,
url: window.location.href
}
};
}
🔌 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.weread.com/...