devto WebMCP
Browser tool configuration for devto
Tools (4)
devto_search()
Search Dev.to articles by keyword
Parameters
JavaScript Handler
(params) => {
const run = async function(args) {
const query = args.query;
if (!query) return { error: 'query is required' };
const count = Math.min(args.count || 10, 100);
const url = 'https://dev.to/search/feed_content?per_page=' + count +
'&page=0&search_fields=' + encodeURIComponent(query) + '&class_name=Article';
const resp = await fetch(url);
if (!resp.ok) return { error: 'HTTP ' + resp.status };
const data = await resp.json();
const articles = data.result || [];
return {
query: query,
count: articles.length,
articles: articles.map(a => ({
title: a.title,
url: a.path ? ('https://dev.to' + a.path) : null,
description: (a.cloudinary_video_url ? '[video] ' : '') +
(a.body_text || '').substring(0, 300),
author: a.user ? a.user.name : null,
username: a.user ? a.user.username : null,
published_at: a.published_at_int ? new Date(a.published_at_int * 1000).toISOString() : null,
reactions: a.public_reactions_count || 0,
comments: a.comments_count || 0,
tags: a.tag_list || [],
reading_time: a.reading_time || null
}))
};
};
return run(params || {});
}
devto_tag()
Latest DEV.to articles for a specific tag
Parameters
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
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
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.
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/...