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

@funfe-dev/web-search-mcp

v1.0.0

Published

一个基于MCP的网络搜索服务,支持在Cursor等IDE中使用

Readme

MCP网络搜索服务

这是一个基于Model Context Protocol (MCP)的服务,允许AI助手通过搜索引擎查询实时信息。该服务主要在Cursor等IDE中使用,为LLM模型提供联网能力。

功能特点

  • 支持网络搜索功能,获取最新信息
  • 支持网页内容抓取,提取网页主要文本
  • 使用标准输入/输出作为传输方式,适合在IDE环境中使用
  • 完全符合MCP协议标准

安装

# 安装依赖
npm install

# 构建项目
npm run build

使用方法

# 启动服务
npm start

在Cursor等支持MCP的环境中,可以直接调用以下工具:

  1. web_search - 进行网络搜索

    • 参数:
      • query: 要搜索的关键词
      • limit: 可选,返回结果数量
  2. fetch_webpage - 抓取网页内容

    • 参数:
      • url: 要抓取的网页URL

在Cursor中配置

要在Cursor中使用此MCP服务,请按照以下步骤操作:

方法一:通过UI配置(简单但不推荐)

  1. 打开Cursor
  2. 进入 设置 > 功能 > MCP
  3. 点击 + 添加新MCP服务器
  4. 填写表单:
    • 名称:网络搜索MCP
    • 类型:选择 command
    • 命令:输入 node /完整路径/到你的项目/dist/index.js 例如:node /Users/username/mcp/dist/index.js
  5. 点击 添加 保存配置

方法二:通过配置文件(推荐)

项目级配置

在你的项目目录中创建 .cursor/mcp.json 文件:

{
  "mcpServers": {
    "网络搜索MCP": {
      "command": "node",
      "args": ["完整路径/到你的项目/dist/index.js"],
      "env": {}
    }
  }
}

全局配置

在你的用户目录中创建 ~/.cursor/mcp.json 文件:

{
  "mcpServers": {
    "网络搜索MCP": {
      "command": "node",
      "args": ["完整路径/到你的项目/dist/index.js"],
      "env": {}
    }
  }
}

在Cursor中使用 @Web

配置好MCP服务后,在Cursor中使用@Web进行Web搜索的方法:

  1. 在Cursor的聊天或编辑器中,输入 @Web 后跟随你的搜索查询

    例如:@Web 最新的React框架特性

  2. Cursor会自动调用此MCP服务进行网络搜索,并返回结果

  3. 也可以在提问中添加 @Web 标记来提示AI助手使用网络搜索功能

    例如:请告诉我最新的Node.js版本特性 @Web

  4. 对于更复杂的场景,可以明确要求AI使用web_search工具:

    例如:请使用web_search工具搜索"2025年前端开发趋势"

  5. 如需抓取特定网页内容,可以明确要求AI使用fetch_webpage工具:

    例如:请使用fetch_webpage工具抓取"https://example.com"的内容

开发

# 开发模式(编译并运行)
npm run dev

技术栈

  • TypeScript
  • Model Context Protocol (MCP) SDK
  • node-fetch (用于网络请求)
  • cheerio (用于HTML解析)
  • zod (用于参数验证)

协议

ISC