关于 PulpMiner
PulpMiner MCP Server 将网页内容转换为 JSON,并可将提取设置保存为可复用的 REST API,面向使用 MCP 客户端的 AI 助手。它还支持调用和列出已保存的 API。
主要功能
- 01将网页转换为 JSON
- 02按指定格式生成 JSON
- 03保存可复用的 REST API
- 04调用并列出已保存 API
- 05检查 API 密钥
适用场景
- 01从网页提取结构化数据
- 02将页面提取流程保存为 API
- 03用动态 URL 变量查询已保存 API
- 04检查 PulpMiner 凭据配置
MCP 相关
向 MCP 客户端提供网页转 JSON、保存 API、获取 API 数据、列出 API 和验证密钥等工具;支持 stdio 和 Streamable HTTP。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://mcp.pulpminer.com/mcpclaude mcp add --transport http pulpminercom-pulpminer https://mcp.pulpminer.com/mcp{"mcpServers":{"pulpminercom-pulpminer":{"type":"http","url":"https://mcp.pulpminer.com/mcp"}}}在 Cursor 中打开{"servers":{"pulpminercom-pulpminer":{"type":"http","url":"https://mcp.pulpminer.com/mcp"}}}在 VS Code 中打开{"mcpServers":{"pulpminercom-pulpminer":{"type":"http","url":"https://mcp.pulpminer.com/mcp"}}}{"mcpServers":{"pulpminercom-pulpminer":{"serverUrl":"https://mcp.pulpminer.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://mcp.pulpminer.com/mcp需要授权工具
5| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| llm | enum | 否 | 用于将 HTML 转换为 JSON 的 LLM。llm_2 = OpenAI GPT(默认),llm_1 = Google Gemini,llm_3 = Groq(仅当账户启用时可用;否则 API 会返回 'bad request')。llm_1 | llm_2 | llm_3 |
| url | string | 是 | 要从中提取数据的网页完整 URL(http/https)。 |
| scraper | enum | 否 | 抓取器后端。scraper_1(默认,支持 useSession)或 scraper_2。如果网站阻止抓取,请尝试另一个。scraper_1 | scraper_2 |
| renderJs | boolean | 否 | 提取前在无头浏览器中渲染 JavaScript(默认 true;增加 0.1 积分)。 |
| selector | string | 否 | 用于将提取范围限制到页面部分区域的 CSS 选择器,例如 "main" 或 "#results"。默认值:整个 body。 |
| jsonFormat | object | 否 | 用于定义输出结构的示例 JSON,其键名将决定输出结构,例如 {"title": "", "price": "", "items": [{"name": ""}]}。键名会原样保留;值从页面中提取。 |
| useSession | boolean | 否 | 使用持久化抓取会话(仅限 scraper_1;终身计划账户会忽略此项)。 |
| extraLLMInfo | string | 否 | 提供给 LLM 的额外自然语言指令,例如 '仅提取前 10 个产品,价格使用数字'。 |
详细介绍
PulpMiner MCP 服务
来源:github.com/pulpminercom/pulpminer-mcp · 问题:github.com/pulpminercom/pulpminer-mcp/issues
一个适用于 PulpMiner 的 MCP 服务。它让 AI 助手(Cursor、Claude Desktop 及其他任何 MCP 客户端)能够:
- 使用 AI 将任意网页内容生成为 JSON。 PulpMiner 会抓取网页,再由大模型将其转换为结构化 JSON;你也可以指定准确的数据结构。
- 将网页转 JSON 的设置保存为可复用的 REST API(静态 API,或 URL 中带有
{{ variables }}的动态 API)。 - 从已保存的 API 获取数据并列出这些 API。
工具
| 工具 | 功能 | 后端端点 | 积分 |
|---|---|---|---|
pulpminer_generate_json | 抓取 URL 并使用 AI 将内容转换为 JSON(可选 jsonFormat 示例、CSS selector、额外指令) | POST /external/ai/json | 0.25(+0.1 renderJs) |
pulpminer_save_as_api | 将 URL + JSON 格式(+ 可选动态 URL 模板、缓存)保存为 API;返回 API ID 和端点 | POST /external/ai/json/save | 免费 |
pulpminer_fetch_api_data | 调用已保存的 API(GET,或通过 variables 调用动态 API 的 POST) | GET/POST /external/{apiId} | 0.4(+0.1 renderJs) |
pulpminer_list_saved_apis | 列出已保存的 API(ID、URL、动态 URL 模板及其变量) | GET /external/api/url | 免费 |
pulpminer_check_api_key | 验证 API 密钥并显示已配置的凭据 | GET /external/n8n/auth | 免费 |
选项值与后端一致:scraper 为 scraper_1(默认)或 scraper_2。llm 为 llm_2(OpenAI GPT,默认)、llm_1(Google Gemini)或 llm_3(Groq,仅在你的账户启用时可用)。
配置
| 环境变量 | 必填 | 说明 |
|---|---|---|
PULPMINER_API_KEY | 是 | 从 PulpMiner 控制面板 → API 密钥获取的 API 密钥。作为 apikey 请求头发送。所有工具只需要此凭据。 |
PULPMINER_BASE_URL | 否 | 默认值为 https://api.pulpminer.com |
PULPMINER_TIMEOUT_MS | 否 | 默认值为 300000(抓取和大模型处理步骤可能需要一些时间) |
安装与构建
git clone https://github.com/pulpminercom/pulpminer-mcp.git
cd pulpminer-mcp
npm install
npm run build
运行:
PULPMINER_API_KEY=... node dist/index.js # stdio
PULPMINER_API_KEY=... node dist/index.js --http # Streamable HTTP on http://127.0.0.1:3333/mcp
发布到 npm 后,可通过 npx -y pulpminer-mcp 运行。
客户端配置
Cursor(~/.cursor/mcp.json 或 .cursor/mcp.json)
{
"mcpServers": {
"pulpminer": {
"command": "npx",
"args": ["-y", "pulpminer-mcp"],
"env": { "PULPMINER_API_KEY": "your-api-key" }
}
}
}
Claude Desktop(claude_desktop_config.json)
{
"mcpServers": {
"pulpminer": {
"command": "npx",
"args": ["-y", "pulpminer-mcp"],
"env": { "PULPMINER_API_KEY": "your-api-key" }
}
}
}
发布之前,请使用本地构建:"command": "node", "args": ["/absolute/path/to/pulpminer-mcp/dist/index.js"]。
Streamable HTTP 客户端
使用 --http 启动(使用 PORT、HOST 环境变量;默认绑定到 127.0.0.1:3333),并将客户端指向 http://127.0.0.1:3333/mcp。此服务是无状态的。每个请求都可以在 x-pulpminer-api-key 请求头中发送自己的 API 密钥,该密钥会覆盖 PULPMINER_API_KEY。因此,它可用作托管的多用户端点(请将其置于 HTTPS 后)。
{
"mcpServers": {
"pulpminer": {
"url": "http://127.0.0.1:3333/mcp",
"headers": { "x-pulpminer-api-key": "your-api-key" }
}
}
}
典型流程
pulpminer_generate_json { url, jsonFormat? }:预览 JSON。pulpminer_save_as_api { url, jsonFormat, cache?, dynamicUrl? }返回apiId和endpoint。pulpminer_fetch_api_data { apiId, variables? }
动态 API 示例:dynamicUrl: "https://example.com/search?q={{ query }}",然后使用 variables: { "query": "laptops" } 获取数据。
开发
npm test # builds, then runs scripts/smoke-test.mjs against a local mock API (no real calls)
npm run inspect # opens the MCP Inspector UI
npx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
托管服务(远程)
remote/ 是一个 Cloudflare Worker,通过 Streamable HTTP(无状态)在 https://mcp.pulpminer.com/mcp 提供相同的工具。将你的 PulpMiner API 密钥作为 Authorization: Bearer <key>(或 x-pulpminer-api-key)发送;密钥只会转发到 PulpMiner API,不会被存储。
{ "mcpServers": { "pulpminer": { "url": "https://mcp.pulpminer.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } }
本地开发:cd remote && npm install && npm run dev(Node 22+)。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。