baidu-pan-mcp-server
Provides tools for managing Baidu Netdisk (百度网盘) files, including listing, searching, uploading, downloading, sharing, and file operations through the Baidu Open API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@baidu-pan-mcp-server列出我的网盘根目录文件"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🔧 百度网盘 MCP Server 开发指南
基于百度网盘开放 API 的 Model Context Protocol 服务器开发全攻略
🎉 官方 MCP Server 已发布
百度网盘官方已发布 MCP Server,可直接使用!
项目 | 链接 |
GitHub 仓库 | |
在线 SSE |
|
文档 |
快速使用官方 MCP Server
Claude Code:
# 添加官方 SSE 服务器
claude mcp add --transport sse baidu-pan https://mcp-pan.baidu.com/sseOpenAI Codex (~/.codex/mcp_servers.json):
{
"mcpServers": {
"baidu-pan": {
"url": "https://mcp-pan.baidu.com/sse"
}
}
}本地 Stdio 模式(支持上传):
# 克隆官方仓库
git clone https://github.com/baidu-netdisk/mcp.git
cd baidu-pan-mcp
# 安装依赖
npm install
# 配置凭证
export BAIDU_APP_KEY=your_app_key
export BAIDU_SECRET_KEY=your_secret_key
export BAIDU_ACCESS_TOKEN=your_access_token
# 启动
npm start官方 MCP Server 提供 18 个 Tools,覆盖文件列表、搜索、管理、上传和分享。
Related MCP server: AI-Persona
📖 本仓库内容
如果你想自己开发百度网盘 MCP Server,或深入了解 API 细节,本仓库提供完整的开发指南:
文档 | 内容 |
百度网盘完整 REST API 文档,含所有端点、参数和响应 | |
OAuth 2.0 授权码流程详解,含自动授权脚本 | |
从零开发 MCP Server 的完整教程 | |
TypeScript 参考代码(12 个 MCP Tools) |
🏗️ 自定义开发
为什么要自己开发?
🎯 需要定制化功能(如自动同步、批量操作)
🔧 需要特殊权限控制
📦 需要集成到已有系统
🧪 学习 MCP Server 开发
前置条件
依赖 | 说明 |
百度开放平台应用 | |
Node.js 18+ | 运行环境 |
AI 编程助手 | Claude Code 或 OpenAI Codex |
安装
git clone https://github.com/XiLeForCLY/baidu-pan-mcp-server.git
cd baidu-pan-mcp-server
npm install
npm run build配置凭证
export BAIDU_APP_KEY=your_app_key
export BAIDU_SECRET_KEY=your_secret_key
export BAIDU_ACCESS_TOKEN=your_access_token获取 Access Token
使用项目提供的授权辅助脚本:
node scripts/oauth-helper.mjs
# 浏览器会自动打开,授权后终端显示 Token详细流程参考 OAuth 授权指南。
注册到 AI 助手
# Claude Code
claude mcp add --transport stdio baidu-pan -- node dist/index.js
# Codex (在 ~/.codex/mcp_servers.json 中添加)🛠️ MCP Tools 列表
Tool | 功能 | 示例提示词 |
| 列出目录文件 | "列出网盘根目录的文件" |
| 搜索文件 | "搜索包含 report 的文件" |
| 获取文件详情 | "查看文件 ID 12345 的信息" |
| 获取下载链接 | "获取文件下载链接" |
| 创建文件夹 | "创建文件夹 /项目备份" |
| 重命名 | "把 old.txt 改名为 new.txt" |
| 移动文件 | "把 report.pdf 移到 /归档/" |
| 复制文件 | "复制 config.json 到 /备份/" |
| 删除文件 | "删除 /temp/ 下所有文件" |
| 用户信息 | "查看网盘账号信息" |
| 存储配额 | "网盘还剩多少空间?" |
| 创建分享 | "分享 file.txt 提取码 1234" |
📐 架构图
┌─────────────────┐ MCP (stdio/SSE) ┌──────────────────┐
│ AI 助手 │◄────────────────────►│ MCP Server │
│ Claude Code / │ JSON-RPC 2.0 │ (本项目) │
│ Codex / Cursor │ │ │
└─────────────────┘ └────────┬─────────┘
│
│ REST API (HTTPS)
▼
┌──────────────────┐
│ 百度网盘开放平台 │
│ pan.baidu.com │
│ openapi.baidu.com│
└──────────────────┘📊 百度网盘 API 速查
API | 端点 | 方法 |
用户信息 |
| GET |
配额查询 |
| GET |
文件列表 |
| GET |
文件搜索 |
| GET |
文件元信息 |
| GET |
创建文件夹 |
| POST |
文件管理 |
| POST |
秒传 |
| POST |
预上传 |
| POST |
上传分片 |
| POST |
合并文件 |
| POST |
创建分享 |
| POST |
详细参数和响应请参考 API 参考文档。
🔗 相关资源
资源 | 链接 |
百度网盘官方 MCP | |
百度网盘开放平台文档 | |
百度开放平台 | |
MCP 协议规范 | |
MCP SDK (TypeScript) | |
bypy (Python 客户端) | houtianze/bypy ⭐8.5k |
📄 License
MIT License © 2026
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Qwen Image 3 AI image generation
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Create guides as MCP servers to instruct coding agents to use your software (library, API, etc).
Related MCP Servers
- FlicenseCqualityDmaintenanceA Model Context Protocol server that enables Claude Desktop to generate images using Baidu's iRAG image generation API through a standardized interface.1-
- AlicenseBqualityDmaintenanceAn MCP protocol server that supports multi-AI personality summoning and collaboration, which can be used for intelligent collaboration in multiple scenarios such as code analysis and product design.41Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables fetching YApi interface details via a tool, allowing AI assistants to generate API code based on YApi documentation.39 npmISC
- AlicenseBqualityDmaintenanceMCP server for Nutstore cloud storage, enabling AI assistants to manage files via WebDAV with support for listing, searching, uploading, downloading, and more.1923 PyPI1MIT