MCP ExplorerExplorer

Web Mcp

@zgagnonon a year ago
1 MIT
FreeCommunity
AI Systems
a try at writing an mcp server. might replace one of my emacs tools

Overview

What is Web Mcp

web-mcp is a simple MCP (Model Context Protocol) server designed to transform text to uppercase. It serves as an experimental project that may replace some Emacs tools.

Use cases

Use cases for web-mcp include transforming user input in real-time applications, providing text formatting services in editors, and integrating with other tools that require uppercase text conversion.

How to use

To use web-mcp, install the dependencies using ‘npm install’, then run the server in development mode with ‘npm run dev’ or build for production with ‘npm run build’ followed by ‘npm start’. Clients can invoke the ‘toUppercase’ capability to convert text to uppercase.

Key features

The key feature of web-mcp is the ‘toUppercase’ capability, which converts any given text input into uppercase letters.

Where to use

web-mcp can be used in applications that require text transformation, such as text editors, chat applications, and any software that processes user input.

Content

Web MCP Server

A Model Context Protocol (MCP) server that provides web search and content retrieval capabilities for AI assistants.

Features

The server offers two primary tools:

  • search_duckduckgo: Performs web searches using DuckDuckGo and returns URLs of the search results
  • read_url: Fetches and processes content from URLs, removing HTML markup for better readability

Setup

# Install dependencies
npm install

# Development (with auto-reload)
npm run dev

# Production build
npm run build
npm start

Running locally

use

npx https://zgagnon.com/webmcp

or

nix run github:zgagnon.com/webmcp

API

search_duckduckgo

Performs a web search using DuckDuckGo and returns only the URLs of the search results.

Input:

  • query (string, required): The search query to be executed
  • limit (number, optional): Maximum number of results to return (default: 10)

Output:

  • A list of URLs matching the search query

read_url

Fetches and returns the text content of a specified URL, with HTML markup removed. Uses Mozilla’s Readability to extract meaningful content.

Input:

  • url (string, required): The URL to fetch content from
  • useReadabilityMode (boolean, optional): Whether to use Mozilla’s Readability to extract the main content (default: true)
  • maxLength (number, optional): Maximum length of returned content in characters (default: 10000)

Output:

  • The plain text content from the URL, potentially truncated to fit within context windows

Error Handling

The server will return an error if:

  • Invalid arguments are provided to any tool
  • URL fetching fails
  • Search execution fails

Implementation Details

The server uses:

  • JSDOM and Mozilla’s Readability for HTML processing and content extraction
  • Node-fetch for HTTP requests
  • Zod for schema validation

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers