WORLDBOOK

Worldbooks | WebMCP | Search | Submit WebMCP

weread WebMCP

Browser tool configuration for weread

URL Pattern: ^https?://(www\.)?weread\.qq\.com(/.*)?$

Tools (4)

weread_search_books()

Search books on WeRead using the public web API

Parameters

query string required - Search keywords
limit number - Maximum results to return (default 10)

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

category string - Ranking category, such as all, rising, or a numeric category ID
limit number - Maximum results to return (default 10)

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

bookId string required - Book ID returned by weread_search_books

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
    }
  };
}

WebMCP clients

Use mcp-chrome, or fetch the same tools from the public API in your own browser automation runtime.

Get Extension →

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/...

Third-party clients can use the same endpoint as mcp-chrome. Execute the returned JavaScript handler in your own browser page context.