Tools
COUNT CLI
The COUNT CLI (@countfinancial/cli) is the supported path for Claude Code, Cursor, and other agent runtimes. It bundles OAuth login and a local MCP server so agents can read and write workspace data without embedding secrets in MCP config files.
Agents vs web connectors
Use the CLI for Claude Code, Cursor, and custom agents. For Claude.ai or ChatGPT web connectors, use the remote MCP server instead.Install
Install globally with npm. The binary is count.
npm install -g @countfinancial/cliPrerequisites
- Node.js 18+ (Node 20+ recommended per the published package).
- A COUNT user account with access to the workspaces your agent needs.
- A partner app created in COUNT Partners.
- Redirect URI registered on that app:
http://127.0.0.1:17845/callback. You can change the port withcount login --port; the registered URI must match exactly.
See API access credentials for how to create a partner app and obtain your clientId and clientSecret.
CLI setup flow
- Install @countfinancial/cli with npm.
- Create a partner app in COUNT Partners and register the loopback redirect URI.
- Run count init with your clientId and clientSecret.
npm install -g @countfinancial/cli count init \ --client-id "<client-id>" \ --client-secret "<client-secret>"
API access credentials →- count login opens partner-signin in your browser.
- Pick the workspace the agent should access.
- Tokens are written to ~/.count/credentials.json with file mode 600.
- The redirect URI must match exactly: http://127.0.0.1:17845/callback
count login
OAuth consent experience →- Run count mcp print-config after login succeeds.
- Paste the JSON into your agent MCP settings — no secrets are embedded in the config.
- The config points at count mcp, which loads credentials from ~/.count/credentials.json at runtime.
count mcp print-config
MCP Server guide →
Commands
| Command | Description |
|---|---|
| count init | Save client_id and client_secret from COUNT Partners |
| count login | Browser OAuth login and token storage |
| count logout | Delete ~/.count/credentials.json |
| count status | Show whether credentials and tokens are present |
| count mcp | Start the local COUNT Partner MCP stdio server |
| count mcp print-config | Emit MCP JSON for Claude Code or Cursor |
Credentials file
After count init and count login, credentials live at ~/.count/credentials.json with file mode 600. Refreshed access tokens are written back automatically during MCP sessions.
{
"apiBaseUrl": "https://api.getcount.com",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"accessToken": "workspace-access-token",
"refreshToken": "workspace-refresh-token",
"workspaceId": "workspace-uuid",
"workspaceName": "Acme Corp",
"requestTimeoutMs": 30000
}Examples use the production API base URL (api.getcount.com).
Init and login examples
Pass --api-url during init to target the production API:
count init \
--client-id "<your-client-id>" \
--client-secret "<your-client-secret>" \
--api-url "https://api.getcount.com"Sign in through the browser to store workspace tokens:
count login
# Optional: custom callback port (must match a registered redirect URI)
count login --port 17845
# Optional: print the sign-in URL instead of opening a browser
count login --no-openRun count status to verify credentials and tokens are present before configuring MCP.
Next steps
- MCP Server — configure Claude Code or Cursor with
count mcp print-config. - API access credentials — create a partner app and register redirect URIs.
- Quickstart — make your first signed API call.
Troubleshooting
| Symptom | Fix |
|---|---|
| Invalid redirect uri during login | Add http://127.0.0.1:17845/callback to the partner app redirect URIs in COUNT Partners. |
| Partner credentials are not configured | Run `count init` with your clientId and clientSecret. |
| You are not logged in | Run `count login` to complete OAuth and store workspace tokens. |
| MCP tools return 401 | Run `count login` again to refresh stored tokens. |
| Windows: 'clientName' is not recognized during login | Upgrade to @countfinancial/cli@0.1.6 or later — older versions broke OAuth URLs containing &. |
| Windows: browser opens but login page shows an error | Upgrade to @countfinancial/cli@0.1.6 or later, or run `count login --no-open` and paste the full URL manually. |
See also Errors & troubleshooting for REST API error codes.
