Paxaver MCP Server
OfficialPaxaver MCP Server
面向 AI 的适配器,用于 Paxaver 学校社区平台。 在 Cloudflare Workers 上实现模型上下文协议 (MCP),支持 RS256 JWT 验证、能力优先授权和 Streamable HTTP 传输。
这是什么
Paxaver MCP 服务器让 AI 助手(ChatGPT、Claude、Perplexity 以及任何兼容 MCP 的客户端)能够代表 Paxaver 用户执行操作:查看午餐菜单、订购午餐、充值钱包、注册筹款活动、向学校捐款、志愿服务,以及——对于学校管理员——管理餐厅、菜单项、活动和每日订单。
它是一个薄适配器。它不包含任何业务逻辑,也从不直接接触数据库、Stripe 或电子邮件。每个操作都通过 Cloudflare 服务绑定(同区域,无公共网络跳转)委托给私有 Paxaver 后端 API。MCP 服务器的唯一职责是:
MCP 协议处理(JSON-RPC 2.0、Streamable HTTP)
通过集中式 Paxaver 认证 worker 的 JWKS 进行 RS256 JWT 验证
每个工具的能力策略和角色门控
经过清理的、用户安全的错误映射
认证由 Paxaver 认证 worker(auth.paxaver.com)处理,该 worker 充当 OAuth 2.0 / OIDC 授权服务器。MCP 服务器验证生成的 RS256 JWT 并将其转发到后端。MCP 服务器本身不是授权服务器。
Related MCP server: IIITH Mess MCP
架构
┌───────────────┐ MCP (Streamable HTTP) ┌──────────────────────┐
│ AI Client │ ─────────────────────────────▶ │ Paxaver MCP Worker │
│ ChatGPT/Claude│ ◀───────────────────────────── │ (this repo) │
│ /Perplexity │ RS256 JWT + JSON-RPC 2.0 │ Hono + jose │
└───────────────┘ └──────────┬───────────┘
│
Cloudflare service binding
(PAXAVER_API, same region)
│
▼
┌──────────────────────┐
│ Paxaver API Worker │
│ (private backend) │
│ D1 · Stripe · SES │
└──────────────────────┘MCP worker 从不绑定 D1、Stripe 或 SES。服务绑定携带一个短期 JWT(120 秒 TTL,受众为 paxaver-internal),后端将其视为内部调用,同时仍将操作归因于经过认证的 Paxaver 用户。完整说明请参阅 docs/architecture.md。
快速开始
安装
npm install @paxaver/mcp本地开发
# 1. Install dependencies (Node >= 22)
npm install
# 2. Configure local secrets
cp .dev.vars.example .dev.vars # then fill in JWT_SECRET, OAUTH_STATE_SECRET, ...
# 3. Run the worker locally (Miniflare)
npm run dev
# 4. Typecheck, lint, and test
npm run typecheck
npm run lint
npm test本地开发服务器启动于 http://localhost:8787。发现端点位于 /.well-known/ 下;MCP 端点为 POST /mcp。
注意: 在没有
PAXAVER_API服务绑定的情况下进行本地开发时,会回退到通过API_BASE_URL(默认http://localhost:8787)进行认证的 HTTPS。要进行完整的集成测试,请在本地运行 Paxaver 后端 worker,并将API_BASE_URL指向它。
部署
两个环境,每个环境都是一个独立的 Worker,具有自己的自定义域名:
环境 | Worker 名称 | 域名 |
|
|
|
|
|
|
生产 worker 通过单个端点(mcp.paxaver.com)同时服务 CA 和 US 用户。用户区域从 JWT 的 tenant_id 声明中解析,worker 通过服务绑定(PAXAVER_API_CA、PAXAVER_API_US)路由到正确的区域后端。货币由用户所在的学校决定,而不是由 MCP 端点决定。
npm run deploy:staging # wrangler deploy --env staging
npm run deploy:prod # wrangler deploy --env production必须使用 wrangler secret put --env production 设置密钥:JWT_SECRET、OAUTH_STATE_SECRET、GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET、CHATGPT_VERIFY_TOKEN。请参阅 docs/deployment.md。
工具
服务器公开了 31 个工具,分为六个类别。tools/list 中的可见性由调用者的角色过滤;每次调用在分发前都会重新授权,后端会重新检查数据级访问(纵深防御)。
类别 | 工具 |
用户 / 账户 |
|
钱包 |
|
订单与菜单 |
|
活动 |
|
管理 / 餐厅 |
|
财务和破坏性工具已标记,需要用户确认。完整参考:docs/tools.md。授权策略:docs/authorization.md。
文档
文档 | 主题 |
系统架构、服务绑定边界、区域隔离 | |
JWT 验证、JWKS、认证 worker 委托、令牌格式 | |
能力策略表、角色门控、纵深防御 | |
完整的工具参考,包含输入模式和分类 | |
Wrangler 配置、环境、密钥、自定义域名 | |
安全模型、CORS、CSRF、错误清理、标头 | |
MCP 协议版本、传输方式、支持的 AI 客户端 | |
从私有 monorepo 中的旧版 | |
发布历史 | |
漏洞报告策略 | |
开发设置和贡献流程 |
技术栈
运行时: Cloudflare Workers(
compatibility_date: 2026-08-01、nodejs_compat)框架: Hono v4
JWT: jose v6(通过 JWKS 的 RS256)
协议: MCP
2025-06-18、Streamable HTTP认证: 通过集中式认证 worker(
auth.paxaver.com)进行 RS256 JWT 验证构建/部署: Wrangler v4
测试: Vitest v2(Workers 池 + Node 池)
许可证
Apache-2.0。版权所有 (c) 2026 Smartoire。请参阅 LICENSE。
Available Tools
37 toolsadmit_program_registrationAdmit Program Registration (Admin)AInspect
ADMIN: Manually promotes a waitlisted program registration to a seat, regardless of the current capacity count - the backend rejects registrations that are not in waitlist status. Find the waitlisted registration id with list_program_registrations. Requires pac_cordinator role. WRITE - confirm with the user before admitting. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: registration_id (required), school_slug. Returns: id, status
cancel_my_event_registrationCancel My Event RegistrationADestructiveInspect
Cancels one of the authenticated user's own event tickets (ticket_id from list_my_event_registrations). Releases the reserved seats; for paid tickets the full amount is refunded to the user's wallet at that school. Only the ticket owner or a coordinator can cancel. DESTRUCTIVE - confirm with the user before cancelling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: ticket_id (required). Returns: id, status
cancel_my_lunch_orderCancel My Lunch OrderADestructiveInspect
Cancels a finalized order and refunds the charge to the wallet. Only works before order labels have been sent; after that the request is rejected and the order stands. DESTRUCTIVE - confirm with the user before cancelling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: order_id (required). Returns: id, status, refundCents, balanceCents
cancel_my_volunteer_signupCancel My Volunteer SignupADestructiveIdempotentInspect
Cancels one of the authenticated user's own volunteer signups (signup_id from list_my_volunteer_signups) and frees the shift slot for others. No payment is involved. Only the volunteer themselves or an admin can cancel. DESTRUCTIVE - confirm with the user before cancelling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: signup_id (required). Returns: id, status
cancel_program_registrationCancel Program RegistrationADestructiveInspect
Cancels one of the caller's own students' program registrations (registration_id from register_for_program). When the program has a waitlist, the backend automatically promotes the next waitlisted registration. Coordinators manage cancellations through the Paxaver panel. DESTRUCTIVE - confirm with the user before cancelling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: registration_id (required), school_slug. Returns: id, status, promoted
cancel_school_eventCancel School Event (Admin)ADestructiveInspect
ADMIN: Cancels a school event outright; cancelled events cannot be reactivated. For schedule, capacity, or price changes use update_school_event instead. Requires pac_cordinator or event_cordinator role. DESTRUCTIVE - confirm with the user. Get event_id from list_school_events. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: event_id (required). Returns: id, status
check_in_event_ticketCheck In Event Ticket (Admin)AInspect
ADMIN: Marks one attendee ticket as checked in at the door - use ticket ids from list_event_attendees. Only tickets in paid status can be checked in; a repeat call on an already-checked-in ticket is rejected by the backend, so accidental double-calls do not corrupt state. Requires pac_cordinator or event_cordinator role. WRITE - confirm the attendee before checking in. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: ticket_id (required), school_slug. Returns: id, status
create_lunch_order_draftCreate Lunch Order DraftAInspect
Creates an unpaid draft lunch order with one or more items - nothing is charged until pay_lunch_order_draft commits it. Use for multi-item orders or when the user should review the total first; each items entry pairs a menu_item_id with a quantity and optional selected_choices. When get_lunch_menu shows an item has choice groups, ask the user for each required group one at a time, offer the optional groups, then confirm the item, its choices and the total before calling - a required group without a pick is rejected. The draft total is the sum of item prices times quantities plus choice price adjustments. To change or abandon the draft, use update_lunch_order_draft or discard_lunch_order_draft. FINANCIAL - confirm student, items, choices and date before calling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: items (required), menu_date (required), student_id, school_slug. Returns: id, items, status, menuDate, +3 more
create_school_eventCreate School Event (Admin)AInspect
ADMIN: Creates a school event, optionally ticketed, at the active school. To change an existing event use update_school_event; to register a parent for an event use register_for_event. Requires pac_cordinator or event_cordinator role. WRITE - only create on explicit user request. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: name (required), event_date (required), ends_at, location, +5 more. Returns: id, name, status, eventDate
create_school_restaurantCreate School Restaurant (Admin)AInspect
ADMIN: Adds a restaurant to the active school so it can offer menu items via create_restaurant_menu_item. To change an existing restaurant there is no update tool - recreate or manage it in the Paxaver admin. Requires pac_cordinator role. WRITE - confirm with the user. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: name (required), description, school_slug, tax_percent. Returns: id, name, isActive
create_volunteer_shiftCreate Volunteer Shift (Admin)AInspect
ADMIN: Creates a volunteer shift at the active school, optionally attached to an event (event_id must reference an event of the same school). Parents discover the new shift via the event's shifts in get_school_event or the volunteer views in the Paxaver panel, and sign up through sign_up_for_volunteer_shift. Requires pac_cordinator or pac_member role. WRITE - confirm title, date and times with the user before calling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: title (required), end_time (required), shift_date (required), start_time (required), +4 more. Returns: id, slots, title, status, +4 more
discard_lunch_order_draftDiscard Lunch Order DraftADestructiveIdempotentInspect
Permanently discards an unpaid draft order - the caller must own it and it must still be in draft status (order_id from create_lunch_order_draft). Nothing was ever charged, so there is no refund; the draft is simply deleted. For a finalized order use cancel_my_lunch_order instead. DESTRUCTIVE - confirm with the user before discarding. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: order_id (required). Returns: status, orderId
get_my_contextGet My ContextARead-onlyInspect
Read-only lookup with no side effects - safe to call repeatedly. Requires authentication: returns only the caller's own context (never another user's data): first name, sign-in account email, account region, server environment, active school, the students they are a guardian for, their role codes at that school, the assistant mode (parent or child), and whether the account allows assistants to pay from its wallet. This is the context-discovery call - most other tools need a student_id or school_slug from here, admin-role checks come from roles, email/region/environment answer which account is signed in, and assistantMode/assistantWalletSpend tell the model what it may do. A child credential reports assistantMode 'child', only the bound student, no email or roles, and assistantWalletSpend false. Returns live account state, so call again if the user may have switched schools or had roles changed.
Inputs: no named parameters. Returns: email, roles, region, students, +6 more
get_my_wallet_balanceGet My Wallet BalanceARead-onlyInspect
Read-only lookup - never moves funds or has side effects. Requires authentication: returns only the caller's spendable wallet balance at their active school (wallets are scoped per school, so a balance at one school does not apply elsewhere), in cents and formatted. Live value reflecting orders and refunds up to the current moment - recheck before assuming funds are still available. Call before pay_lunch_order_draft or register_for_event to confirm the user can cover the charge; not needed for read-only lookups.
Inputs: no named parameters. Returns: currency, topUpUrl, balanceCents, balanceFormatted
get_school_eventGet School EventARead-onlyIdempotentInspect
Read-only lookup with no side effects - safe to call repeatedly. Returns one event's full detail for the selected school: date, times, location, capacity, ticket price, status, its volunteer shifts with remaining slots (cancelled shifts excluded), and the caller's own signups on those shifts. Get event_id from list_school_events. The shifts' id values are the shift_id input to sign_up_for_volunteer_shift; the mySignups entries' signupId feeds cancel_my_volunteer_signup.
Inputs: event_id (required), school_slug. Returns: id, name, sold, endsAt, +12 more
list_event_attendeesList Event Attendees (Admin)ARead-onlyIdempotentInspect
ADMIN: Read-only attendee list for one school event - the ticket ids needed by check_in_event_ticket, attendee first/last name, ticket quantity, status (paid, reserved, checked_in, cancelled) and check-in time. Contact details and payment data are intentionally not included - this is the minimum needed to run a check-in desk. Paginate with per_page and offset; hasMore says whether another page exists. Requires pac_cordinator or event_cordinator role. Get event_id from list_school_events.
Inputs: event_id (required), offset, per_page, school_slug. Returns: hasMore, perPage, attendees
list_my_event_registrationsList My Event RegistrationsARead-onlyIdempotentInspect
Read-only, no side effects. Returns the authenticated user's own event tickets at their active school - ticket id, event name/date/location, quantity, total paid, and status (paid or checked_in). Cancelled tickets are excluded. The id values returned are required by cancel_my_event_registration. Pair with list_school_events for events the user has not registered for.
Inputs: no named parameters. Returns: tickets
list_my_lunch_ordersList My Lunch OrdersARead-onlyInspect
Returns lunch orders already placed - items, menu date, status, and total - for the authenticated user's students, newest first (up to ~100 most recent). Filters combine with AND: student_id narrows to one student; menu_date and month narrow the date range, and if both are given menu_date wins. With no filters returns recent orders across all of the user's students. Admins (pac_cordinator, lunch_cordinator) see school-wide orders; parents only their own students. For what can be ordered (menu and prices), use get_lunch_menu.
Inputs: month, menu_date, student_id. Returns: orders
list_my_volunteer_signupsList My Volunteer SignupsARead-onlyIdempotentInspect
Read-only, no side effects. Returns the authenticated user's active volunteer signups at their school - signup id, shift title/date/times, and the parent event. Cancelled signups are excluded. The id values returned are required by cancel_my_volunteer_signup.
Inputs: no named parameters. Returns: signups
list_my_wallet_transactionsList My Wallet TransactionsARead-onlyIdempotentInspect
Read-only lookup with no side effects - safe to call repeatedly. Requires authentication: returns only the caller's own wallet transaction history (type, amount, running balance, description, status, timestamps, school) - never card numbers, payment-method identifiers, or checkout links. Defaults to the active school; pass all_schools: true for every school the user belongs to, or student_id (own students only) to narrow to one student. Cursor-paginated, newest first: pass the returned nextCursor as cursor for the next page. topUpUrl is the regional top-up page on the Paxaver site for when the user asks to add funds. Filters combine with AND.
Inputs: end, type, start, cursor, +5 more. Returns: hasMore, perPage, topUpUrl, nextCursor, +1 more
list_program_registrationsList Program Registrations (Admin)ARead-onlyIdempotentInspect
ADMIN: Lists program registrations for the active school - including waitlisted ones - with program name, student name, status, fee and notes. Use it to find the registration id for admit_program_registration or to review enrollment. Optionally filter to one program with program_id (from list_school_programs). Requires pac_cordinator role.
Inputs: program_id, school_slug. Returns: registrations
list_school_eventsList School EventsARead-onlyInspect
Returns upcoming events for the user's active school: date, times, location, and whether registration is closed. The event IDs returned feed register_for_event and get_school_event - call get_school_event on an event for its volunteer shifts (whose IDs feed sign_up_for_volunteer_shift). To review or undo your own registrations and signups, use list_my_event_registrations / cancel_my_event_registration and list_my_volunteer_signups / cancel_my_volunteer_signup. Optionally filter by date range.
Inputs: end_date, start_date. Returns: events
list_school_programsList School ProgramsARead-onlyIdempotentInspect
Returns the active before/after-school, enrichment, and camp programs for the user's active school: name, description, type, dates, price, capacity, and how many seats are already enrolled. The program ids returned feed register_for_program and the program administration tools. Optionally filter by program_type.
Inputs: school_slug, program_type. Returns: programs
list_school_restaurantsList School Restaurants (Admin)ARead-onlyInspect
ADMIN: Lists the active restaurants attached to a school (defaults to the active school). Inactive restaurants are not returned. The restaurant_id values returned are required by list_restaurant_menu_items, create_restaurant_menu_item, update_restaurant_menu_item, archive_restaurant_menu_item, and schedule_lunch_menu_item. Requires pac_cordinator, pac_member, or lunch_cordinator role.
Inputs: school_slug. Returns: restaurants
pay_lunch_order_draftPay Lunch Order DraftAInspect
Commits a draft order from create_lunch_order_draft and charges the wallet for the item total plus optional tip_cents (donated to the school's PAC). Wallet-only: if the balance cannot cover the full total, the call fails with an error directing the user to open the Paxaver panel and top up the wallet balance, then retry - no card payment is offered through this tool. Not for new orders - use create_lunch_order_draft first. FINANCIAL - confirm the total before calling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: order_id (required), tip_cents. Returns: status, orderId, tipCents, itemTotalCents
register_for_eventRegister for EventADestructiveInspect
Registers the authenticated user for a school event and issues tickets to the caller (quantity is the number of tickets bought for the caller, 1 to 20 - there is no per-student split). For paid events quantity times the ticket price is charged to the user's wallet - the call fails on insufficient balance (the error includes the regional Paxaver top-up page for the user to add funds), when the event is sold out, or when registration is closed. To volunteer at an event rather than attend, use sign_up_for_volunteer_shift. FINANCIAL for paid events: before the charge the server asks the user to confirm the total in a form (MCP elicitation); clients that cannot show the form get an error and the user registers in the Paxaver app. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: event_id (required), quantity, school_slug. Returns: id, status, eventId, quantity
register_for_programRegister for ProgramAInspect
Registers one of the caller's own students for a school program (before/after-school care, enrichment, camp). Returns status 'registered' when a seat is available or 'waitlist' when the program is at capacity - the backend enforces the capacity check atomically. The response records the program fee (amountCents) owed; no wallet charge happens on this call. program_id comes from list_school_programs, student_id from get_my_context. WRITE - confirm the student and program before calling. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: program_id (required), student_id (required), notes, school_slug. Returns: id, status, programId, amountCents
sign_outSign OutADestructiveIdempotentInspect
Ends the caller's current Paxaver sign-in for this MCP connection - revokes the session so the next request makes the client ask the user to sign in again. Call this ONLY when the user explicitly asks to sign out, log in again, or switch to a different Paxaver account or region. Deletes no data and changes no settings. An app that holds its own Paxaver credentials cannot be signed out here - the result then says to disconnect in that app or in Paxaver account settings instead.
Inputs: no named parameters. Returns: account, message, signedOut
sign_up_for_volunteer_shiftSign Up for Volunteer ShiftAInspect
Signs the authenticated user up for a specific volunteer shift - no payment involved. shift_id identifies one shift within an event, not the event itself: get it from the event's volunteer shifts in get_school_event. The call fails when the shift is full or cancelled. To attend an event as a guest instead, use register_for_event. WRITE - confirm with the user before signing up. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: shift_id (required). Returns: id, status, shiftId
update_lunch_order_draftUpdate Lunch Order DraftADestructiveIdempotentInspect
Replaces the items and/or menu_date of an unpaid draft order before it is finalized - the caller must own the draft and it must still be in draft status (order_id from create_lunch_order_draft). Pass the complete items list: it replaces the draft's items wholesale and the total is recomputed from menu prices times quantity plus choice adjustments. When an item has choice groups, ask the user for each required group one at a time and pass the picks as selected_choices, same as create_lunch_order_draft. Only draft orders can be updated; once finalized, use cancel_my_lunch_order. WRITE - confirm the new contents, choices and total with the user. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: order_id (required), items, menu_date. Returns: status, orderId
update_school_eventUpdate School Event (Admin)AIdempotentInspect
ADMIN: Partially updates an existing school event - only the provided fields change; omitted fields keep their current values. Use for reschedules, capacity or price changes, and status transitions (cancelled/completed). Prefer cancel_school_event to cancel outright. Requires pac_cordinator or event_cordinator role. WRITE operation - confirm changes with the user. Get event_id from list_school_events. Collect each required input one at a time and confirm the details with the user before calling.
Inputs: event_id (required), name, status, ends_at, +6 more. Returns: id, name, status, eventDate
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 37 tools
Despite 37 tools, the boundaries are mostly crisp: the lunch draft lifecycle (create/update/discard/pay/cancel) is explicitly sequenced, and admin vs. parent variants of events, volunteers, programs and menus are named and described distinctly. A few pairs still require reading descriptions to separate, such as update_restaurant_menu_item(is_active=false) vs. archive_restaurant_menu_item, and update_school_event vs. cancel_school_event, but descriptions disambiguate them well.
Nearly all tools follow a snake_case verb_noun pattern with a consistent prefix scheme for self-scoped operations (list_my_*, cancel_my_*) and admin operations (create_/update_/cancel_/list_ on school resources). Minor deviations exist, e.g. sign_out has no noun and admit_program_registration uses an unusual verb, but overall the convention is predictable.
The 37 tools span several genuinely distinct subdomains (lunch ordering, restaurant/menu admin, events, volunteers, programs, wallet, auth), so each has a plausible owner. Still, the surface is heavy for an MCP server and several tools could plausibly be consolidated (e.g. the four draft-order operations, or list/get event variants), putting it in borderline-heavy territory.
Coverage is broad and lifecycle-aware: draft-to-paid ordering, refund/cancel paths, event create/update/cancel plus check-in and attendance, volunteer shifts and signups, program registration with waitlist and admin admit, and wallet balance/transactions. Known gaps are acknowledged rather than hidden (no restaurant update tool, no wallet top-up, admin program cancellation deferred to the panel), but the restaurant admin surface is asymmetric—create but no update/delete for the restaurant itself.
Maintenance
Related MCP Connectors
Restaurant menus, allergens, opening hours, table reservations, waitlists and orders for AI agents.
Lets AI agents read restaurant menus and place orders with home-based food businesses.
71Enables AI assistants to retrieve event data and execute event management operations in Nunify.
Run your restaurant from an AI client: orders, menu, reports, refunds, payouts and staff.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with the IIIT Hyderabad Mess Management System through natural language, allowing students to view menus, manage meal registrations, check bills, submit feedback, and configure preferences.2911MIT
- AlicenseAqualityCmaintenanceEnables LLMs to interact with the IIIT Hyderabad Mess System to manage meal registrations, view menus, and track billing. It supports conversational commands for tasks like cancelling meals, estimating nutrition, and checking account balances.455AGPL 3.0
- AlicenseAqualityCmaintenanceEnables MCP clients to search and read the free AI School curriculum, including 550+ tracks on AI engineering, governance, security, and applied AI by profession.4MIT
- AlicenseAqualityAmaintenanceEnables reading the school lunch calendar, managing students, placing and changing orders, and tracking deliveries and payments on a My Hot Lunchbox parent account. It signs in server-side with account credentials and exposes 38 MCP tools with confirm-gated write operations.35160 npmMIT