pipedrive-agent-cli
v0.1.0
Published
CLI and MCP server for the Pipedrive CRM API — deals, persons, organizations, activities, leads, notes, pipelines, products, webhooks, and more
Maintainers
Readme
pipedrive-agent-cli
CLI and MCP server for the Pipedrive CRM API. Manage deals, persons, organizations, activities, leads, notes, pipelines, products, webhooks, and more — from the command line or via AI agents.
Install
npm install -g pipedrive-agent-cliAuthentication
Get your API token from Pipedrive: Settings > Personal Preferences > API
# Option 1: Environment variable (recommended for agents)
export PIPEDRIVE_API_TOKEN="your_token_here"
# Option 2: Interactive login (saves to ~/.pipedrive-cli/config.json)
pipedrive login
# Option 3: Per-command flag
pipedrive deals list --api-key "your_token_here"Resolution order: --api-key flag > PIPEDRIVE_API_TOKEN env var > stored config.
Usage
pipedrive deals list --pretty
pipedrive deals create --title "New Deal" --value 50000 --currency USD
pipedrive deals update 123 --status won
pipedrive persons search --term "Jane"
pipedrive activities create --subject "Follow-up call" --type call --deal-id 123
pipedrive users me --fields data.name,data.emailOutput
All commands output JSON to stdout. Options:
| Flag | Effect |
|------|--------|
| --pretty | Pretty-printed JSON |
| --fields id,title,value | Select specific fields |
| --quiet | Suppress output, exit codes only |
Errors go to stderr as {"error":"message","code":"ERROR_CODE"} with exit code 1.
Commands (44 tools)
| Group | Commands |
|-------|----------|
| deals | list, get, create, update, delete, search, activities, persons |
| persons | list, get, create, update, delete, search, deals |
| organizations | list, get, create, update, delete, search, deals, persons |
| activities | list, get, create, update, delete |
| leads | list, get, create, update, delete, search |
| notes | list, get, create, update, delete |
| pipelines | list, get, deals |
| stages | list, get |
| users | me, list, get |
| search | items, field |
| webhooks | list, create, delete |
| products | list, get, create, update, delete, search |
Run pipedrive <group> <command> --help for detailed usage per command.
MCP Server
For AI agent integrations via the Model Context Protocol:
# Start MCP server (stdio transport)
pipedrive mcpClaude Code config (~/.claude/settings.json):
{
"mcpServers": {
"pipedrive": {
"command": "pipedrive",
"args": ["mcp"],
"env": { "PIPEDRIVE_API_TOKEN": "your_token_here" }
}
}
}All 44 commands register as MCP tools with names like deals_list, persons_create, webhooks_delete.
API Details
- API version: Pipedrive REST API v1 (
https://api.pipedrive.com/v1) - Auth method:
x-api-tokenheader - Response format: All responses wrapped in
{ success: true, data: ... } - Pagination: Offset-based (
--start,--limit) - Rate limits: Token-based budget (~30K tokens/day per seat). Auto-retry on 429 with exponential backoff.
- Update methods: PUT for most resources; PATCH for leads
- Leads: Use UUID string IDs (not integers). Value is a nested
{ amount, currency }object — use--valueand--currencyflags together. - Webhook event actions:
create|change|delete|* - Webhook event objects:
deal|person|organization|activity|lead|product|note|pipeline|stage|user|*
Agent Guide
See AGENTS.md for comprehensive AI agent usage — workflow examples, skill patterns, and tips for automation.
License
MIT
