mcp-connectwise-psa CLAUDE.md

mcp-connectwise-psa CLAUDE.md is an instructions file for coding agents from mspstack/mcp-connectwise-psa. It costs 3,474 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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/mspstack/mcp-connectwise-psa/claude-md
Clone the repo
git clone --depth 1 https://github.com/mspstack/mcp-connectwise-psa

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,474 This file is loaded in full into every session.
When invoked 3,474 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.03474 $0.03474
Opus 5 $0.01737 $0.01737
Sonnet 5 $0.00695 $0.00695
Haiku 4.5 $0.00347 $0.00347

Measured 3d ago against content hash b48ccaf24f34, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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 · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 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.tsToolRegistrar 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-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.tscw_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.tsSqlClient 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.tscw_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.tsgenerated 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.tslexicalRank() 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.tsgenerated 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 · 62 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. 3d 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 (5 stars, last pushed 6d ago), licensed MIT. It adds 3,474 tokens to every session, about $0.0174 per session on Opus 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

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens