使用 skrape.ai 将任何网页转换为干净、适合大语言模型(LLM)的 Markdown 格式,非常适合将网络内容输入到 LLM 中。此 MCP 服务器提供了一个简单的接口,使用 skrape.ai API 将网页转换为结构化、干净的 Markdown 格式,设计用于与 Claude Desktop、其他 LLM 和兼容 MCP 的应用程序无缝集成。
此 MCP 服务器能让你轻松将网页转换为适合 LLM 的 Markdown 格式,以下为你介绍使用方法。
get_markdown - 将任意网页转换为适合 LLM 的 Markdown。
要通过 Smithery 自动为 Claude Desktop 安装 Skrape MCP 服务器,可执行以下命令:
npx -y @smithery/cli install @skrapeai/skrape-mcp --client claude
npm install
npm run build
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
- 在 Windows 上:
notepad %APPDATA%/Claude/claude_desktop_config.json
然后添加以下配置(请用您的路径和 API 密钥替换):
{
"mcpServers": {
"skrape": {
"command": "node",
"args": ["path/to/skrape-mcp/build/index.js"],
"env": {
"SKRAPE_API_KEY": "your-key-here"
}
}
}
}
以下是将服务器与 Claude 或其他 LLM 模型一起使用的步骤:
将此网页转换为 Markdown:https://example.com
Claude 将使用 MCP 工具如下:
skrape
get_markdown
{
"url": "https://example.com",
"options": {
"renderJs": true
}
}
生成的 Markdown 将是清洁、结构化的,并且准备好供 LLM 处理。
get_markdown 工具接受以下参数:
url(必需):要转换的任何网页 URL。returnJson(可选):设置为 true 以获取完整的 JSON 响应,而不是仅 Markdown。options(可选):附加抓取选项。
renderJs:是否在抓取前渲染 JavaScript(默认:true)。所有选项的示例:
skrape
get_markdown
{
"url": "https://example.com",
"returnJson": true,
"options": {
"renderJs": true
}
}
git clone https://github.com/skrape-ai/skrape-mcp-server.git
cd skrape-mcp-server
npm install
config.json 文件:{
"port": 3000,
"api_key": "your_api_key_here"
}
npm start
const { Client } = require('@skrape/mcp-client');
async function main() {
const client = new Client('localhost', 3000);
const result = await client.getMarkdown('https://example.com');
console.log(result.markdown); // 输出 Markdown 内容
}
main().catch(console.error);
const { Client } = require('@skrape/mcp-client');
async function main() {
const options = {
renderJs: true,
returnJson: true
};
const client = new Client('localhost', 3000);
const result = await client.getMarkdown('https://example.com', options);
console.log(result); // 输出 JSON 响应
}
main().catch(console.error);