网页内容解析服务

SLIM MCP Server 是一个允许Claude以SLIM格式获取网页内容的服务,优化AI理解,减少约90%的令牌使用。

  • by matteuccimarco
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 matteuccimarco/slim-mcp-server

使用说明

SLIM MCP服务器

让克劳德以人工智能原生格式阅读网络

MCP(模型上下文协议)服务器,允许Claude在 SLIM格式 -针对AI理解进行了优化,减少了约90%的标记。

快速开始

1.安装

npm install -g @slim-protocol/mcp-server
# or use npx directly (no install needed)

2.配置克劳德桌面

添加到您的 claude_desktop_config.json:

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

{
  "mcpServers": {
    "slim": {
      "command": "npx",
      "args": ["@slim-protocol/mcp-server"]
    }
  }
}

3.重新启动克劳德桌面

就是这样!克劳德现在可以阅读网页了。

用法

只需让Claude阅读任何URL:

"Read this article and summarize it: https://example.com/article"

"What are the key points in this documentation: https://docs.example.com"

"Analyze this YouTube video: https://youtube.com/watch?v=..."

"What's the discussion about in this Reddit thread: https://reddit.com/r/..."

Claude将自动使用SLIM工具来获取和理解内容。

工具

slim_fetch

获取SLIM格式的web内容。

输入:

  • url (string,必填):要获取的URL

例子:

Claude uses slim_fetch with url="https://en.wikipedia.org/wiki/Artificial_intelligence"

slim_fetch_with_options

使用高级选项获取。

输入:

  • url (string,必填):要获取的URL
  • includeImages (布尔值,可选):包括图像元数据(默认值:true)
  • includeVideos (布尔值,可选):包括视频元数据(默认值:true)

支持的内容

平台 内容类型
网站 文章、博客、文档
油管 视频元数据+文字记录
红迪 帖子、评论、帖子
蓝天 帖子、简介
任何URL 通用网络内容

什么是SLIM?

SLIM(SLIM Web Representation)是一种具有层次结构的AI原生内容格式:

  • L1级:身份(标题、类型、作者、日期)
  • 三级:结构(章节、标题、导航)
  • 第五层:要点(见解、主题、总结)
  • 第七层:完整内容(全文)

这种结构使Claude能够高效地理解内容,而无需处理原始HTML、CSS和JavaScript。

配置

环境变量

变量 默认值 描述
SWR_PROXY_URL https://swrproxy.frux.pro SLIM代理URL
SWR_TIMEOUT_MS 30000 请求超时(毫秒)
DEBUG false 启用调试日志记录

自定义代理

{
  "mcpServers": {
    "slim": {
      "command": "npx",
      "args": ["@slim-protocol/mcp-server"],
      "env": {
        "SWR_PROXY_URL": "https://my-proxy.example.com",
        "DEBUG": "true"
      }
    }
  }
}

发展

# Clone
git clone https://github.com/slim-protocol/mcp-server
cd mcp-server

# Install
npm install

# Run in dev mode
npm run dev

# Build
npm run build

# Test
npm test

故障排除

“工具不可用”

  1. 确保配置更改后重新启动Claude Desktop
  2. 检查配置文件位置和JSON语法
  3. 尝试手动运行: npx @slim-protocol/mcp-server

“请求超时”

有些页面加载缓慢。尝试:

  1. 使用其他URL
  2. 通过以下方式增加超时时间 SWR_TIMEOUT_MS

“代理错误”

  1. 检查互联网连接
  2. 验证代理URL是否正确
  3. 请先在浏览器中尝试URL

许可证

麻省理工学院

链接