@practicemakes/mcp

中文文档
26.1101.2发布于 2026/11/02UNLICENSEDTypeScriptES Module

MCP server exposing PracticeMakes prod data (read-only) to Claude, authenticated as the calling user's own Firebase identity.

原始使用文档
文档目录10 节
  1. How it works
  2. Use it (published package)
  3. Getting a refresh token
  4. Develop (from the monorepo)
  5. Publish
  6. Tools (read)
  7. Server identifiers
  8. Tools (write)
  9. Read this before enabling write tools
  10. Roadmap

@practicemakes/mcp

A small MCP server that exposes PracticeMakes production data (read-only) to Claude for admin and development work — and surfaces your Planner backlog so your own task list can drive development.

It authenticates as your own platform identity (your Firebase user), so every result is scoped to your real role and organization by the backend. A SYSADMIN sees the whole platform; a regular user sees only their org. That's what lets the same server be handed to other users on the platform.

How it works

Claude  ──stdio──▶  @practicemakes/mcp  ──HTTPS Bearer──▶  https://api.practicemakes.io/api/...
                    (refreshes your Firebase ID token)      (existing authz + business logic)

No backend changes and no secret credentials — the Firebase Web API key it uses is a public client value (baked in as a default), so each user supplies only a credential for their own account. Read-only.

Use it (published package)

Once published to npm, any platform user connects with one line — nothing to clone or build:

claude mcp add practicemakes \
  --env FIREBASE_REFRESH_TOKEN=<your-refresh-token> \
  -- npx -y @practicemakes/mcp

Point at a local backend during development with --env PM_API_BASE_URL=http://localhost:9090.

Getting a refresh token

  • Password account: create .env (see .env.example) with PM_EMAIL / PM_PASSWORD, run yarn workspace @practicemakes/mcp login — it prints a FIREBASE_REFRESH_TOKEN=... line to use.
  • Google/Apple sign-in: log into the web app, open DevTools → Application → IndexedDB → firebaseLocalStorage → the auth user record, and copy stsTokenManager.refreshToken.

Develop (from the monorepo)

yarn install                                   # at repo root, links the workspace
yarn workspace @practicemakes/mcp build
cp packages/mcp/.env.example packages/mcp/.env # then fill in a credential
yarn workspace @practicemakes/mcp smoke        # end-to-end check against prod

smoke prints who you're authenticated as, how many orgs are visible, and your Planner backlog. To run the local build directly in Claude instead of the published package:

claude mcp add practicemakes \
  --env FIREBASE_REFRESH_TOKEN=... \
  -- node "$(pwd)/packages/mcp/dist/index.js"

Publish

Versioned on the monorepo's calendar scheme (26.MMDD.patch). Scoped public package:

yarn workspace @practicemakes/mcp publish   # runs prepublishOnly (clean + build) first

Tools (read)

ToolWhat it returns
list_organizationsOrgs visible to you (SYSADMIN → all)
get_organizationOne org by UUID
get_my_profileYour profile + entitlements/roles/org context
list_profilesProfiles (SYSADMIN → all, ADMIN → your org)
get_profileOne profile by UUID
get_my_planner_tasksYour Planner backlog (drives development)
search_tasksSearch tasks; reveal completed/deleted/snoozed via showFields
get_taskOne task by UUID
list_workflowsYour Planner workflows
get_workflowOne workflow, hydrated with run state
get_billing_configBilling/entitlement config for your org (takes a required platform)
list_serversMonitored servers + both identifiers the tools below need
get_serverOne server's config, including its maintenance windows
list_server_statusesLive status of all your servers (is anything down now)
get_server_uptimeUptime % over the last 1–168 hours, from raw heartbeats
get_server_uptime_dailyPer-day uptime history beyond heartbeat retention
list_server_incidentsOutage history for one server, planned vs unplanned

Server identifiers

The monitoring tools take two different, non-interchangeable identifiers, and passing the wrong one returns a 404 that reads like a missing server. list_servers returns both:

IdentifierUsed byRoute family
serverShortLinkget_server_uptime, get_server_uptime_daily/api/public/... (unauthenticated)
serverIdget_server, list_server_incidents/api/server/... (authenticated, org-scoped)

Neither is a UUID — serverId is the operator-assigned id (e.g. web-01).

Tools (write)

Every write tool asks you to confirm the exact request before it sends anything.

ToolWhat it does
create_taskCreates a Planner task in your current org context (needs ADMIN there)
complete_taskSets completedAt on a task — the tool that closes the Planner-driven-dev loop
switch_org_contextSwitches your active org context (SYSADMIN → any org, otherwise invite-only)

Read this before enabling write tools

These tools run as you, with all of your permissions. Authentication is a per-user Firebase ID token, not a service account — there is no read-only role, no separate service identity, and no server-side allow-list behind them. If your account is SYSADMIN, a write tool can write across every tenant on the platform. The tool list and the confirmation prompt are the entire safety boundary.

Confirmation needs client support. The gate uses MCP elicitation. If your client did not advertise elicitation support during the handshake, there is no channel to ask you on, and every write tool refuses and sends nothing — it will not fall back to writing unconfirmed. The error names the mutation it declined to perform. This is deliberate: silently proceeding would disable the guardrail for exactly the clients that never agreed to be asked.

switch_org_context is session-global. It mutates your profile, so it changes what every later read tool returns for the rest of the session — not just the next call.

complete_task is a read-modify-write. There is no dedicated completion endpoint; the tool reads the task, sets completedAt, and re-posts it, carrying the read's ETag back as If-Match so a concurrent edit is not silently clobbered.

yarn smoke is unaffected — it issues three fixed read-only requests and never touches the tool registry, so no write can reach production through it.

Roadmap

  • Admin actions (e.g. the ARCH-153 org/user purge) — blocked: no executable endpoint exists yet, only a GET .../data-inventory that reports what a purge would do and deletes nothing.
  • OpenAPI-driven tool generation from the backend's grouped specs (the monorepo already uses openapi-typescript in packages/core).
  • Hosted remote server (streamable-HTTP + per-user OAuth) so users connect to a URL with nothing to install.

版本与发布记录

@practicemakes/mcp 共发布 16 个版本,首次发布于 2026/07/12;过去 12 个月发布了 16 个版本。

版本发布日期距今
26.1101.2latest2026/11/021 天前
26.1101.12026/11/021 天前
26.1031.12026/11/012 天前
26.1029.22026/10/304 天前
26.1029.12026/10/304 天前
26.1020.12026/10/2113 天前

关于 @practicemakes/mcp 的常见问题

@practicemakes/mcp 是什么?

MCP服务器将practicemakeprod数据(只读)暴露给Claude,身份验证为调用用户自己的Firebase身份。

如何安装 @practicemakes/mcp?

在项目目录运行 npm install @practicemakes/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 practicemakes-mcp,可以用 npx practicemakes-mcp 直接运行。

@practicemakes/mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@practicemakes/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@practicemakes/mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@practicemakes/mcp 可以商用吗?

@practicemakes/mcp 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@practicemakes/mcp 还在维护吗?

最新版本 26.1101.2 发布于 2026/11/02(1 天前);至今共发布 16 个版本,其中过去 12 个月发布了 16 个;首次发布于 2026/07/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。