@pipeworx/mcp-zoho_crm 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 +21 -0
- package/README.md +39 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +171 -0
- package/tsconfig.json +14 -0
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-zoho_crm
|
|
2
|
+
|
|
3
|
+
Zoho CRM MCP Pack — wraps the Zoho CRM API v6
|
|
4
|
+
|
|
5
|
+
Part of the [Pipeworx](https://pipeworx.io) open MCP gateway.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `zoho_list_records` | List records from a Zoho CRM module (e.g., Leads, Contacts, Deals). |
|
|
12
|
+
| `zoho_get_record` | Get a single record by ID from a Zoho CRM module. |
|
|
13
|
+
| `zoho_search_records` | Search records in a Zoho CRM module using criteria. |
|
|
14
|
+
| `zoho_create_record` | Create a new record in a Zoho CRM module. |
|
|
15
|
+
| `zoho_list_modules` | List all available modules in Zoho CRM. |
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Add to your MCP client config:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"zoho_crm": {
|
|
25
|
+
"url": "https://gateway.pipeworx.io/zoho_crm/mcp"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or use the CLI:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx pipeworx use zoho_crm
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-zoho_crm",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zoho CRM MCP Pack — wraps the Zoho CRM API v6",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "zoho_crm"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-zoho_crm"
|
|
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/zoho_crm",
|
|
4
|
+
"title": "zoho_crm",
|
|
5
|
+
"description": "Zoho CRM MCP Pack — wraps the Zoho CRM API v6",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/zoho_crm",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-zoho_crm",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/zoho_crm/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
* Zoho CRM MCP Pack — wraps the Zoho CRM API v6
|
|
18
|
+
*
|
|
19
|
+
* OAuth: provider = 'zoho_crm', access token via _context.zoho_crm.accessToken.
|
|
20
|
+
* Tools: list/get/search/create records, list modules.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const API = 'https://www.zohoapis.com/crm/v6';
|
|
25
|
+
|
|
26
|
+
interface ZohoContext {
|
|
27
|
+
zoho_crm?: { accessToken: string };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function zohoGet(ctx: ZohoContext, path: string): Promise<unknown> {
|
|
31
|
+
if (!ctx.zoho_crm) {
|
|
32
|
+
return { error: 'connection_required', message: 'Connect your Zoho CRM account at https://pipeworx.io/account' };
|
|
33
|
+
}
|
|
34
|
+
const res = await fetch(`${API}${path}`, {
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: `Zoho-oauthtoken ${ctx.zoho_crm.accessToken}`,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
const text = await res.text();
|
|
41
|
+
throw new Error(`Zoho CRM API error (${res.status}): ${text}`);
|
|
42
|
+
}
|
|
43
|
+
if (res.status === 204) return { data: [] };
|
|
44
|
+
return res.json();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function zohoPost(ctx: ZohoContext, path: string, body: unknown): Promise<unknown> {
|
|
48
|
+
if (!ctx.zoho_crm) {
|
|
49
|
+
return { error: 'connection_required', message: 'Connect your Zoho CRM account at https://pipeworx.io/account' };
|
|
50
|
+
}
|
|
51
|
+
const res = await fetch(`${API}${path}`, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: {
|
|
54
|
+
Authorization: `Zoho-oauthtoken ${ctx.zoho_crm.accessToken}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
body: JSON.stringify(body),
|
|
58
|
+
});
|
|
59
|
+
if (!res.ok) {
|
|
60
|
+
const text = await res.text();
|
|
61
|
+
throw new Error(`Zoho CRM API error (${res.status}): ${text}`);
|
|
62
|
+
}
|
|
63
|
+
return res.json();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const tools: McpToolExport['tools'] = [
|
|
67
|
+
{
|
|
68
|
+
name: 'zoho_list_records',
|
|
69
|
+
description: 'List records from a Zoho CRM module (e.g., Leads, Contacts, Deals).',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object' as const,
|
|
72
|
+
properties: {
|
|
73
|
+
module: { type: 'string', description: 'Module name (e.g., Leads, Contacts, Deals, Accounts)' },
|
|
74
|
+
fields: { type: 'string', description: 'Comma-separated field names to return (e.g., "Last_Name,Email,Phone"). Defaults to common fields.' },
|
|
75
|
+
per_page: { type: 'number', description: 'Records per page (max 200, default 20)' },
|
|
76
|
+
page: { type: 'number', description: 'Page number (default 1)' },
|
|
77
|
+
},
|
|
78
|
+
required: ['module'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'zoho_get_record',
|
|
83
|
+
description: 'Get a single record by ID from a Zoho CRM module.',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object' as const,
|
|
86
|
+
properties: {
|
|
87
|
+
module: { type: 'string', description: 'Module name (e.g., Leads, Contacts, Deals)' },
|
|
88
|
+
id: { type: 'string', description: 'Record ID' },
|
|
89
|
+
},
|
|
90
|
+
required: ['module', 'id'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'zoho_search_records',
|
|
95
|
+
description: 'Search records in a Zoho CRM module using criteria.',
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: 'object' as const,
|
|
98
|
+
properties: {
|
|
99
|
+
module: { type: 'string', description: 'Module name (e.g., Leads, Contacts, Deals)' },
|
|
100
|
+
criteria: { type: 'string', description: 'Search criteria (e.g., "(Last_Name:equals:Smith)")' },
|
|
101
|
+
per_page: { type: 'number', description: 'Records per page (max 200, default 20)' },
|
|
102
|
+
page: { type: 'number', description: 'Page number (default 1)' },
|
|
103
|
+
},
|
|
104
|
+
required: ['module', 'criteria'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'zoho_create_record',
|
|
109
|
+
description: 'Create a new record in a Zoho CRM module.',
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: 'object' as const,
|
|
112
|
+
properties: {
|
|
113
|
+
module: { type: 'string', description: 'Module name (e.g., Leads, Contacts, Deals)' },
|
|
114
|
+
data: { type: 'object', description: 'Record data as key-value pairs (e.g., { "Last_Name": "Smith", "Email": "john@example.com" })' },
|
|
115
|
+
},
|
|
116
|
+
required: ['module', 'data'],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'zoho_list_modules',
|
|
121
|
+
description: 'List all available modules in Zoho CRM.',
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: 'object' as const,
|
|
124
|
+
properties: {},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
130
|
+
const context = (args._context ?? {}) as ZohoContext;
|
|
131
|
+
delete args._context;
|
|
132
|
+
|
|
133
|
+
switch (name) {
|
|
134
|
+
case 'zoho_list_records': {
|
|
135
|
+
const module = args.module as string;
|
|
136
|
+
const fields = (args.fields as string) || 'Last_Name,First_Name,Email,Phone,Company';
|
|
137
|
+
const perPage = (args.per_page as number) ?? 20;
|
|
138
|
+
const page = (args.page as number) ?? 1;
|
|
139
|
+
return zohoGet(context, `/${module}?fields=${encodeURIComponent(fields)}&per_page=${perPage}&page=${page}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
case 'zoho_get_record': {
|
|
143
|
+
const module = args.module as string;
|
|
144
|
+
const id = args.id as string;
|
|
145
|
+
return zohoGet(context, `/${module}/${id}`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
case 'zoho_search_records': {
|
|
149
|
+
const module = args.module as string;
|
|
150
|
+
const criteria = encodeURIComponent(args.criteria as string);
|
|
151
|
+
const perPage = (args.per_page as number) ?? 20;
|
|
152
|
+
const page = (args.page as number) ?? 1;
|
|
153
|
+
return zohoGet(context, `/${module}/search?criteria=${criteria}&per_page=${perPage}&page=${page}`);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
case 'zoho_create_record': {
|
|
157
|
+
const module = args.module as string;
|
|
158
|
+
const data = args.data as Record<string, unknown>;
|
|
159
|
+
return zohoPost(context, `/${module}`, { data: [data] });
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
case 'zoho_list_modules': {
|
|
163
|
+
return zohoGet(context, '/settings/modules');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
default:
|
|
167
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export default { tools, callTool, meter: { credits: 10 }, provider: 'zoho_crm' } 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
|
+
}
|