Therapyportal Mcp

io.github.chrischall由 GitHub 账号 chrischall 发布v0.4.1更新于 Nov 7, 2026

TherapyNotes client portal: appointments, documents, billing, messages; confirm-gated sends, uploads

概览

AI 生成的概览

将助手连接到 TherapyPortal(TherapyNotes 来访者门户)账户,读取预约、文件、账单和消息,并可发送消息或上传文件。

可以做什么
  • 列出关联的来访者、即将到来的预约和待处理请求
  • 列出文件请求、常设表单、待办文件数量、余额和收据
  • 以 PDF 形式下载已完成的文件和付款收据
  • 读取安全消息会话和主题,且不标记为已读
  • 发送新消息、回复会话或为文件请求上传文件,每项都需经过确认关卡
适用场景
适合来访者或家长希望助手查看即将到来的治疗预约、待办文书、余额和收据,或在不手动打开门户的情况下起草并发送门户消息、上传所需文件。
运行要求
通过 npx 在本地运行(需要 Node.js)。必须设置 THERAPYPORTAL_PRACTICE,即门户网址中 /p/ 之后的机构代码。server 传输方式需要 THERAPYPORTAL_EMAIL 和 THERAPYPORTAL_PASSWORD,若门户要求出生日期还需 THERAPYPORTAL_DOB;否则通过已登录的浏览器标签页配合桥接扩展转发。可选变量用于设置下载与上传目录以及确认关卡模式。
安装前请注意
它处理心理健康记录:门户凭据以 THERAPYPORTAL_PASSWORD 和 THERAPYPORTAL_DOB 提供,登录被拒后不会重试。有三个工具会向机构写入且无法通过本服务器撤销:发送消息、回复消息、上传文件;它们都受确认关卡保护,且写入格式尚未在真实请求中验证。下载会被机构记录。该项目由 AI 维护,并提示自行斟酌使用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Therapyportal Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

therapyportal-mcp

MCP server for TherapyPortal, the client portal of TherapyNotes (https://www.therapyportal.com/p/<practice>/). It reads upcoming therapy appointments, paperwork the practice sent, the practice's standing forms, balances due, payment receipts and secure messages, and downloads completed documents and receipts as PDFs. It can also send secure messages and upload a file in answer to a document request, each behind a confirm gate.

This project was developed and is maintained by AI. Use at your own discretion. It reads mental-health records, and only ever from the signed-in user's own account.

Not read-only

Most tools are reads. Three are writes, and each one reaches the practice and cannot be undone through this server:

ToolWhat it sendsLook up first with
therapyportal_send_messagea new secure-message conversation, for one client, under a topictherapyportal_list_message_topics
therapyportal_reply_messagea reply in an existing conversation (leaves read state alone unless mark_thread_read)therapyportal_list_message_threads
therapyportal_upload_documenta file (local path, inline base64, or an upload slot when hosted) in answer to a pending document request, or an upload-required always-available formtherapyportal_list_documents, therapyportal_list_forms

All three are annotated destructive and confirm-gated (see below). The server signs no form, fills in no form and makes no payment. Anything that needs a signature (PatientSignatureRequired) is refused, with a pointer to the portal. A download is logged by the practice, the same way the portal logs the click.

On the privacy side, therapyportal_list_clients returns names and date of birth only. The portal's client record also carries the address, phones, email, an SSN field, billing notes and free-text comments, and none of those are ever passed through, on any view.

Tools

ToolWhat it returns
therapyportal_list_clientsthe clients linked to this login (for a parent, each child), with the patientId other tools take
therapyportal_list_appointmentsupcoming appointments: time, clinician, telehealth or location, which client; pending requests; practice phone. The portal shows no past visits
therapyportal_list_documentspaperwork requests (pending / completed / all) and their documents, with portalDocumentId and whether each needs an upload or a signature
therapyportal_list_formsthe practice's always-available forms (sign or upload as needed), with libraryDocumentId
therapyportal_get_document_countsper client, documents waiting to be completed or approved
therapyportal_list_balancesthe balance due per client, and whether autopay is on
therapyportal_list_receiptspayments, with the dates of service each covered, and paymentId
therapyportal_list_message_threadsone client's secure-message conversations (does not mark read)
therapyportal_get_thread_messagesthe messages in one conversation (does not mark read)
therapyportal_download_documenta completed form (rendered to PDF) or a file the practice uploaded
therapyportal_download_receipta payment receipt PDF
therapyportal_list_message_topicsthe topics a client can message (topicId, and whether each reaches clinical, billing or administrative staff), whether messaging is on, and whether the client has an assigned clinician
therapyportal_send_messagewrite. Start a new conversation (confirm-gated)
therapyportal_reply_messagewrite. Reply in a conversation (confirm-gated)
therapyportal_upload_documentwrite. Upload a PDF, JPG, JPEG, PNG, HEIC or DOCX (max 25 MB) for a document that asks for one (confirm-gated)
therapyportal_upload_slothosted only: a signed URL to PUT one file to, whose blobKey therapyportal_upload_document then takes. Sends nothing to the practice
therapyportal_healthcheckconnectivity, from whichever transport is live

Read tools take view. The default is compact (projected to the useful fields); full and raw return more. Text the practice wrote (document titles, instructions, messages) comes back inside an untrusted-content envelope.

Message tools are not verified against real messages. The account this was built against had none, so the thread and message reads return the portal's payload exactly as sent rather than a projection.

Writes

The three writes are derived from the portal's own JavaScript (SecureMessagingDataService, CreateMessageViewV2, ThreadViewV2, DocumentsDataService, the document view controllers and xhrfileuploader) and are UNVERIFIED on the wire: no automated run sends a message or uploads a file, because each one reaches the practice. An owner-supervised live test confirms them later. The lookups they make first (messaging settings, topics, the assigned-clinician check, the document and form lists) were verified live, read-only.

Before showing a preview, each write checks against live reads: the client is one of yours (therapyportal_list_clients), the practice has secure messaging turned on, the topic exists for that client, and, for an upload, that the document or form exists, is not completed, asks for an upload and needs no signature.

  • Messages. Plain text, 1 to 5000 characters, sent as the portal's editor sends it (one HTML paragraph per line). A practice may refuse new messages after several unanswered ones; a refusal says so. Archived conversations cannot be replied to.

  • Uploads. Give exactly one source:

    • file_path (local installs): the file must be inside THERAPYPORTAL_UPLOAD_DIR (default ~/Downloads, ~/Documents or ~/Desktop) and be a regular file (no symlinks). A hosted server refuses file_path with a "this server is remote" error: it cannot see the caller's files.
    • inline ({filename, content_base64, mime_type?}): the bytes as base64, strictly decoded (a truncated or mangled payload is refused, not sent). Works anywhere, but every byte rides in one request; keep it small.
    • blob_key (hosted): call therapyportal_upload_slot with the filename, PUT the file to the returned uploadUrl (its curl does exactly that), then pass the blobKey. The preview reads the uploaded copy and binds its SHA-256; the confirmed call re-reads it (a changed file is refused) and deletes it only once the portal accepted the upload. A failed or unconfirmed upload keeps it; a failed delete is reported, not thrown.

    Every source gets the same checks: an allowlisted extension, contents that match it, at most 25 MB, and the SHA-256 in the preview. Legacy .doc is refused (its format cannot be checked before upload); save it as PDF or .docx. The file is staged in 100 KB segments, validated by the portal, and only then submitted. Only the submit reaches the practice.

  • Sent once. A write is posted exactly once. It is never replayed after a re-sign-in, on either transport. A send the portal answers with a 5xx, or whose connection drops, is reported as status: "unknown" rather than as an error, so a model checks the matching list before trying again instead of sending twice.

Confirm gate

Every write is gated by @chrischall/mcp-utils' confirmWrite, through its defineWrite / registerWrite. The first call sends nothing and returns a preview + a confirmToken; only a second call carrying that token, after you approve the preview, sends. The exact request (for an upload, the file's name, type, size and SHA-256) and the shown preview are bound into the token, so an argument, file or portal state that changed since the preview is refused as DRAFT_CHANGED. Values that change on every send (the upload guid, the document date) are made at send time and are not bound. Practice-written text in a preview or a result (topic names, document titles, the returned conversation) is wrapped as untrusted content. MCP_CONFIRM_MODE / MCP_CONFIRM_ELICITATION tune the gate (see Configuration).

Transports

Server (default when credentials are set)Browser bridge
Howsigns in itself with your email and password; holds a cookie jar in memoryrelays every request through your signed-in Chrome tab via the ContextMint Bridge extension
NeedsTHERAPYPORTAL_EMAIL, THERAPYPORTAL_PASSWORD (and THERAPYPORTAL_DOB if the portal asks)the extension, and a signed-in portal tab
Hostable (claude.ai, phone)yesonly as a bridged registration
Downloadswritten to THERAPYPORTAL_OUTPUT_DIR, or inlinesaved by the browser to its download folder

The two can run side by side. A server-side sign-in does not end your browser's portal session (checked live), and the portal signs out an idle browser tab on its own after a while; that is the usual reason the bridge reports "not signed in".

A rejected password or date of birth is never retried. The date-of-birth check locks after a few wrong dates, so the server tries it once.

Configuration

Variable
THERAPYPORTAL_PRACTICErequired. The code after /p/ in your portal URL (a full URL also works)
THERAPYPORTAL_EMAILthe email you sign in with
THERAPYPORTAL_PASSWORDyour portal password
THERAPYPORTAL_DOBonly if the portal asks for a date of birth at sign-in: MM/DD/YYYY (M/D/YYYY and YYYY-MM-DD are accepted)
THERAPYPORTAL_TRANSPORTserver or fetchproxy. Default: server when email and password are set
THERAPYPORTAL_WS_PORTfetchproxy concentrator port, default 37149 (shared by the whole fleet)
THERAPYPORTAL_OUTPUT_DIRwhere downloads are written (path-delimiter list; ~ expands). Default ~/Downloads and ~/Documents; a per-call dest must be inside one
THERAPYPORTAL_INLINE_DOWNLOADStrue returns downloads inline (base64), for a hosted runner
THERAPYPORTAL_UPLOAD_DIRwhere an upload's file_path must be (path-delimiter list; ~ expands). Default ~/Downloads, ~/Documents and ~/Desktop. Ignored when hosted, where file_path is refused (use therapyportal_upload_slot + blob_key, or inline)
MCP_CONFIRM_MODEconfirm-gate mode for every write. ask-user (default) = preview + confirmToken round-trip; auto lets a capable host confirm in one step; an unrecognised value fails closed (refuse)
MCP_CONFIRM_ELICITATIONon (default) lets the host confirm a write interactively; off forces the confirmToken round-trip
FETCHPROXY_WS_HOST, FETCHPROXY_IDENTITY_DIRfetchproxy bind address and identity directory (advanced)

Copy .env.example to .env for a local install.

json
{  "mcpServers": {    "therapyportal": {      "command": "npx",      "args": ["-y", "@chrischall/therapyportal-mcp"],      "env": { "THERAPYPORTAL_PRACTICE": "<code>" }    }  }}

Without the server

skills/therapyportal-fpx does the same reads (not the writes) from a shell with the fpx CLI, through the signed-in tab. See its SKILL.md.

Development

sh
npm installnpm run buildnpm test                 # typecheck + vitest, all mockednpm run test:coverage    # 100% threshold

The wire protocol (tokens, sign-in, download jobs, the write shapes) is in docs/THERAPYPORTAL-API.md.

来源:README.md,提交 5b137ca

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v0.4.1最新Nov 7, 2026
  2. v0.3.1Nov 4, 2026
  3. v0.2.0Oct 29, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分