WORLDBOOK

Worldbooks | WebMCP | Search | Submit WebMCP

hupu WebMCP

Browser tool configuration for hupu

URL Pattern: ^https?://bbs\.hupu\.com(/.*)?$
Allowed Extra Domains: bbs.hupu.com

Tools (1)

hupu_hot()

虎扑步行街热帖

Parameters

No parameters

JavaScript Handler

(params) => {
  const run = async function(args) {

      const resp = await fetch('https://bbs.hupu.com/all-gambia');
      if (!resp.ok) return {error: 'HTTP ' + resp.status};
      const html = await resp.text();
      const doc = new DOMParser().parseFromString(html, 'text/html');
      const items = [...doc.querySelectorAll('.list-item-wrap')].map((wrap, i) => {
        const link = wrap.querySelector('.t-info > a');
        const titleEl = wrap.querySelector('.t-title');
        const lightsEl = wrap.querySelector('.t-lights');
        const repliesEl = wrap.querySelector('.t-replies');
        const labelEl = wrap.querySelector('.t-label a');
        if (!link || !titleEl) return null;
        const href = link.getAttribute('href') || '';
        const tid = href.replace(/\D/g, '');
        const lights = parseInt((lightsEl?.textContent || '').replace(/\D/g, '')) || 0;
        const replies = parseInt((repliesEl?.textContent || '').replace(/\D/g, '')) || 0;
        const isHot = (link.className || '').includes('hot');
        return {
          rank: i + 1,
          tid,
          title: titleEl.textContent.trim(),
          url: 'https://bbs.hupu.com' + href,
          lights,
          replies,
          isHot,
          forum: labelEl?.textContent.trim() || ''
        };
      }).filter(Boolean);
      return {count: items.length, items};
  };
  return run(params || {});
}

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

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