
ConnectWise PSA
io.github.mspstack由 GitHub 账号 mspstack 发布v0.12.0更新于 Oct 24, 2026
ConnectWise PSA (Manage) MCP server — tickets, time entries, companies, configurations, BYOK
概览
面向 ConnectWise PSA(Manage)的本地 MCP 服务器,让助手以指定成员身份处理工单、工时、公司、排班、发票和配置项。
- 可以做什么
- 搜索、读取、创建和更新服务工单与项目工单,添加讨论或内部备注,并查询看板、状态和优先级,以及单张工单的工时和任务。记录和更新工时,查看自己的工时,查询工作角色与工作类型,列出并提交工时表。查询公司、联系人和公司站点,读取含序列号、IP、操作系统和保修的设备与资产。列出、创建、改期和取消排班条目,并查看成员的时区、工作时间和空闲情况。读取发票、协议和未开票的可计费工时。搜索完整的 ConnectWise API 目录,并对任意路径执行只读 GET 请求。仅限本地部署时,执行只读 T-SQL 查询、查找表和保存查询。
- 适用场景
- 适合希望助手直接在 ConnectWise Manage 中工作的 MSP 技术员、调度和计费人员:查找和更新工单、记录工时、查看排班与可用性,或核对发票和未开票工时。当助手应以某个具体 ConnectWise 成员身份操作、并由该成员的安全角色约束每次调用时,值得安装。
- 运行要求
- 通过 npx 以 stdio 在本地运行(需要 Node.js)。需要 CW_SITE、CW_COMPANY_ID 和 CW_CLIENT_ID(在 developer.connectwise.com 注册的免费集成 clientId),以及成员的 API 密钥 CW_PUBLIC_KEY 和 CW_PRIVATE_KEY;CW_MEMBER_IDENTIFIER 用于启用“我的工单”和“我的工时”工具。可选的 SQL 工具集需要 CW_DB_HOST、CW_DB_NAME、CW_DB_USER 和 CW_DB_PASSWORD,且仅限本地部署实例。另提供 HTTP 传输和 Docker 镜像。
安装
在 SourceWeft 中
- 打开 控制台中的 ConnectWise PSA,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-connectwise-psa
An MCP (Model Context Protocol) server for ConnectWise PSA (Manage) — curated tools across 8 toolsets covering technicians, dispatchers, and billing, plus an escape hatch for the rest of the API and a read-only SQL toolset for on-prem deployments, so an AI assistant works PSA the way each role does:
- Tickets — search / my tickets / full detail with notes, create, update status/priority/owner, add discussion/internal notes, plus board·status·priority discovery and per-ticket time & tasks. Covers service and project tickets — ConnectWise keeps them on separate resources, so the read tools query both and the by-id tools detect which one an id belongs to
- Time — log time against tickets (with work role, work type and CW's Deduct for breaks), review your own time, work-role and work-type lookup, and list & submit your timesheets
- Companies & contacts — fast lookup, contact detail (phones/emails), company sites
- Configurations — devices/assets with serials, IPs, OS, warranty (read-only)
- Dispatch (schedule) — schedule entries (list/mine/create/reschedule/cancel), and members with their timezone, working hours, and free-vs-booked availability
- Invoicing (finance, read-only) — invoices, agreements, and unbilled billable time ready to bill
- SQL (on-prem only) — read-only T-SQL straight against the
cwwebapp_*Manage database for the cross-table reporting REST cannot express, with a searchable schema catalog and a library of saved queries the assistant can grow. Enabled by configuringCW_DB_*; where it is, every session that does not narrow its toolsets has it - Toolsets & personas — enable only what a session needs via the
x-cw-toolsetsheader (orCW_TOOLSETS); presetstech/dispatch/invoicing/all. Default isall— narrow it per session when a smaller surface is wanted. Each tool also reports its toolset as_meta.group, so an aggregator (the MSPStack gateway) can group and switch tools by capability - Per-member API keys (BYOK) — each user supplies their own ConnectWise member keys; ConnectWise enforces that member's security role, and every write is attributed to the actual person
- Transports — stdio for local use, streamable HTTP for shared deployments; Docker image included
Quick start (local, stdio)
Claude Desktop / Claude Code config:
A clientId is required by the ConnectWise API — register a (free) integration at developer.connectwise.com. API member keys are created in ConnectWise under My Account → API Keys (per member) or System → Members → API Members (integration accounts).
HTTP deployment
Or with Docker: docker build -t mcp-connectwise-psa . && docker run -p 3000:3000 -e CW_SITE -e CW_COMPANY_ID -e CW_CLIENT_ID mcp-connectwise-psa
Sessions are held in memory — run a single instance (or sticky sessions).
Access control — bring your own keys (BYOK)
Over HTTP there is no MCP-level role system. Each session presents its own ConnectWise member API keys, and ConnectWise itself is the access control: the member's security role decides what succeeds, and every note and time entry is attributed to that member.
Send your keys on the initialize request (and on every subsequent request in the session):
- A request with no keys is rejected with
401; both key headers are required together. - Keys are never logged. A session is bound to a SHA-256 hash of the key pair; presenting a different pair on the same session id →
403. - Create member API keys in ConnectWise under My Account → API Keys. Each tech uses their own.
Local stdio is single-user and uses the CW_PUBLIC_KEY/CW_PRIVATE_KEY from the environment instead of headers.
Toolsets
Tools are grouped into toolsets so a session only sees the capabilities it needs — a dispatcher doesn't need the invoicing tools, and a small tool surface keeps the assistant focused (and its context cheap). Whether a write actually succeeds is still governed by the member's ConnectWise security role.
Presets bundle keys per persona: tech = tickets + time + companies + configurations · dispatch = tickets + schedule + companies + configurations · invoicing = finance + time + companies · all = every key. The persona presets deliberately exclude sql — a technician surface is not a database surface.
The advanced toolset is the escape hatch (in all, but in no persona preset): cw_find_endpoint searches a bundled catalog of the whole ConnectWise API, and cw_get performs a read-only GET on any path — so an assistant can reach the long tail (procurement, sales, projects, system…) the curated tools don't wrap. To drop it, name the keys or a persona preset instead (x-cw-toolsets: tech).
Select toolsets with a comma list mixing keys and presets:
- HTTP — the
x-cw-toolsetsheader, per session:x-cw-toolsets: dispatchorx-cw-toolsets: tech,finance. - stdio — the
CW_TOOLSETSenv var or--toolsetsflag:CW_TOOLSETS=invoicing.
The default is the all preset — every capability the server is configured for; a client that wants a smaller surface names the keys or persona it needs. Unknown keys in CW_TOOLSETS/--toolsets fail fast; unknown tokens in the x-cw-toolsets header are ignored. The only destructive tool is cw_delete_schedule_entry (dispatch); finance is read-only. cw_db_save_query writes, but to the query-library file — database access itself is SELECT-only by grant.
Exception: the sql toolset
Every other toolset runs on the caller's own ConnectWise keys, so ConnectWise filters what comes back. sql does not: it reads the database through a server-wide read-only login, so its results are not attributed to a member and are not filtered by that member's security role, board restrictions or record permissions.
Configuring CW_DB_* is therefore the decision that matters. Once a server has a database, sql is an ordinary key: it is in all, it is in the default selection, and every session that does not narrow its toolsets can read the whole PSA database. A server without CW_DB_* prunes it silently, so nothing breaks for deployments that never wanted it.
If you need database access for some callers but not others, do it per session (x-cw-toolsets: tech) or in front of the server — an aggregating gateway can tier the cw_db_* tools separately. What bounds the damage on the server side is the login: see the runbook below, and keep it to db_datareader with credential columns denied.
SQL toolset (on-prem database)
Cloud-hosted ConnectWise gives you no database access, so this toolset is for on-prem deployments only. Point it at the Manage database with a login created for exactly this purpose:
That is all it takes: with a database configured the sql toolset is part of the default selection. Naming sql without CW_DB_* fails at startup (a selection that only includes it, like all, is pruned instead). Nothing connects to the database until a session actually uses a tool.
Start from the reporting views. ConnectWise ships denormalized v_rpt_* views that already join board, status, company and contact onto a record — v_rpt_service, v_rpt_time, v_rpt_company, v_rpt_invoices, v_rpt_agreementlist. cw_db_find_table knows them and the base tables behind them; it carries key columns only, because the exact column list is one INFORMATION_SCHEMA query away and is always right for your version.
The saved-query library is the committed core plus a writable overlay at CW_DB_QUERY_LIBRARY (JSON, { version, queries[] }). Overlay entries win by slug, cw_db_save_query appends to it, and scripts/import-queries.mjs fills it from an existing BrightGauge export:
Imported queries stay outside this repository — they are your reporting and can carry company names and rates. On a container, point CW_DB_QUERY_LIBRARY at mounted storage or saved queries die with the container.
The login is the security boundary
There is no statement validation: the server sends the model's SQL to SQL Server as written, so what the login is allowed to do is exactly what can happen. Two scripts set it up and prove it.
Create it — edit the four variables at the top, run as sysadmin. @WhatIf defaults to 1, so the first run only prints the plan:
It creates the login in no server role, adds it to db_datareader in one database, DENYs everything else (EXECUTE, all writes, DDL, BACKUP), and DENYs SELECT on every credential-looking column it discovers — the names move between Manage versions and every MSP adds its own, so they are found rather than hard-coded. Re-running is safe and is how you re-apply the DENYs after an upgrade adds tables. It reports the instance-wide settings that must be off but never changes them: disabling xp_cmdshell can break other applications, so that stays a decision.
Verify it — as the new login, not as an admin:
Every check prints PASS or FAIL: SELECT works, UPDATE/CREATE TABLE are refused (inside a transaction that always rolls back, in case a DENY is missing), xp_cmdshell/sp_OACreate/OPENROWSET(BULK …) are unreachable, a credential column is unreadable, and the login is in no elevated role. One FAIL means do not enable the toolset yet.
Two consequences worth knowing up front:
SELECT *fails on any table with a denied column, rather than returning the other columns. That is the point; the tool's error tells the model to name its columns.- EXECUTE is the permission that matters. With it, "read-only SQL" becomes remote code execution as the SQL Server service account —
xp_cmdshell,sp_OACreate,sp_send_dbmail,xp_dirtreefor NTLM capture.OPENROWSET/BULK INSERTread files with no EXECUTE at all, which is why Ad Hoc Distributed Queries must also be off.
Operationally: prefer a readable AG secondary or a restored reporting copy over the production primary, firewall the SQL port to the MCP host, and keep a SQL Audit or Extended Events session on this login.
Configuration reference
Notes & limits
- Ticket searches default to open tickets; status/board names are exact, text filters are substrings.
- Service and project tickets live on different ConnectWise resources. Read tools take
ticket_type(bothby default) and merge; by-id tools default toautoand detect the resource, which costs one extra lookup — passservice/projectto skip it.cw_create_ticketmakes service tickets only: a project ticket needs a project and a phase. - A break inside a logged span goes in
hours_deduct, withtime_endleft at the real end time. Passing a shortenedhoursinstead makes ConnectWise render an end time that never happened. - Timestamps must have whole seconds — the server normalizes (ConnectWise rejects fractional seconds).
- Time entries require an open time report period in ConnectWise for the entry date; the API's message is passed through when none exists.
/system/myAccountis missing on some on-prem versions — provide the member identifier explicitly (CW_MEMBER_IDENTIFIERorx-cw-member-id) for "my tickets"/"my time".- Discussion notes are customer-visible; internal notes are not — the tools make this explicit. A time entry's note can be copied onto the ticket as Discussion (
add_to_detail), Internal Analysis (add_to_internal), Resolution (add_to_resolution), or none of them — and the result says which. Note that all three off means the note stays on the time entry, not that it becomes internal. cw_db_querystops atmax_rows(default 200) or a ~20,000-character budget and cancels the query server-side; the response says which limit it hit. The per-query deadline is 30 s by default, 120 s at most.- The database connection reads at READ UNCOMMITTED so a reporting scan cannot block a technician saving a ticket. The cost is dirty reads: counts are approximate under concurrent writes. Set
CW_DB_READ_UNCOMMITTED=falseif a report must be exact. SELECT *fails on any table with a DENY'd column — name the columns you need.- Cloud-hosted ConnectWise instances have no database access; the
sqltoolset is on-prem only.
Development
License
来源:README.md,提交 35638a8
工具
0版本历史
2- v0.12.0最新Oct 7, 2026
- v0.11.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分