Xiaohongshu API MCP Server

Xiaohongshu API MCP Server

A microservice that wraps Xiaohongshu (Little Red Book) API into a RESTful API server, enabling users to perform various operations on the platform such as retrieving notes, searching users and content, and accessing user information.

Category
Visit Server

README

Xiaohongshu API MCP Server | 小红书 API 微服务

这是一个将小红书 API 封装成 RESTful API 服务器的微服务。可以使用 Docker 进行部署。

功能特点

  • RESTful API for Xiaohongshu operations | 小红书操作的 RESTful API
  • Multiple client support | 支持多客户端
  • Docker containerization | Docker 容器化
  • Easy to deploy and scale | 易于部署和扩展

API 端点

服务器提供以下端点:

  • /clients - 创建和管理小红书客户端实例
  • /clients/{client_id}/note - 通过 ID 获取笔记
  • /clients/{client_id}/note/html - 从 HTML 通过 ID 获取笔记
  • /clients/{client_id}/search/notes - 通过关键词搜索笔记
  • /clients/{client_id}/search/users - 通过关键词搜索用户
  • /clients/{client_id}/user/info - 通过 ID 获取用户信息
  • /clients/{client_id}/user/notes - 获取用户笔记
  • /clients/{client_id}/feed/categories - 获取推荐流分类
  • /clients/{client_id}/feed/{feed_type} - 通过类型获取推荐流
  • /health - 健康检查端点

项目结构

.
├── xhs_mcp_server/     # 主服务器目录
│   ├── app/           # 应用程序核心
│   ├── xhs/          # 小红书API模块
│   ├── Dockerfile    # Docker构建文件
│   └── requirements.txt # Python依赖
└── xhs_api.py        # API实现

快速开始

前提条件

  • Docker
  • Docker Compose

安装和运行

  1. 构建并启动 Docker 容器:
cd xhs_mcp_server
docker-compose up -d

服务将在 http://localhost:8000 运行。

  1. 通过Python直接运行:
pip install -r xhs_mcp_server/requirements.txt
python xhs_api.py

API 文档

服务器运行后,您可以在以下位置访问 API 文档:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

使用示例

  1. 创建客户端:
curl -X POST "http://localhost:8000/clients" \
  -H "Content-Type: application/json" \
  -d '{"cookie": "your_cookie_here"}'
  1. 通过 ID 获取笔记:
curl -X POST "http://localhost:8000/clients/client_1/note" \
  -H "Content-Type: application/json" \
  -d '{"note_id": "your_note_id", "xsec_token": "your_xsec_token"}'

许可证

本项目仅用于教育目的。使用风险自负。

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