mcp-connectwise-psa: Instructions file for Claude Code

CLAUDE.md

mcp-connectwise-psa CLAUDE.md is an instructions file for Claude Code from mspstack/mcp-connectwise-psa. It costs 3,725 tokens per session, scanned A, original, MIT.

A set of project instructions for an MCP server that connects Claude Code to ConnectWise PSA, a business system for managing IT services.

In plain words
What is it for?
Building, testing, running, and troubleshooting the ConnectWise PSA integration.
Why use it?
It documents the commands, project structure, authentication, API query rules, and database details needed to work on the server correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is mspstack/mcp-connectwise-psa's own configuration. It tells Claude Code how to work on mcp-connectwise-psa itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-connectwise-psa configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mspstack/mcp-connectwise-psa. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mspstack/mcp-connectwise-psa/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/mspstack/mcp-connectwise-psa

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-connectwise-psa CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mspstack/mcp-connectwise-psa/claude-md/github.svg)](https://agentmods.dev/instructions/mspstack/mcp-connectwise-psa/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/mspstack/mcp-connectwise-psa/claude-md"><img src="https://agentmods.dev/badge/instructions/mspstack/mcp-connectwise-psa/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-connectwise-psa CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mspstack/mcp-connectwise-psa/claude-md"><img src="https://agentmods.dev/badge/instructions/mspstack/mcp-connectwise-psa/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,725 This file is loaded in full into every session.
When invoked 3,725 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03725 $0.03725
Opus 5.5 $0.01490 $0.01490
Sonnet 5.5 $0.00745 $0.00745
Haiku 4.5 $0.00373 $0.00373

Measured 1mo ago against content hash 832e91cc93af, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-connectwise-psa CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mcp-connectwise-psa

MCP server for ConnectWise PSA (Manage). TypeScript, ESM, Node ≥20. Transports: stdio (local) and streamable HTTP (shared deployments). Sibling project to mcp-itglue — same auth architecture.

Commands

  • npm run build — tsc → dist/ (tests excluded from build)
  • npm test — vitest, test files beside sources (src/**/*.test.ts)
  • npm run dev / npm run dev:http — run from source via tsx

Architecture

  • src/config.ts — env/flag parsing; CW_SITE accepts full URLs (normalized to host)
  • src/cw/client.ts — fetch-based CW Manage REST client (API 3.0). Basic auth companyId+publicKey:privateKey + mandatory clientId header. List queries use CW's grammar: conditions (exact for names/ids, contains for text, date literals in [brackets]), orderBy, page/pageSize, and fields (always pass fields — CW records are huge). q() quotes condition values; allOf() joins fragments
  • src/tools/registrar.ts — ToolRegistrar registers the full tool surface; no MCP-level role gating (ConnectWise enforces the member's security role — unlike mcp-itglue's single account key, PSA is per-member BYOK)
  • src/http/app.ts — pure BYOK: every /mcp session presents its own x-cw-public-key/x-cw-private-key (+ optional x-cw-member-id) headers; no keys → 401; sessions bound to the SHA-256 of the key pair; a different pair on the same session id → 403. stdio uses the server-wide CW_PUBLIC_KEY/CW_PRIVATE_KEY
  • src/server.ts — one McpServer per session; the session's CW credentials build its CWClient. Holds the TOOLSETS registry (key → register*Tools); createServer registers only session.toolsets
  • src/tools/toolsets.ts — capability keys (tickets/time/companies/configurations/schedule/finance/advanced/sql), persona presets (tech/dispatch/invoicing/all), and resolveToolsets(). Selection: CW_TOOLSETS/--toolsets (stdio, unknown key → ConfigError) or the x-cw-toolsets header (HTTP, unknown token ignored). all and DEFAULT_TOOLSETS are both [...TOOLSET_KEYS] — advanced and sql are ordinary keys there, though the persona presets exclude both. What gates the database is CW_DB_*: withoutDbToolsets() prunes DB_TOOLSETS in loadConfig, sessionToolsets and createServer when no database is configured, and loadConfig only errors when sql was named outright (namesDbToolset) — otherwise a server without a database would refuse to start over the default it never chose
  • src/tools/ — tickets, time, companies, configurations (tech); schedule (dispatch); finance (invoicing, read-only); advanced (opt-in escape hatch); helpers in tools/shared.ts
  • src/tools/ticket-classification.ts — board-scoped classification (type→subType→item, team, source) and bundling helpers. Values are passed as name or id and sent as {name}/{id} for CW to resolve against the ticket's board — no local resolver, since the same name means a different id per board (cw_get_board lists statuses, types, sub-types, items and teams for discovery). copy_classification_from on cw_create_ticket lifts those fields by id off an existing ticket; explicit args win. partitionBundleCandidates refuses a child that already has a parent instead of re-parenting it — detaching is UI-only, so a wrong bundle is expensive to undo
  • src/tools/ticket-kind.ts — service vs project tickets. CW splits them across /service/tickets and /project/tickets with different chargeToType values, so: list tools take ticket_type (both default) and go through listAcrossKinds (one resource failing yields a partial answer plus a note, never an error — a security role can allow one and refuse the other); by-id tools take auto|service|project and resolveTicketKind probes service then project, treating only 404 as "try the other one". TICKET_LIST_FIELDS is deliberately identical for both resources — one unknown field fails the whole call
  • src/tools/advanced.ts — cw_get (read-only GET on any path via CWClient.rawGet; strips host//apis/3.0/inline query, then passes conditions/fields/orderBy/page) and cw_find_endpoint (lexical search over src/reference/cw-endpoints.ts). Write passthrough is a deliberate later add
  • src/sql/client.ts — SqlClient over the on-prem cwwebapp_* database: lazy await import("mssql") (CJS → .default), one process-wide pool created in index.ts (never per session — the login is server-wide), cleared on a failed connect so an outage isn't permanent. Results are bounded while streaming (request.stream + cancel() at the row cap / ~20k char budget) — slicing afterwards would OOM on SELECT * FROM SR_Service. Isolation is READ UNCOMMITTED via options.connectionIsolationLevel, not a prepended SET (which shifts SQL error line numbers). describeSqlError gives connection errors fixed prose and statement errors the redacted server text; redactSqlMessage strips host/db/user. No statement validation — the db_datareader login is the boundary (deliberate; see README)
  • src/sql/library.ts — saved-query library: committed core (src/reference/cw-db-queries.ts) ∪ writable overlay at CW_DB_QUERY_LIBRARY, overlay wins by slug, mtime-based reload, atomic .tmp+rename write, in-process promise chain for concurrent saves. cw_db_save_query is the only tool in the server that writes anything — and it writes to that file, never to ConnectWise
  • src/tools/sql.ts — cw_db_query (shape-adaptive rendering: pipe table ≤10 columns, record blocks above), cw_db_find_table, cw_db_find_query, cw_db_save_query (registered only when the library is writable). Takes a SqlContext { client, library } as the third registrar argument
  • src/reference/cw-db-schema.ts — generated table catalog (84 entries) from scripts/gen-db-schema.mjs + the hand annotations in scripts/db-enrich.mjs. Curated core only, never a full inventory: no row counts, no custom/UDF tables, nothing identifying an instance — the repo is public. Names came from reading production reporting queries; scripts/dump-db-schema.sql + the generator's dump mode verify them against a live schema
  • src/reference/search.ts — lexicalRank() shared by cw_find_endpoint, cw_db_find_table and the query library; findEndpoints kept its signature so advanced.test.ts stayed untouched through the extraction
  • src/reference/cw-endpoints.ts — generated endpoint catalog (~1145 paths). CW publishes no fetchable OpenAPI (swagger UI is behind the Manage web login), so a spec is obtained manually and scripts/gen-endpoints.mjs derives this file from it (source kept local under .claude/, gitignored; the generated .ts is committed). Hand annotations (better summaries + keyParams/commonFields/coveredBy) live in the generator's ENRICH map; /count and /info helper paths are dropped

Read the full file on GitHub · 64 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines · +251 tokens per session 832e91cc93af
  2. 2mo ago First seen · 62 lines · 3,474 tokens per session scan A b48ccaf24f34

Subscribe to this mod's changes

mcp-connectwise-psa CLAUDE.md is an instructions file published in the GitHub repository mspstack/mcp-connectwise-psa (6 stars, last pushed 1mo ago), licensed MIT. It adds 3,725 tokens to every session, about $0.0149 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mcp-connectwise-psa CLAUDE.md compared with instructions from other repositories

mcp-connectwise-psa CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-connectwise-psa CLAUDE.mdmspstack/mcp-connectwise-psaInstructions file61mo agoMITA3,725Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file279kyesterdayMITA4,325Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,086GitHub Copilot