npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jiayouzuo/mcp-web-search

v0.1.1

Published

MCP Server for web search and content fetching

Downloads

27

Readme

@jiayouzuo/mcp-web-search

MCP Server for web search and content fetching - 网络搜索与内容抓取的 MCP 服务器

功能特性

  • 🔍 网络搜索:使用 DuckDuckGo 搜索引擎(免费,无需 API Key)
  • 📄 内容抓取:获取网页内容并智能提取主体文本
  • 🔗 链接提取:从网页中提取所有链接
  • 💾 智能缓存:15 分钟缓存减少重复请求
  • 🎯 内容解析:使用 Readability 算法提取核心内容

安装

全局安装(推荐)

npm install -g @jiayouzuo/mcp-web-search

本地安装

npm install @jiayouzuo/mcp-web-search

配置

在 Claude Code 配置文件中添加:

位置: ~/.claude/config.json~/.config/claude/config.json

{
  "mcpServers": {
    "web-search": {
      "command": "mcp-web-search"
    }
  }
}

或使用 npx:

{
  "mcpServers": {
    "web-search": {
      "command": "npx",
      "args": ["@jiayouzuo/mcp-web-search"]
    }
  }
}

可用工具

1. web_search

搜索网络内容

参数:

  • query (string, 必需): 搜索关键词
  • maxResults (number, 可选): 最多返回结果数,默认 5
  • language (string, 可选): 语言偏好,默认 zh-cn

示例:

{
  "query": "Vue 3 最新特性",
  "maxResults": 5,
  "language": "zh-cn"
}

2. fetch_url

获取 URL 内容并提取主体文本

参数:

  • url (string, 必需): 要获取的 URL
  • extractContent (boolean, 可选): 是否提取主体内容,默认 true
  • format (string, 可选): 返回格式 (text/markdown/html),默认 text

示例:

{
  "url": "https://example.com/article",
  "extractContent": true,
  "format": "markdown"
}

3. extract_links

从 URL 提取所有链接

参数:

  • url (string, 必需): 要提取链接的 URL
  • filter (string, 可选): 正则表达式过滤器

示例:

{
  "url": "https://example.com",
  "filter": "^https://example\\.com/docs"
}

开发

本地开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

# 监听模式
npm run watch

项目结构

mcp-web-search/
├── src/
│   ├── index.ts           # MCP Server 入口
│   ├── tools/             # 工具实现
│   │   ├── search.ts      # web_search
│   │   ├── fetch.ts       # fetch_url
│   │   └── links.ts       # extract_links
│   ├── services/          # 核心服务
│   │   ├── http.ts        # HTTP 客户端
│   │   ├── parser.ts      # HTML 解析
│   │   └── search.ts      # 搜索服务
│   └── types/             # 类型定义
│       └── index.ts
├── build/                 # 编译输出
├── package.json
└── tsconfig.json

技术栈

  • TypeScript: 类型安全
  • @modelcontextprotocol/sdk: MCP 官方 SDK
  • axios: HTTP 客户端
  • cheerio: HTML 解析
  • @mozilla/readability: 内容提取
  • jsdom: DOM 模拟
  • node-cache: 内存缓存

许可证

MIT

作者

jiayouzuo