@pipeworx/mcp-pipedrive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pipeworx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # mcp-pipedrive
2
+
3
+ Pipedrive MCP Pack — wraps the Pipedrive REST API v1
4
+
5
+ Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `pipedrive_list_deals` | List deals from Pipedrive CRM. |
12
+ | `pipedrive_get_deal` | Get a single deal by ID from Pipedrive. |
13
+ | `pipedrive_list_persons` | List persons (contacts) from Pipedrive. |
14
+ | `pipedrive_get_person` | Get a single person (contact) by ID from Pipedrive. |
15
+ | `pipedrive_search` | Search across deals, persons, organizations, products, or files in Pipedrive. |
16
+
17
+ ## Quick Start
18
+
19
+ Add to your MCP client config:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "pipedrive": {
25
+ "url": "https://gateway.pipeworx.io/pipedrive/mcp"
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Or use the CLI:
32
+
33
+ ```bash
34
+ npx pipeworx use pipedrive
35
+ ```
36
+
37
+ ## License
38
+
39
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-pipedrive",
3
+ "version": "0.1.0",
4
+ "description": "Pipedrive MCP Pack — wraps the Pipedrive REST API v1",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "pipedrive"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-pipedrive"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/pipedrive",
4
+ "title": "pipedrive",
5
+ "description": "Pipedrive MCP Pack — wraps the Pipedrive REST API v1",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/pipedrive",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-pipedrive",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/pipedrive/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,147 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ }
15
+
16
+ /**
17
+ * Pipedrive MCP Pack — wraps the Pipedrive REST API v1
18
+ *
19
+ * BYO key: _apiKey (passed as api_token query parameter).
20
+ * Tools: list/get deals, list/get persons, search.
21
+ */
22
+
23
+
24
+ const API = 'https://api.pipedrive.com/v1';
25
+
26
+ async function pdFetch(apiKey: string, path: string): Promise<unknown> {
27
+ const separator = path.includes('?') ? '&' : '?';
28
+ const url = `${API}${path}${separator}api_token=${apiKey}`;
29
+ const res = await fetch(url);
30
+ if (!res.ok) {
31
+ const text = await res.text();
32
+ throw new Error(`Pipedrive API error (${res.status}): ${text}`);
33
+ }
34
+ return res.json();
35
+ }
36
+
37
+ const tools: McpToolExport['tools'] = [
38
+ {
39
+ name: 'pipedrive_list_deals',
40
+ description: 'List deals from Pipedrive CRM.',
41
+ inputSchema: {
42
+ type: 'object' as const,
43
+ properties: {
44
+ _apiKey: { type: 'string', description: 'Pipedrive API token' },
45
+ status: { type: 'string', description: 'Filter by status: open, won, lost, deleted, all_not_deleted (default: all_not_deleted)' },
46
+ start: { type: 'number', description: 'Pagination start (default 0)' },
47
+ limit: { type: 'number', description: 'Number of results (max 500, default 50)' },
48
+ },
49
+ required: ['_apiKey'],
50
+ },
51
+ },
52
+ {
53
+ name: 'pipedrive_get_deal',
54
+ description: 'Get a single deal by ID from Pipedrive.',
55
+ inputSchema: {
56
+ type: 'object' as const,
57
+ properties: {
58
+ _apiKey: { type: 'string', description: 'Pipedrive API token' },
59
+ id: { type: 'number', description: 'Deal ID' },
60
+ },
61
+ required: ['_apiKey', 'id'],
62
+ },
63
+ },
64
+ {
65
+ name: 'pipedrive_list_persons',
66
+ description: 'List persons (contacts) from Pipedrive.',
67
+ inputSchema: {
68
+ type: 'object' as const,
69
+ properties: {
70
+ _apiKey: { type: 'string', description: 'Pipedrive API token' },
71
+ start: { type: 'number', description: 'Pagination start (default 0)' },
72
+ limit: { type: 'number', description: 'Number of results (max 500, default 50)' },
73
+ },
74
+ required: ['_apiKey'],
75
+ },
76
+ },
77
+ {
78
+ name: 'pipedrive_get_person',
79
+ description: 'Get a single person (contact) by ID from Pipedrive.',
80
+ inputSchema: {
81
+ type: 'object' as const,
82
+ properties: {
83
+ _apiKey: { type: 'string', description: 'Pipedrive API token' },
84
+ id: { type: 'number', description: 'Person ID' },
85
+ },
86
+ required: ['_apiKey', 'id'],
87
+ },
88
+ },
89
+ {
90
+ name: 'pipedrive_search',
91
+ description: 'Search across deals, persons, organizations, products, or files in Pipedrive.',
92
+ inputSchema: {
93
+ type: 'object' as const,
94
+ properties: {
95
+ _apiKey: { type: 'string', description: 'Pipedrive API token' },
96
+ term: { type: 'string', description: 'Search term' },
97
+ item_types: { type: 'string', description: 'Comma-separated item types to search: deal, person, organization, product, file (default: all)' },
98
+ limit: { type: 'number', description: 'Max results (default 50)' },
99
+ },
100
+ required: ['_apiKey', 'term'],
101
+ },
102
+ },
103
+ ];
104
+
105
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
106
+ const apiKey = args._apiKey as string;
107
+
108
+ switch (name) {
109
+ case 'pipedrive_list_deals': {
110
+ const status = (args.status as string) ?? 'all_not_deleted';
111
+ const start = (args.start as number) ?? 0;
112
+ const limit = (args.limit as number) ?? 50;
113
+ return pdFetch(apiKey, `/deals?status=${status}&start=${start}&limit=${limit}`);
114
+ }
115
+
116
+ case 'pipedrive_get_deal': {
117
+ const id = args.id as number;
118
+ return pdFetch(apiKey, `/deals/${id}`);
119
+ }
120
+
121
+ case 'pipedrive_list_persons': {
122
+ const start = (args.start as number) ?? 0;
123
+ const limit = (args.limit as number) ?? 50;
124
+ return pdFetch(apiKey, `/persons?start=${start}&limit=${limit}`);
125
+ }
126
+
127
+ case 'pipedrive_get_person': {
128
+ const id = args.id as number;
129
+ return pdFetch(apiKey, `/persons/${id}`);
130
+ }
131
+
132
+ case 'pipedrive_search': {
133
+ const term = encodeURIComponent(args.term as string);
134
+ const limit = (args.limit as number) ?? 50;
135
+ let path = `/itemSearch?term=${term}&limit=${limit}`;
136
+ if (args.item_types) {
137
+ path += `&item_types=${args.item_types as string}`;
138
+ }
139
+ return pdFetch(apiKey, path);
140
+ }
141
+
142
+ default:
143
+ throw new Error(`Unknown tool: ${name}`);
144
+ }
145
+ }
146
+
147
+ export default { tools, callTool, meter: { credits: 10 } } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }