spider-mcp

spider-mcp

An MCP server that enables agents to automate Douyin and Xiaohongshu, including login, search, scraping, publishing, and commenting.

Category
Visit Server

README

spider-mcp

面向 agent 的多平台内容平台自动化 MCP(抖音 / 小红书)。通过 MCP 协议暴露登录、搜索、抓取、发布、评论等能力,供 Claude Code、Cursor 等 agent 调用。

特性

  • 多租户:每个账号(accountId)一套隔离的浏览器 profile 与登录态
  • 浏览器自动化:基于 Playwright,复用登录态,适配反爬严格的平台
  • 双传输:stdio(本地开发)+ HTTP/SSE(线上部署)
  • 媒体上传:upload_asset + MediaRef(url / asset / base64 / path)

当前状态

骨架已就位,9 个 tool 已注册并可通过 MCP 协议调用,具体平台实现逐步填充中。

部分 状态
MCP server(stdio) ✅
类型契约 / tool schema ✅
BrowserManager 🚧 进行中
DouyinHandler 各方法 🟡 桩

依赖安装

bun install
bunx playwright install chromium   # 若复用系统 Chrome 可跳过

在 Claude Code 中接入(stdio)

方式一:CLI 命令(推荐)

claude mcp add spider-mcp -- bun /Users/zeek/Projects/MCP/spider-mcp/index.ts

可加 scope:-s user(全局)或 -s project(仅当前项目,写入 .mcp.json)。

方式二:项目配置文件

在项目根目录创建 .mcp.json:

{
  "mcpServers": {
    "spider-mcp": {
      "command": "bun",
      "args": ["/Users/zeek/Projects/MCP/spider-mcp/index.ts"]
    }
  }
}

全局则编辑 ~/.claude.json 中的 mcpServers。

验证

接入后在 Claude Code 里:

/mcp

应能看到 spider-mcp 处于 connected 状态,并列出 9 个 tool:

tool 说明
login 发起登录,返回二维码(首次 loggedIn=false)
login_status 查询登录态(配合 login 轮询)
logout 退出并清理 session
search 搜索作品
get_note 抓取单个作品详情
get_comments 抓取评论列表
publish 发布内容(图文/视频)
comment 发评论
upload_asset 上传媒体,返回 assetId

所有 tool 都带 platform(douyin/xiaohongshu)和 accountId 参数。

本地调试

不开 Claude Code,直接用 stdin/stdout 喂 JSON-RPC 验证:

# 初始化握手 + 列出所有 tool
printf '%s\n%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| bun run index.ts

目录结构

src/
├── types.ts              # 共享数据类型
├── server.ts             # MCP server:tool 注册 + 路由
├── registry.ts           # 平台 handler 注册表
├── stdio.ts              # stdio 传输入口(本地开发)
├── http.ts               # HTTP/SSE 传输入口(线上,占位)
├── browser/manager.ts    # Playwright 持久化浏览器管理(多租户)
├── platforms/
│   ├── base.ts           # PlatformHandler 抽象接口
│   └── douyin.ts         # 抖音实现
├── tools/schemas.ts      # tool 的 zod 参数 schema
└── assets/store.ts       # 媒体资产存储

开发

bun run typecheck   # tsc --noEmit
bun run start       # 启动 stdio server

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
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
Qdrant Server

Qdrant Server

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

Official
Featured