Dianping MCP Server
Dianping MCP Server
这是一个通过本地浏览器登录会话搜索大众点评内容的 MCP server。大众点评的桌面端和移动端搜索会对匿名请求触发登录/安全验证,因此本项目不使用未经授权的接口,也不尝试绕过验证码或反爬机制;服务使用 Playwright 驱动本机 Chrome,并复用独立的持久化 profile。
快速开始
要求 Node.js 20+,并安装 Chrome、Edge 或 Chromium:
npm install
npm run login登录命令会打开浏览器。请完成大众点评登录和安全验证,然后回到终端按 Ctrl+C 退出。登录资料默认保存到 ~/.dianping-mcp/browser-profile。之后启动 MCP server:
npm run build
npm startMCP 客户端使用 stdio 连接,提供三个工具:
search_places:按城市、关键词、页码搜索商户,返回名称、评分、评价数、人均、地址和店铺 URL。get_place_details:按店铺 ID 或搜索结果里的 URL 获取店铺信息及精选评论。check_session:检查浏览器是否可用、是否需要登录或安全验证。
Related MCP server: tieba-mcp
MCP 客户端配置
把下面的命令配置到支持 stdio MCP 的客户端,路径替换成仓库的绝对路径:
{
"mcpServers": {
"dianping": {
"command": "npm",
"args": ["--prefix", "/绝对路径/dp-mcp", "start"],
"env": {
"DP_CITY": "上海"
}
}
}
}也可以直接使用构建后的 dist/index.js:
{
"command": "node",
"args": ["/绝对路径/dp-mcp/dist/index.js"],
"env": { "DP_CITY": "上海" }
}配置项
变量 | 默认值 | 作用 |
|
| 浏览器登录资料目录 |
| 自动探测 | Chrome/Edge/Chromium 可执行文件 |
|
|
|
|
| MCP 搜索是否无头运行;登录请使用 |
|
| 两次页面请求的最小间隔 |
|
| 搜索和详情的内存缓存时间 |
|
| 页面导航和选择器超时 |
当前内置常用城市包括上海、北京、杭州、广州、南京、苏州、深圳、成都、重庆、天津、宁波、扬州、无锡、福州、厦门、武汉、西安、沈阳、大连、长沙、青岛和济南;其他城市可传大众点评城市 ID。
开发与验证
npm test
npm run check
npm run build页面结构或安全策略变化时,服务会返回明确的解析/验证错误。请降低调用频率,并遵守大众点评的服务条款、robots 规则和适用法律。
Available Tools
3 toolscheck_session检查大众点评会话ARead-only
检查本地浏览器、登录状态及是否需要完成安全验证。
Inputs: no named parameters.
get_place_details读取大众点评店铺详情ARead-only
根据搜索结果中的店铺 ID 或 URL 读取地址、电话、营业时间、评分及精选评论。
Inputs: shop (required), reviewLimit.
search_places搜索大众点评商户ARead-only
按城市和关键词搜索大众点评上的餐厅、景点、酒店或其他本地商户。
Inputs: keyword (required), city, page, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: searching for places, retrieving detailed info about a specific place, and checking session/authentication status. No overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern in snake_case (search_places, get_place_details, check_session), making the naming predictable and easy to understand.
With 3 tools, the server is concise but covers the core functionality of searching and retrieving details for a local services platform. The inclusion of a session-check tool is practical, and the count feels appropriate for the scope.
The tool surface covers the essential read operations—search and detail retrieval—along with session verification. For a read-oriented API, this is reasonably complete. Minor gaps like listing categories or handling pagination could exist but are not critical.
Related MCP Connectors
Liepin job search and resume workflows backed by the official Liepin MCP server.
Weibo posts, hot search, comments and profiles to JSON. No login or cookies needed.
Web search, page extraction, visual tools and developer utilities through Baizhi Cloud.
Search Xiaohongshu and Douyin; read Douyin, RedNote, Bilibili, TikTok, YouTube, X links as text
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables searching Xiaohongshu (小红书) content via dots.ai using a logged-in browser session, exposed as MCP tools.-
- FlicenseNot gradedqualityCmaintenanceEnables reading public Baidu Tieba content through a persistent real-browser session, supporting forum searches, post details, and user public post lists with optional login-state injection.-
- FlicenseNot gradedqualityCmaintenanceEnables local scraping and interaction with Douyin (TikTok China) content, including videos, user data, comments, live streams, and private messages, using personal account cookies without official APIs.1-
- AlicenseAqualityCmaintenanceEnables querying Pinduoduo merchant backend data through a logged-in Chrome session via CDP, including reviews, customer service chat, product analytics, and promotion reports.152MIT