bing WebMCP
Browser tool configuration for bing
URL Pattern: ^https?://(www\.)?bing\.com(/.*)?$
Allowed Extra Domains: bing.com
Tools (1)
bing_search()
Bing ๆ็ดข
Parameters
query
string
required
- Search query
count
string
- Number of results (default 10)
JavaScript Handler
(params) => {
const run = async function(args) {
const query = args.query;
if (!query) return {error: 'query is required'};
const count = args.count || 10;
const url = 'https://www.bing.com/search?q=' + encodeURIComponent(query) + '&count=' + count;
const resp = await fetch(url, {credentials: 'include'});
if (!resp.ok) return {error: 'HTTP ' + resp.status};
const html = await resp.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, 'text/html');
const items = doc.querySelectorAll('li.b_algo');
const results = [];
items.forEach(li => {
const anchor = li.querySelector('h2 > a');
if (!anchor) return;
const title = anchor.textContent.trim();
const href = anchor.getAttribute('href') || '';
const snippet = (li.querySelector('p') || {}).textContent || '';
results.push({title, url: href, snippet: snippet.trim()});
});
return {query, count: results.length, results};
};
return run(params || {});
}
๐ 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.bing.com/...