](https://mseep.ai/app/pinkpixel-dev-prysm-mcp-server)
🔍 普睿司曼MCP服务器
Prysm MCP(模型上下文协议)服务器使克劳德和其他人工智能助手能够以高精度和灵活性抓取网络内容。
✨ 特性
- 🎯 多种刮擦模式:从聚焦(速度)、平衡(默认)或深度(彻底)模式中选择
- 🧠 内容分析:分析URL以确定最佳抓取方法
- 📄 格式灵活性:将结果格式化为markdown、HTML或JSON
- 🖼️ 图像支持:可选择提取甚至下载图像
- 🔍 智能滚动:配置单页应用程序的滚动行为
- 📱 响应式:适应不同的网站布局和结构
- 💾 文件输出:将格式化结果保存到首选目录
🚀 快速开始
安装
# Recommended: Install the LLM-optimized version
npm install -g @pinkpixel/prysm-mcp
# Or install the standard version
npm install -g prysm-mcp
# Or clone and build
git clone https://github.com/pinkpixel-dev/prysm-mcp.git
cd prysm-mcp
npm install
npm run build集成指南
我们为流行的MCP兼容应用程序提供详细的集成指南:
用法
有多种方法可以设置普睿司曼MCP服务器:
使用mcp.json配置
创建一个 mcp.json 根据上述指南将文件放在适当的位置。
{
"mcpServers": {
"prysm-scraper": {
"description": "Prysm web scraper with custom output directories",
"command": "npx",
"args": [
"-y",
"@pinkpixel/prysm-mcp"
],
"env": {
"PRYSM_OUTPUT_DIR": "${workspaceFolder}/scrape_results",
"PRYSM_IMAGE_OUTPUT_DIR": "${workspaceFolder}/scrape_results/images"
}
}
}
}🛠️ 工具
服务器提供以下工具:
scrapeFocused
快速网页抓取,针对速度进行了优化(滚动次数少,仅限主要内容)。
Please scrape https://example.com using the focused mode可用参数:
url(必填):要抓取的URLmaxScrolls(可选):滚动尝试的最大次数(默认值:5)scrollDelay(可选):滚动之间的延迟(毫秒)(默认值:1000)scrapeImages(可选):是否在结果中包含图像downloadImages(可选):是否在本地下载图像maxImages(可选):要提取的最大图像数output(可选):下载图像的输出目录
scrapeBalanced
平衡的网络抓取方法,覆盖率高,速度合理。
Please scrape https://example.com using the balanced mode可用参数:
- 同
scrapeFocused具有不同的默认值 maxScrolls默认值:10scrollDelay默认值:2000- 增加
timeout限制总抓取时间的参数(默认值:30000ms)
scrapeDeep
最大程度的提取网络抓取(较慢但彻底)。
Please scrape https://example.com using the deep mode with maximum scrolls可用参数:
- 同
scrapeFocused具有不同的默认值 maxScrolls默认值:20scrollDelay默认值:3000maxImages默认值:100
formatResult
格式将数据刮成不同的结构化格式(markdown、HTML、JSON)。
Format the scraped data as markdown可用参数:
data(必填):将抓取的数据格式化format(必填):输出格式-“markdown”、“html”或“json”includeImages(可选):是否在输出中包含图像(默认值:true)output(可选):保存格式化结果的文件路径
您还可以通过指定输出路径将格式化结果保存到文件中:
Format the scraped data as markdown and save it to "my-results/output.md"⚙️ 配置
输出目录
默认情况下,保存格式化结果时,文件将保存到 ~/prysm-mcp/output/。您可以通过两种方式进行自定义:
- 环境变量:将环境变量设置到首选目录:
# Linux/macOS
export PRYSM_OUTPUT_DIR="/path/to/custom/directory"
export PRYSM_IMAGE_OUTPUT_DIR="/path/to/custom/image/directory"
# Windows (Command Prompt)
set PRYSM_OUTPUT_DIR=C:\path\to\custom\directory
set PRYSM_IMAGE_OUTPUT_DIR=C:\path\to\custom\image\directory
# Windows (PowerShell)
$env:PRYSM_OUTPUT_DIR="C:\path\to\custom\directory"
$env:PRYSM_IMAGE_OUTPUT_DIR="C:\path\to\custom\image\directory"- 刀具参数:调用工具时直接指定输出路径:
# For general results
Format the scraped data as markdown and save it to "/absolute/path/to/file.md"
# For image downloads when scraping
Please scrape https://example.com and download images to "/absolute/path/to/images"- MCP配置:在MCP配置文件中(例如。,
.cursor/mcp.json),您可以设置这些环境变量:
{
"mcpServers": {
"prysm-scraper": {
"command": "npx",
"args": ["-y", "@pinkpixel/prysm-mcp"],
"env": {
"PRYSM_OUTPUT_DIR": "${workspaceFolder}/scrape_results",
"PRYSM_IMAGE_OUTPUT_DIR": "${workspaceFolder}/scrape_results/images"
}
}
}
}如果 PRYSM_IMAGE_OUTPUT_DIR 如果未指定,它将默认为名为的子文件夹 images 里面 PRYSM_OUTPUT_DIR.
如果只提供相对路径或文件名,则它将相对于配置的输出目录进行保存。
路径处理规则
这 formatResult 工具以以下方式处理路径:
- 绝对路径:完全按照规定使用(
/home/user/file.md) - 相对路径:相对于配置的输出目录保存(
subfolder/file.md) - 仅限文件名:保存在配置的输出目录中(
output.md) - 目录路径:如果路径指向目录,则会根据内容和时间戳自动生成文件名
🏗️ 发展
# Install dependencies
npm install
# Build the project
npm run build
# Run the server locally
node bin/prysm-mcp
# Debug MCP communication
DEBUG=mcp:* node bin/prysm-mcp
# Set custom output directories
PRYSM_OUTPUT_DIR=./my-output PRYSM_IMAGE_OUTPUT_DIR=./my-output/images node bin/prysm-mcp通过npx运行
您可以直接使用npx运行服务器,而无需安装:
# Run with default settings
npx @pinkpixel/prysm-mcp
# Run with custom output directories
PRYSM_OUTPUT_DIR=./my-output PRYSM_IMAGE_OUTPUT_DIR=./my-output/images npx @pinkpixel/prysm-mcp📋 许可证
麻省理工学院
🙏 鸣谢
由开发 粉红色像素
