qsw-mcp

qsw-mcp

Smart Doc MCP Server that enables AI agents to read web pages (with or without browser, supporting login and SPA) and perform OCR on clipboard images.

Category
Visit Server

README

qsw-mcp

Smart Doc MCP Server - 为 AI Agent 提供统一的文档读取能力

功能特性

  • read_url: 读取网页内容,返回标题、纯文本和 Markdown 格式(无登录状态)
  • read_url_browser: 使用浏览器读取网页(支持登录状态、Cookie、SPA 页面)
  • read_clipboard_image: 从系统剪贴板读取图片并识别文字(OCR),支持中英文等多种语言

安装

npm install
npm run build

Playwright 浏览器安装(read_url_browser 需要)

npx playwright install chromium

使用方法

在 Claude Desktop 中配置

编辑 Claude Desktop 配置文件:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

添加以下配置:

{
  "mcpServers": {
    "qsw-mcp": {
      "command": "node",
      "args": ["path/to/qswMCP/dist/index.js"]
    }
  }
}

在 VSCode Agent 中配置

.vscode/settings.json 中添加:

{
  "claude.mcpServers": {
    "qsw-mcp": {
      "command": "node",
      "args": ["path/to/qswMCP/dist/index.js"]
    }
  }
}

工具说明

read_url

读取网页内容(无登录状态)。

输入参数

  • url (string): 要读取的网页 URL

输出示例

{
  "success": true,
  "data": {
    "title": "网页标题",
    "content": "网页纯文本内容...",
    "markdown": "# 网页标题\n\n网页 Markdown 内容...",
    "url": "https://example.com",
    "length": 1234
  }
}

read_url_browser

使用浏览器读取网页,支持登录状态、Cookie 和 SPA 页面。

输入参数

  • url (string): 要读取的网页 URL
  • waitFor (number, 可选): 等待页面加载的时间(毫秒),默认 2000ms
  • useExisting (boolean, 可选): 是否连接已打开的 Chrome(需要 Chrome 调试模式),默认使用新浏览器

输出示例

{
  "success": true,
  "data": {
    "title": "网页标题",
    "content": "网页纯文本内容...",
    "markdown": "# 网页标题\n\n网页 Markdown 内容...",
    "url": "https://example.com/final",
    "originalUrl": "https://example.com",
    "length": 1234,
    "mode": "browser"
  }
}

连接已有 Chrome 浏览器

# 以调试模式启动 Chrome
chrome.exe --remote-debugging-port=9222

read_clipboard_image

从系统剪贴板读取图片并进行 OCR 文字识别。

输入参数

  • language (string, 可选): 识别语言,默认 chi_sim+eng
    • chi_sim: 简体中文
    • chi_tra: 繁体中文
    • eng: 英文
    • jpn: 日文
    • kor: 韩文
    • chi_sim+eng: 简体中文+英文
    • chi_tra+eng: 繁体中文+英文
  • preprocess (boolean, 可选): 是否预处理图片(提高识别准确率),默认开启

输出示例

{
  "success": true,
  "data": {
    "text": "识别出的文字内容...",
    "confidence": 95.5,
    "statistics": {
      "characters": 123,
      "words": 45,
      "lines": 10,
      "blocks": 5
    },
    "language": "chi_sim+eng",
    "preprocess": "已预处理(灰度、对比度标准化、锐化)",
    "blocks": [...],
    "source": "clipboard",
    "savedPath": "clipboard/clipboard_2026-05-31T00-52-00.png"
  }
}

使用步骤

  1. 复制图片(右键 → 复制图片,或 Win+Shift+S 截图)
  2. 调用此工具进行 OCR 识别

开发

# 开发模式运行
npm run dev

# 编译
npm run build

# 监听模式
npm run watch

技术栈

  • TypeScript
  • MCP SDK (@modelcontextprotocol/sdk)
  • axios
  • cheerio
  • turndown
  • playwright
  • sharp
  • tesseract.js
  • zod

许可证

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured