WORLDBOOK

Worldbooks | WebMCP | Search | Submit WebMCP

devto WebMCP

Browser tool configuration for devto

URL Pattern: ^https?://dev\.to(/.*)?$
Allowed Extra Domains: dev.to, example.com

Tools (4)

devto_search()

Search Dev.to articles by keyword

Parameters

query string required - Search keyword or phrase
count number - Number of results (max 100)

JavaScript Handler

devto_tag()

Latest DEV.to articles for a specific tag

Parameters

tag string required - Tag name (e.g. javascript, python, webdev)
limit number - Number of articles

JavaScript Handler

(params) => {
  const args = Object.assign({"limit": 20}, params || {});
  let data = null;
  let __wbContextUrl = globalThis.location?.href || '';
  let __wbContextDocument = globalThis.document || null;
    const __wbDefault = (value, fallback) => (value === undefined || value === null || value === '' ? fallback : value);
    const __wbJoin = (value, separator) => Array.isArray(value) ? value.join(separator) : (value ?? '');
    const __wbGet = (value, path) => {
      if (!path) return value;
      return String(path).split('.').reduce((acc, part) => (acc == null ? undefined : acc[part]), value);
    };
    const __wbBaseUrl = () => (__wbContextUrl || globalThis.location?.href || 'https://example.com/');
    const __wbResolve = (target, base) => {
      if (target == null) return '';
      const text = String(target);
      try {
        return /^https?:/i.test(text) ? text : new URL(text, base || __wbBaseUrl()).toString();
      } catch (_error) {
        return text;
      }
    };
    const __wbFetch = async (target, options) => {
      const url = __wbResolve(target, __wbBaseUrl());
      const resp = await globalThis.fetch(url, Object.assign({ credentials: 'include' }, options || {}));
      if (!resp.ok) {
        throw new Error(`HTTP ${resp.status} for ${url}`);
      }
      const text = await resp.text();
      try {
        return { url, text, data: JSON.parse(text) };
      } catch (_error) {
        return { url, text, data: text };
      }
    };
  return (async () => {
    {
      const __wbResp = await __wbFetch(`https://dev.to/api/articles?tag=${args.tag}&per_page=${args.limit}`);
      data = __wbResp.data;
    }
    {
      const source = Array.isArray(data) ? data : (data == null ? [] : [data]);
      data = source.map((item, index) => ({
        "rank": index + 1,
        "title": item.title,
        "author": item.user.username,
        "reactions": item.public_reactions_count,
        "comments": item.comments_count,
        "tags": __wbJoin((item.tag_list), ', '),
        "url": item.url,
      }));
    }
    if (Array.isArray(data)) data = data.slice(0, Number(args.limit) || 0);
    return data;
  })();
}

devto_top()

Top DEV.to articles of the day

Parameters

limit number - Number of articles

JavaScript Handler

(params) => {
  const args = Object.assign({"limit": 20}, params || {});
  let data = null;
  let __wbContextUrl = globalThis.location?.href || '';
  let __wbContextDocument = globalThis.document || null;
    const __wbDefault = (value, fallback) => (value === undefined || value === null || value === '' ? fallback : value);
    const __wbJoin = (value, separator) => Array.isArray(value) ? value.join(separator) : (value ?? '');
    const __wbGet = (value, path) => {
      if (!path) return value;
      return String(path).split('.').reduce((acc, part) => (acc == null ? undefined : acc[part]), value);
    };
    const __wbBaseUrl = () => (__wbContextUrl || globalThis.location?.href || 'https://example.com/');
    const __wbResolve = (target, base) => {
      if (target == null) return '';
      const text = String(target);
      try {
        return /^https?:/i.test(text) ? text : new URL(text, base || __wbBaseUrl()).toString();
      } catch (_error) {
        return text;
      }
    };
    const __wbFetch = async (target, options) => {
      const url = __wbResolve(target, __wbBaseUrl());
      const resp = await globalThis.fetch(url, Object.assign({ credentials: 'include' }, options || {}));
      if (!resp.ok) {
        throw new Error(`HTTP ${resp.status} for ${url}`);
      }
      const text = await resp.text();
      try {
        return { url, text, data: JSON.parse(text) };
      } catch (_error) {
        return { url, text, data: text };
      }
    };
  return (async () => {
    {
      const __wbResp = await __wbFetch(`https://dev.to/api/articles?top=1&per_page=${args.limit}`);
      data = __wbResp.data;
    }
    {
      const source = Array.isArray(data) ? data : (data == null ? [] : [data]);
      data = source.map((item, index) => ({
        "rank": index + 1,
        "title": item.title,
        "author": item.user.username,
        "reactions": item.public_reactions_count,
        "comments": item.comments_count,
        "tags": __wbJoin((item.tag_list), ', '),
        "url": item.url,
      }));
    }
    if (Array.isArray(data)) data = data.slice(0, Number(args.limit) || 0);
    return data;
  })();
}

devto_user()

Recent DEV.to articles from a specific user

Parameters

username string required - DEV.to username (e.g. ben, thepracticaldev)
limit number - Number of articles

JavaScript Handler

(params) => {
  const args = Object.assign({"limit": 20}, params || {});
  let data = null;
  let __wbContextUrl = globalThis.location?.href || '';
  let __wbContextDocument = globalThis.document || null;
    const __wbDefault = (value, fallback) => (value === undefined || value === null || value === '' ? fallback : value);
    const __wbJoin = (value, separator) => Array.isArray(value) ? value.join(separator) : (value ?? '');
    const __wbGet = (value, path) => {
      if (!path) return value;
      return String(path).split('.').reduce((acc, part) => (acc == null ? undefined : acc[part]), value);
    };
    const __wbBaseUrl = () => (__wbContextUrl || globalThis.location?.href || 'https://example.com/');
    const __wbResolve = (target, base) => {
      if (target == null) return '';
      const text = String(target);
      try {
        return /^https?:/i.test(text) ? text : new URL(text, base || __wbBaseUrl()).toString();
      } catch (_error) {
        return text;
      }
    };
    const __wbFetch = async (target, options) => {
      const url = __wbResolve(target, __wbBaseUrl());
      const resp = await globalThis.fetch(url, Object.assign({ credentials: 'include' }, options || {}));
      if (!resp.ok) {
        throw new Error(`HTTP ${resp.status} for ${url}`);
      }
      const text = await resp.text();
      try {
        return { url, text, data: JSON.parse(text) };
      } catch (_error) {
        return { url, text, data: text };
      }
    };
  return (async () => {
    {
      const __wbResp = await __wbFetch(`https://dev.to/api/articles?username=${args.username}&per_page=${args.limit}`);
      data = __wbResp.data;
    }
    {
      const source = Array.isArray(data) ? data : (data == null ? [] : [data]);
      data = source.map((item, index) => ({
        "rank": index + 1,
        "title": item.title,
        "reactions": item.public_reactions_count,
        "comments": item.comments_count,
        "tags": __wbJoin((item.tag_list), ', '),
        "url": item.url,
      }));
    }
    if (Array.isArray(data)) data = data.slice(0, Number(args.limit) || 0);
    return data;
  })();
}

🔌 Chrome MCP Server Extension

Use these tools with Claude, ChatGPT, and other AI assistants.

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