Astron-Douban-MCP: 基于豆瓣游客态公开接口的自包含 MCP Server,支持 MCP 协议和 uvx 一键启动。
Project description
豆瓣公开内容 MCP Server
概述
Astron-douban-mcp 是一个基于 MCP 协议的豆瓣工具服务,直接调用豆瓣游客态公开接口、公开资料页和公开 RSS 获取公开内容,无需额外部署后端服务。
当前工程形态:
- 使用
MCP Python SDK - 使用单文件
server.py承载工具定义和 HTTP 调用 - 通过独立
pyproject打包 - 支持
uvx一键启动 - 通过环境变量配置超时和 User-Agent
当前提供 6 个原子工具:
get_hot_listget_feed_listsearch_contentget_content_detailget_author_profileget_author_content_list
工具列表
1. 获取热榜 get_hot_list
- 描述:读取豆瓣热榜,默认使用电影热榜。
- 参数:
limit:返回条数,默认20refresh:是否刷新,默认False
2. 获取内容流 get_feed_list
- 描述:读取豆瓣公开内容流。
- 参数:
channel:可选tv_hot、movie_hot、book_hotcursor:分页游标,默认空,内部按start偏移处理limit:返回条数,默认20refresh:是否刷新,默认False
3. 搜索内容 search_content
- 描述:搜索豆瓣公开内容。
- 参数:
query:搜索词,必填cursor:分页游标,默认空,内部按start偏移处理limit:返回条数,默认20
4. 获取内容详情 get_content_detail
- 描述:读取豆瓣 subject 或 topic 详情。
- 参数:
content_id:subject/topic IDurl:内容完整 URL
5. 获取用户主页 get_author_profile
- 描述:读取豆瓣用户公开主页。
- 参数:
author_id:用户 slug 或数字用户 IDurl:用户主页 URL
6. 获取用户公开内容列表 get_author_content_list
- 描述:读取豆瓣用户公开内容列表。
- 参数:
author_id:用户 slug 或数字用户 IDurl:用户主页 URL,或显式收藏页 URLcursor:分页游标,默认空,内部按start偏移处理limit:返回条数,默认20
环境变量
这个包默认不需要认证信息。
可选环境变量:
export DOUBAN_MCP_TIMEOUT_SECONDS="30"
export DOUBAN_MCP_USER_AGENT="Mozilla/5.0 ..."
说明:
DOUBAN_MCP_TIMEOUT_SECONDS控制公开接口请求超时。DOUBAN_MCP_USER_AGENT用于覆盖默认请求头。
安装与启动
推荐方式:使用 uvx 一键启动
uvx --from astron-douban-mcp astron-douban-mcp
如果你还没有安装 uv / uvx,可先执行:
curl -fsSL https://install.astral.sh/uv | bash
使用 pip 安装
pip install astron-douban-mcp
douban-mcp
本地源码运行
cd MCP/douban-mcp
PYTHONPATH=src python3 -m douban_mcp.server
客户端配置
使用 uvx
{
"mcpServers": {
"douban-mcp": {
"command": "uvx",
"args": ["--from", "astron-douban-mcp", "astron-douban-mcp"],
"env": {
"DOUBAN_MCP_TIMEOUT_SECONDS": "30"
}
}
}
}
使用本地源码
{
"mcpServers": {
"douban-mcp": {
"command": "python3",
"args": ["-m", "douban_mcp.server"],
"env": {
"PYTHONPATH": "/path/to/MCP/douban-mcp/src",
"DOUBAN_MCP_TIMEOUT_SECONDS": "30"
}
}
}
}
平台差异说明
- 这个 MCP 直接请求豆瓣游客态公开接口、公开资料页和公开 RSS,不依赖额外的 Astron 后端服务。
- 当前仅面向公开内容能力,不包含登录态、私有内容或用户专属数据。
- 作者内容列表优先使用
interestsJSON 接口,必要时回退到 RSS 或显式收藏页。 - 游客态公开接口可能受网络、地区或平台风控影响,偶发失败时建议稍后重试。
发布说明
cd MCP/douban-mcp
rm -rf build dist src/*.egg-info
python3 -m build --no-isolation
python3 -m twine check dist/*
python3 -m twine upload dist/*
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
astron_douban_mcp-0.1.1.tar.gz
(15.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astron_douban_mcp-0.1.1.tar.gz.
File metadata
- Download URL: astron_douban_mcp-0.1.1.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
835ee6525c8641815095d810dfb6c7e73a101b383435c71cd78e29d2acb56eb4
|
|
| MD5 |
a9767d0ce640f882279db02d51308e3e
|
|
| BLAKE2b-256 |
f019e9a0e5d646def938905785fae710badb0029c37607bc08743c8fc8298d69
|
File details
Details for the file astron_douban_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: astron_douban_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82cc2b2895f378a2363ccc933990d47c3ffac3ac22fd192ff744ca9f57056f66
|
|
| MD5 |
2ea97d7013588f4714c244e9d834caba
|
|
| BLAKE2b-256 |
4e34c7984d9e7c319ecd4d25f67fb79bd95c0c6e9b57eeab9ec41a2fca0acc83
|