pancake-api-mcp

pancake-api-mcp

Serves the Pancake API documentation to AI assistants, enabling them to search endpoints, retrieve full API contracts, webhook payloads, and guides without live API access.

Category
访问服务器

README

pancake-api-mcp

A Model Context Protocol (MCP) server that serves the Pancake API documentation to your AI assistant.

Point Claude Desktop, Cursor, or any MCP client at this server and your AI can read the Pancake docs on its own — search endpoints, pull a single endpoint's full contract (parameters, request body, response schema with every $ref expanded), inspect webhook payloads, and read the authentication / rate-limit / webhook-setup guides — without you copy-pasting anything.

The docs are bundled as a static snapshot of the official OpenAPI spec, so documentation lookups are self-contained and offline.

Optionally, configure your access tokens in the server's environment and the call_endpoint tool can also call the live Pancake API for you — the right token (access_token or page_access_token) is picked from each endpoint's OpenAPI security scheme and attached automatically. Without tokens the server stays fully offline and documentation-only.

What's inside

  • 31 REST endpoints across Pages, Conversations, Messages, Statistics, Customers, Posts, Tags, Users, Call logs, Export Data, Page's Contents, and Chat Plugin.
  • 5 webhook events: messaging, conversation, post, subscription, connect_status — each with its full payload schema and an example.
  • 11 guides: authentication & tokens, rate limits, the recommended API usage flow, webhook setup, event types, suspension rules, and best practices.

Tools

Tool Input Returns
search_docs query, area? (endpoint | webhook | guide | schema | all), limit? Ranked matches with type, id, and a snippet — start here to discover things
list_endpoints tag?, keyword? REST endpoints grouped by tag (id, method, path, summary)
get_endpoint id (e.g. "GET /pages/{page_id}/conversations") Full endpoint contract as markdown
list_webhooks All webhook events with summaries
get_webhook event (e.g. messaging) Webhook payload schema + example
list_guides Guide section ids + titles
get_guide id (e.g. authentication) Full guide section
auth_status Which tokens are configured (masked), plus the other env settings
call_endpoint id, params?, body? Live call to the Pancake API — status + response body

Every endpoint, webhook, and guide is also exposed as an MCP resource (pancake-api://endpoint/..., pancake-api://webhook/..., pancake-api://guide/...) for clients that browse resources.

Install

Requires Node.js 18+.

git clone https://github.com/<your-org>/pancake-api-mcp.git
cd pancake-api-mcp
npm install
npm run build

This produces dist/index.js, the server entry point.

Configure your access tokens (optional)

Pancake uses two token types, both passed as a query parameter. Set them as environment variables of the MCP server and call_endpoint will attach the right one per endpoint — you never paste a token into a chat, and tokens are never accepted as tool input.

Variable Query param Needed for How to get it
PANCAKE_USER_ACCESS_TOKEN access_token 2 account-level endpoints under https://pages.fm/api/v1 (list pages, generate a page token) Pancake → Account → Personal settings → API Access Token. Valid up to 90 days.
PANCAKE_PAGE_ACCESS_TOKEN page_access_token 24 page-level endpoints under https://pages.fm/api/public_api/v1|v2 (conversations, messages, statistics, customers…) Page → Settings → Tools, or POST /pages/{page_id}/generate_page_access_token. Does not expire.

Optional extras:

Variable Default Effect
PANCAKE_PAGE_ID Default value for page_id, so you don't repeat it on every call
PANCAKE_READ_ONLY false When true, call_endpoint accepts GET only and refuses every write
PANCAKE_TIMEOUT_MS 30000 Timeout for live API calls

Ask your assistant to run auth_status to verify the setup — it reports which variables are set without revealing their values.

Writes are enabled by default. With a page token configured, call_endpoint can really send messages to customers, change tags, and delete data. Set PANCAKE_READ_ONLY=true if you only want the assistant to read. Tokens are read from the environment only, redacted from every tool response and error message, and never written to logs.

Connect it to your AI client

Claude Desktop

Edit your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pancake-api": {
      "command": "node",
      "args": ["/absolute/path/to/pancake-api-mcp/dist/index.js"],
      "env": {
        "PANCAKE_USER_ACCESS_TOKEN": "your-user-access-token",
        "PANCAKE_PAGE_ACCESS_TOKEN": "your-page-access-token",
        "PANCAKE_PAGE_ID": "optional-default-page-id"
      }
    }
  }
}

Drop the env block entirely to run in offline documentation-only mode.

Restart Claude Desktop. You should see the pancake-api tools appear.

Cursor

In Settings → MCP → Add new global MCP server (or edit ~/.cursor/mcp.json):

{
  "mcpServers": {
    "pancake-api": {
      "command": "node",
      "args": ["/absolute/path/to/pancake-api-mcp/dist/index.js"],
      "env": {
        "PANCAKE_PAGE_ACCESS_TOKEN": "your-page-access-token"
      }
    }
  }
}

Replace /absolute/path/to/pancake-api-mcp with the real path where you cloned this repo.

Try it

Once connected, ask your AI things like:

  • "Using the Pancake docs, how do I authenticate?"
  • "What endpoint lists conversations for a page, and what parameters does it take?"
  • "Show me the payload of the messaging webhook."
  • "Search the Pancake docs for anything about tags."

And, with tokens configured:

  • "Check my Pancake token setup." (auth_status)
  • "List the last 60 conversations of page 12345." (call_endpoint)
  • "Send 'thanks for your order' to conversation X." (a write — confirm before you say yes)

Development

npm run build     # compile TypeScript to dist/
npm run dev       # tsc --watch
npm run inspect   # open the MCP Inspector against the built server
npm run sync-spec # (maintainer) refresh spec/ from ../pancake_api_doc/openapi

Updating the bundled docs

The OpenAPI snapshot lives in spec/openapi.yaml and spec/webhook.yaml. A maintainer refreshes them from the source docs project with:

npm run sync-spec                        # assumes ../pancake_api_doc alongside this repo
npm run sync-spec -- /path/to/pancake_api_doc   # or pass the docs repo explicitly
npm run build

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选