COUNTCOUNT
Sign Up

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.

Terminal
npm install -g @countfinancial/cli

Prerequisites

  • 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 with count 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

Terminal + browser
    • 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

CommandDescription
count initSave client_id and client_secret from COUNT Partners
count loginBrowser OAuth login and token storage
count logoutDelete ~/.count/credentials.json
count statusShow whether credentials and tokens are present
count mcpStart the local COUNT Partner MCP stdio server
count mcp print-configEmit 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.

~/.count/credentials.json
{
  "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:

Terminal
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:

Terminal
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-open

Run count status to verify credentials and tokens are present before configuring MCP.

Next steps

Troubleshooting

SymptomFix
Invalid redirect uri during loginAdd http://127.0.0.1:17845/callback to the partner app redirect URIs in COUNT Partners.
Partner credentials are not configuredRun `count init` with your clientId and clientSecret.
You are not logged inRun `count login` to complete OAuth and store workspace tokens.
MCP tools return 401Run `count login` again to refresh stored tokens.
Windows: 'clientName' is not recognized during loginUpgrade to @countfinancial/cli@0.1.6 or later — older versions broke OAuth URLs containing &.
Windows: browser opens but login page shows an errorUpgrade 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.