Skip to main content
Glama
Dianping MCP Server

Dianping MCP Server

by qianwj

Dianping MCP Server

This is an MCP server that searches Dianping content through a local browser login session. Both the desktop and mobile search endpoints of Dianping trigger login/security verification for anonymous requests, so this project does not use unauthorized interfaces, nor does it attempt to bypass CAPTCHAs or anti-scraping mechanisms; the service uses Playwright to drive the local Chrome browser and reuses an independent persistent profile.

Quick Start

Requires Node.js 20+ and Chrome, Edge, or Chromium installed:

npm install
npm run login

The login command will open the browser. Please complete the Dianping login and security verification, then return to the terminal and press Ctrl+C to exit. The login data is saved by default to ~/.dianping-mcp/browser-profile. After that, start the MCP server:

npm run build
npm start

The MCP client connects via stdio and provides three tools:

  • search_places: Search for merchants by city, keyword, and page number, returning name, rating, review count, average spending, address, and shop URL.

  • get_place_details: Get shop details and featured reviews by shop ID or the URL from search results.

  • check_session: Check if the browser is available, and whether login or security verification is needed.

Related MCP server: tieba-mcp

MCP Client Configuration

Configure the following command in a client that supports stdio MCP, replacing the path with the absolute path of the repository:

{
  "mcpServers": {
    "dianping": {
      "command": "npm",
      "args": ["--prefix", "/绝对路径/dp-mcp", "start"],
      "env": {
        "DP_CITY": "上海"
      }
    }
  }
}

Alternatively, you can directly use the built dist/index.js:

{
  "command": "node",
  "args": ["/绝对路径/dp-mcp/dist/index.js"],
  "env": { "DP_CITY": "上海" }
}

Configuration Options

Variable

Default

Description

DP_PROFILE_DIR

~/.dianping-mcp/browser-profile

Browser login profile directory

DP_BROWSER_EXECUTABLE_PATH

Auto-detected

Chrome/Edge/Chromium executable path

DP_CITY

Shanghai

Default city when search_places is not passed a city

DP_HEADLESS

true

Whether MCP search runs headless; for login please use npm run login

DP_MIN_INTERVAL_MS

1500

Minimum interval between two page requests

DP_CACHE_TTL_MS

300000

In-memory cache TTL for search and details

DP_NAVIGATION_TIMEOUT_MS

25000

Page navigation and selector timeout

Currently built-in common cities include Shanghai, Beijing, Hangzhou, Guangzhou, Nanjing, Suzhou, Shenzhen, Chengdu, Chongqing, Tianjin, Ningbo, Yangzhou, Wuxi, Fuzhou, Xiamen, Wuhan, Xi'an, Shenyang, Dalian, Changsha, Qingdao, and Jinan; other cities can be passed via Dianping city ID.

Development and Verification

npm test
npm run check
npm run build

When page structure or security policies change, the service will return clear parsing/verification errors. Please reduce call frequency and comply with Dianping's Terms of Service, robots rules, and applicable laws.

Available Tools

3 tools
check_session检查大众点评会话A
Read-only

检查本地浏览器、登录状态及是否需要完成安全验证。

Inputs: no named parameters.

get_place_details读取大众点评店铺详情A
Read-only

根据搜索结果中的店铺 ID 或 URL 读取地址、电话、营业时间、评分及精选评论。

Inputs: shop (required), reviewLimit.

search_places搜索大众点评商户A
Read-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

    A4/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
      -