keap-mcp-server 1.0.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/README.md +216 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/keap-client.d.ts +23 -0
- package/dist/keap-client.d.ts.map +1 -0
- package/dist/keap-client.js +65 -0
- package/dist/keap-client.js.map +1 -0
- package/dist/tools/admin.d.ts +3 -0
- package/dist/tools/admin.d.ts.map +1 -0
- package/dist/tools/admin.js +190 -0
- package/dist/tools/admin.js.map +1 -0
- package/dist/tools/affiliates.d.ts +3 -0
- package/dist/tools/affiliates.d.ts.map +1 -0
- package/dist/tools/affiliates.js +78 -0
- package/dist/tools/affiliates.js.map +1 -0
- package/dist/tools/calendar.d.ts +3 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +149 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/crm.d.ts +3 -0
- package/dist/tools/crm.d.ts.map +1 -0
- package/dist/tools/crm.js +352 -0
- package/dist/tools/crm.js.map +1 -0
- package/dist/tools/ecommerce.d.ts +3 -0
- package/dist/tools/ecommerce.d.ts.map +1 -0
- package/dist/tools/ecommerce.js +159 -0
- package/dist/tools/ecommerce.js.map +1 -0
- package/dist/tools/events.d.ts +3 -0
- package/dist/tools/events.d.ts.map +1 -0
- package/dist/tools/events.js +64 -0
- package/dist/tools/events.js.map +1 -0
- package/dist/tools/marketing.d.ts +3 -0
- package/dist/tools/marketing.d.ts.map +1 -0
- package/dist/tools/marketing.js +162 -0
- package/dist/tools/marketing.js.map +1 -0
- package/dist/tools/raw.d.ts +3 -0
- package/dist/tools/raw.d.ts.map +1 -0
- package/dist/tools/raw.js +19 -0
- package/dist/tools/raw.js.map +1 -0
- package/dist/tools/sales.d.ts +3 -0
- package/dist/tools/sales.d.ts.map +1 -0
- package/dist/tools/sales.js +83 -0
- package/dist/tools/sales.js.map +1 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Keap MCP Server
|
|
2
|
+
|
|
3
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides unified access to the **Keap CRM API** (both v1 and v2 endpoints) through a single, logically organized interface.
|
|
4
|
+
|
|
5
|
+
This server exposes **80+ tools** covering every major Keap resource, including critical v1-only features like **webhooks**, **appointments**, and **campaign goal triggers** that are missing from the v2 API.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
npm run build
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
Set your Keap API key as an environment variable:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
export KEAP_API_KEY="KeapAK-your-api-key-here"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### With Claude Desktop
|
|
25
|
+
|
|
26
|
+
Add this to your `claude_desktop_config.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"keap": {
|
|
32
|
+
"command": "node",
|
|
33
|
+
"args": ["/path/to/keap-mcp-server/dist/index.js"],
|
|
34
|
+
"env": {
|
|
35
|
+
"KEAP_API_KEY": "KeapAK-your-api-key-here"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### With Manus
|
|
43
|
+
|
|
44
|
+
Add as an MCP server configuration:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"name": "keap",
|
|
49
|
+
"command": "node",
|
|
50
|
+
"args": ["/path/to/keap-mcp-server/dist/index.js"],
|
|
51
|
+
"env": {
|
|
52
|
+
"KEAP_API_KEY": "KeapAK-your-api-key-here"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Standalone (stdio)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
KEAP_API_KEY="KeapAK-..." node dist/index.js
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Development
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
KEAP_API_KEY="KeapAK-..." npx tsx src/index.ts
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Tool Reference
|
|
70
|
+
|
|
71
|
+
### CRM (25 tools)
|
|
72
|
+
|
|
73
|
+
| Tool | Description |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `list_contacts` | List contacts with filtering and pagination |
|
|
76
|
+
| `get_contact` | Retrieve a specific contact |
|
|
77
|
+
| `create_contact` | Create a new contact |
|
|
78
|
+
| `update_contact` | Update an existing contact |
|
|
79
|
+
| `delete_contact` | Delete a contact |
|
|
80
|
+
| `get_contact_model` | Get the contact data model (including custom fields) |
|
|
81
|
+
| `create_contact_custom_field` | Create a custom field on the Contact model |
|
|
82
|
+
| `get_contact_emails` | List emails sent to a contact *(v1)* |
|
|
83
|
+
| `get_contact_tags` | List tags on a contact *(v1)* |
|
|
84
|
+
| `link_contacts` | Create a link between two contacts |
|
|
85
|
+
| `list_companies` | List companies |
|
|
86
|
+
| `get_company` | Retrieve a specific company |
|
|
87
|
+
| `create_company` | Create a new company |
|
|
88
|
+
| `update_company` | Update a company |
|
|
89
|
+
| `delete_company` | Delete a company |
|
|
90
|
+
| `list_tags` | List all tags |
|
|
91
|
+
| `get_tag` | Retrieve a specific tag |
|
|
92
|
+
| `create_tag` | Create a new tag |
|
|
93
|
+
| `update_tag` | Update a tag |
|
|
94
|
+
| `delete_tag` | Delete a tag |
|
|
95
|
+
| `apply_tag_to_contacts` | Apply a tag to contacts |
|
|
96
|
+
| `remove_tag_from_contacts` | Remove a tag from contacts |
|
|
97
|
+
| `list_tagged_contacts` | List contacts with a specific tag |
|
|
98
|
+
| `create_tag_category` | Create a tag category |
|
|
99
|
+
| `list_notes` / `get_note` / `create_note` / `update_note` / `delete_note` | Full CRUD for notes |
|
|
100
|
+
|
|
101
|
+
### Sales (7 tools)
|
|
102
|
+
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `list_opportunities` | List opportunities/deals |
|
|
106
|
+
| `get_opportunity` | Retrieve a specific opportunity |
|
|
107
|
+
| `create_opportunity` | Create a new opportunity |
|
|
108
|
+
| `update_opportunity` | Update an opportunity |
|
|
109
|
+
| `delete_opportunity` | Delete an opportunity |
|
|
110
|
+
| `list_pipelines` | List sales pipelines |
|
|
111
|
+
| `get_pipeline` | Retrieve a specific pipeline |
|
|
112
|
+
|
|
113
|
+
### Marketing (16 tools)
|
|
114
|
+
|
|
115
|
+
| Tool | Description |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `list_campaigns` | List all campaigns |
|
|
118
|
+
| `get_campaign` | Retrieve a specific campaign |
|
|
119
|
+
| `list_campaign_sequences` | List sequences in a campaign |
|
|
120
|
+
| `add_contacts_to_campaign_sequence` | Add contacts to a campaign sequence |
|
|
121
|
+
| `remove_contacts_from_campaign_sequence` | Remove contacts from a sequence |
|
|
122
|
+
| `achieve_campaign_goal` | **Trigger a campaign goal** *(v1 only — critical for automation)* |
|
|
123
|
+
| `list_automations` | List automations |
|
|
124
|
+
| `get_automation` | Retrieve a specific automation |
|
|
125
|
+
| `add_contact_to_automation` | Add contacts to an automation |
|
|
126
|
+
| `list_emails` / `get_email` / `create_email` / `delete_email` | Email management |
|
|
127
|
+
| `list_webforms` | List webforms |
|
|
128
|
+
| `get_webform_html` | Get webform HTML |
|
|
129
|
+
|
|
130
|
+
### E-Commerce (18 tools)
|
|
131
|
+
|
|
132
|
+
| Tool | Description |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `list_orders` / `get_order` / `create_order` / `delete_order` | Order management |
|
|
135
|
+
| `list_order_items` | List items in an order |
|
|
136
|
+
| `list_order_payments` | List payments for an order |
|
|
137
|
+
| `list_transactions` | List transactions *(v1)* |
|
|
138
|
+
| `list_products` / `get_product` / `create_product` / `update_product` / `delete_product` | Product management |
|
|
139
|
+
| `list_subscriptions` / `get_subscription` | Subscription management |
|
|
140
|
+
| `list_payment_method_configs` | List payment configurations |
|
|
141
|
+
|
|
142
|
+
### Affiliates (8 tools)
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
|---|---|
|
|
146
|
+
| `list_affiliates` / `get_affiliate` / `create_affiliate` | Affiliate management |
|
|
147
|
+
| `list_affiliate_commissions` | List commissions *(v1)* |
|
|
148
|
+
| `list_affiliate_programs` | List commission programs *(v1)* |
|
|
149
|
+
| `list_affiliate_redirects` | List redirect links *(v1)* |
|
|
150
|
+
| `list_affiliate_clawbacks` | List clawbacks *(v1)* |
|
|
151
|
+
| `list_affiliate_payments` | List payments *(v1)* |
|
|
152
|
+
|
|
153
|
+
### Calendar (11 tools)
|
|
154
|
+
|
|
155
|
+
| Tool | Description |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `list_appointments` / `get_appointment` / `create_appointment` / `update_appointment` / `delete_appointment` | **Full appointment CRUD** *(v1 only)* |
|
|
158
|
+
| `list_tasks` / `get_task` / `create_task` / `update_task` / `delete_task` | Full task CRUD |
|
|
159
|
+
| `search_tasks` | Advanced task search *(v1)* |
|
|
160
|
+
|
|
161
|
+
### Events — Webhooks (7 tools)
|
|
162
|
+
|
|
163
|
+
| Tool | Description |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `list_webhooks` | List all webhook subscriptions *(v1)* |
|
|
166
|
+
| `create_webhook` | Create a webhook subscription *(v1)* |
|
|
167
|
+
| `get_webhook` | Retrieve a webhook *(v1)* |
|
|
168
|
+
| `update_webhook` | Update a webhook *(v1)* |
|
|
169
|
+
| `delete_webhook` | Delete a webhook *(v1)* |
|
|
170
|
+
| `list_webhook_event_types` | List available event types *(v1)* |
|
|
171
|
+
| `verify_webhook` | Verify a webhook *(v1)* |
|
|
172
|
+
|
|
173
|
+
### Admin (18 tools)
|
|
174
|
+
|
|
175
|
+
| Tool | Description |
|
|
176
|
+
|---|---|
|
|
177
|
+
| `get_account_profile` / `update_account_profile` | Account profile management |
|
|
178
|
+
| `get_app_configuration` / `get_app_status` | Application settings |
|
|
179
|
+
| `list_users` / `get_user` / `create_user` | User management (create is *v1 only*) |
|
|
180
|
+
| `get_user_info` / `get_user_signature` | User details |
|
|
181
|
+
| `list_files` / `get_file` / `upload_file` / `delete_file` | File management |
|
|
182
|
+
| `list_reports` / `get_report` / `run_report` | Reporting |
|
|
183
|
+
| `list_countries` / `list_provinces` | Locale data |
|
|
184
|
+
| `get_contact_option_types` | Contact option types |
|
|
185
|
+
|
|
186
|
+
### Raw API Access (1 tool)
|
|
187
|
+
|
|
188
|
+
| Tool | Description |
|
|
189
|
+
|---|---|
|
|
190
|
+
| `keap_api_request` | Make a raw request to **any** Keap v1 or v2 endpoint |
|
|
191
|
+
|
|
192
|
+
## Architecture
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
keap-mcp-server/
|
|
196
|
+
├── src/
|
|
197
|
+
│ ├── index.ts # Entry point, server setup
|
|
198
|
+
│ ├── keap-client.ts # HTTP client for Keap API
|
|
199
|
+
│ └── tools/
|
|
200
|
+
│ ├── crm.ts # Contacts, Companies, Tags, Notes
|
|
201
|
+
│ ├── sales.ts # Opportunities, Pipelines
|
|
202
|
+
│ ├── marketing.ts # Campaigns, Automations, Email, Webforms
|
|
203
|
+
│ ├── ecommerce.ts # Orders, Products, Subscriptions
|
|
204
|
+
│ ├── affiliates.ts # Affiliate management
|
|
205
|
+
│ ├── calendar.ts # Appointments, Tasks
|
|
206
|
+
│ ├── events.ts # Webhooks (REST Hooks)
|
|
207
|
+
│ ├── admin.ts # Account, Users, Files, Reporting
|
|
208
|
+
│ └── raw.ts # Generic API request tool
|
|
209
|
+
├── package.json
|
|
210
|
+
├── tsconfig.json
|
|
211
|
+
└── README.md
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Keap MCP Server
|
|
4
|
+
*
|
|
5
|
+
* A Model Context Protocol server that provides unified access to the
|
|
6
|
+
* Keap CRM API (v1 + v2), organized into logical domain groups:
|
|
7
|
+
*
|
|
8
|
+
* CRM: Contacts, Companies, Tags, Notes
|
|
9
|
+
* Sales: Opportunities, Pipelines
|
|
10
|
+
* Marketing: Campaigns, Automations, Email, Webforms
|
|
11
|
+
* E-Commerce: Orders, Products, Subscriptions, Payments
|
|
12
|
+
* Affiliates: Affiliate management, Commissions
|
|
13
|
+
* Calendar: Appointments (v1), Tasks
|
|
14
|
+
* Events: Webhooks / REST Hooks (v1)
|
|
15
|
+
* Admin: Account, Users, Settings, Files, Reporting
|
|
16
|
+
* Raw: Generic API request tool for any endpoint
|
|
17
|
+
*
|
|
18
|
+
* Configuration:
|
|
19
|
+
* Set the KEAP_API_KEY environment variable to your Keap API key.
|
|
20
|
+
* The key should start with "KeapAK-".
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Keap MCP Server
|
|
4
|
+
*
|
|
5
|
+
* A Model Context Protocol server that provides unified access to the
|
|
6
|
+
* Keap CRM API (v1 + v2), organized into logical domain groups:
|
|
7
|
+
*
|
|
8
|
+
* CRM: Contacts, Companies, Tags, Notes
|
|
9
|
+
* Sales: Opportunities, Pipelines
|
|
10
|
+
* Marketing: Campaigns, Automations, Email, Webforms
|
|
11
|
+
* E-Commerce: Orders, Products, Subscriptions, Payments
|
|
12
|
+
* Affiliates: Affiliate management, Commissions
|
|
13
|
+
* Calendar: Appointments (v1), Tasks
|
|
14
|
+
* Events: Webhooks / REST Hooks (v1)
|
|
15
|
+
* Admin: Account, Users, Settings, Files, Reporting
|
|
16
|
+
* Raw: Generic API request tool for any endpoint
|
|
17
|
+
*
|
|
18
|
+
* Configuration:
|
|
19
|
+
* Set the KEAP_API_KEY environment variable to your Keap API key.
|
|
20
|
+
* The key should start with "KeapAK-".
|
|
21
|
+
*/
|
|
22
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
23
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
24
|
+
import { setApiKey } from "./keap-client.js";
|
|
25
|
+
import { registerCrmTools } from "./tools/crm.js";
|
|
26
|
+
import { registerSalesTools } from "./tools/sales.js";
|
|
27
|
+
import { registerMarketingTools } from "./tools/marketing.js";
|
|
28
|
+
import { registerEcommerceTools } from "./tools/ecommerce.js";
|
|
29
|
+
import { registerAffiliateTools } from "./tools/affiliates.js";
|
|
30
|
+
import { registerCalendarTools } from "./tools/calendar.js";
|
|
31
|
+
import { registerEventTools } from "./tools/events.js";
|
|
32
|
+
import { registerAdminTools } from "./tools/admin.js";
|
|
33
|
+
import { registerRawTools } from "./tools/raw.js";
|
|
34
|
+
async function main() {
|
|
35
|
+
// Read API key from environment
|
|
36
|
+
const apiKey = process.env.KEAP_API_KEY;
|
|
37
|
+
if (!apiKey) {
|
|
38
|
+
console.error("ERROR: KEAP_API_KEY environment variable is required.");
|
|
39
|
+
console.error("Set it to your Keap API key (starts with 'KeapAK-').");
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
setApiKey(apiKey);
|
|
43
|
+
// Create the MCP server
|
|
44
|
+
const server = new McpServer({
|
|
45
|
+
name: "keap-mcp-server",
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
});
|
|
48
|
+
// Register all tool groups
|
|
49
|
+
registerCrmTools(server);
|
|
50
|
+
registerSalesTools(server);
|
|
51
|
+
registerMarketingTools(server);
|
|
52
|
+
registerEcommerceTools(server);
|
|
53
|
+
registerAffiliateTools(server);
|
|
54
|
+
registerCalendarTools(server);
|
|
55
|
+
registerEventTools(server);
|
|
56
|
+
registerAdminTools(server);
|
|
57
|
+
registerRawTools(server);
|
|
58
|
+
// Connect via stdio transport
|
|
59
|
+
const transport = new StdioServerTransport();
|
|
60
|
+
await server.connect(transport);
|
|
61
|
+
console.error("Keap MCP Server running on stdio");
|
|
62
|
+
}
|
|
63
|
+
main().catch((error) => {
|
|
64
|
+
console.error("Fatal error:", error);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OA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ACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keap API Client
|
|
3
|
+
* Handles authenticated requests to both v1 and v2 Keap REST API endpoints.
|
|
4
|
+
*/
|
|
5
|
+
export interface KeapRequestOptions {
|
|
6
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
7
|
+
path: string;
|
|
8
|
+
body?: Record<string, unknown>;
|
|
9
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export interface KeapResponse {
|
|
12
|
+
status: number;
|
|
13
|
+
data: unknown;
|
|
14
|
+
ok: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function setApiKey(key: string): void;
|
|
17
|
+
export declare function getApiKey(): string | undefined;
|
|
18
|
+
export declare function keapRequest(options: KeapRequestOptions): Promise<KeapResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Helper to format API responses for MCP tool output
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatResponse(result: KeapResponse): string;
|
|
23
|
+
//# sourceMappingURL=keap-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keap-client.d.ts","sourceRoot":"","sources":["../src/keap-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;CACb;AAID,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CA+CpF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAa3D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keap API Client
|
|
3
|
+
* Handles authenticated requests to both v1 and v2 Keap REST API endpoints.
|
|
4
|
+
*/
|
|
5
|
+
const BASE_URL = "https://api.infusionsoft.com/crm/rest";
|
|
6
|
+
let apiKey;
|
|
7
|
+
export function setApiKey(key) {
|
|
8
|
+
apiKey = key;
|
|
9
|
+
}
|
|
10
|
+
export function getApiKey() {
|
|
11
|
+
return apiKey;
|
|
12
|
+
}
|
|
13
|
+
export async function keapRequest(options) {
|
|
14
|
+
if (!apiKey) {
|
|
15
|
+
throw new Error("Keap API key not configured. Set the KEAP_API_KEY environment variable.");
|
|
16
|
+
}
|
|
17
|
+
const url = new URL(`${BASE_URL}${options.path}`);
|
|
18
|
+
if (options.query) {
|
|
19
|
+
for (const [key, value] of Object.entries(options.query)) {
|
|
20
|
+
if (value !== undefined && value !== null && value !== "") {
|
|
21
|
+
url.searchParams.set(key, String(value));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const headers = {
|
|
26
|
+
"X-Keap-API-Key": apiKey,
|
|
27
|
+
"Accept": "application/json",
|
|
28
|
+
};
|
|
29
|
+
const fetchOptions = {
|
|
30
|
+
method: options.method,
|
|
31
|
+
headers,
|
|
32
|
+
};
|
|
33
|
+
if (options.body && ["POST", "PUT", "PATCH"].includes(options.method)) {
|
|
34
|
+
headers["Content-Type"] = "application/json";
|
|
35
|
+
fetchOptions.body = JSON.stringify(options.body);
|
|
36
|
+
}
|
|
37
|
+
const response = await fetch(url.toString(), fetchOptions);
|
|
38
|
+
let data;
|
|
39
|
+
const contentType = response.headers.get("content-type") || "";
|
|
40
|
+
if (contentType.includes("application/json")) {
|
|
41
|
+
data = await response.json();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
data = await response.text();
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
status: response.status,
|
|
48
|
+
data,
|
|
49
|
+
ok: response.ok,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Helper to format API responses for MCP tool output
|
|
54
|
+
*/
|
|
55
|
+
export function formatResponse(result) {
|
|
56
|
+
if (!result.ok) {
|
|
57
|
+
return JSON.stringify({
|
|
58
|
+
error: true,
|
|
59
|
+
status: result.status,
|
|
60
|
+
details: result.data,
|
|
61
|
+
}, null, 2);
|
|
62
|
+
}
|
|
63
|
+
return JSON.stringify(result.data, null, 2);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=keap-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keap-client.js","sourceRoot":"","sources":["../src/keap-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,QAAQ,GAAG,uCAAuC,CAAC;AAezD,IAAI,MAA0B,CAAC;AAE/B,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,GAAG,GAAG,CAAC;AACf,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAA2B;IAC3D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,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,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI;QACJ,EAAE,EAAE,QAAQ,CAAC,EAAE;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAoB;IACjD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,MAAM,CAAC,IAAI;SACrB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/tools/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4S1D"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { keapRequest, formatResponse } from "../keap-client.js";
|
|
3
|
+
export function registerAdminTools(server) {
|
|
4
|
+
// ─── ACCOUNT ───────────────────────────────────────────────
|
|
5
|
+
server.tool("get_account_profile", "Retrieve the account/company profile.", {}, async () => {
|
|
6
|
+
const result = await keapRequest({
|
|
7
|
+
method: "GET",
|
|
8
|
+
path: "/v2/businessProfile",
|
|
9
|
+
});
|
|
10
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
11
|
+
});
|
|
12
|
+
server.tool("update_account_profile", "Update the account/company profile.", {
|
|
13
|
+
update_fields: z.record(z.unknown()).describe("Fields to update"),
|
|
14
|
+
}, async (args) => {
|
|
15
|
+
const result = await keapRequest({
|
|
16
|
+
method: "PATCH",
|
|
17
|
+
path: "/v2/businessProfile",
|
|
18
|
+
body: args.update_fields,
|
|
19
|
+
});
|
|
20
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
21
|
+
});
|
|
22
|
+
server.tool("get_app_configuration", "Retrieve the application configuration (company name, address, locale, etc.).", {}, async () => {
|
|
23
|
+
const result = await keapRequest({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: "/v2/settings/applications:getConfiguration",
|
|
26
|
+
});
|
|
27
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
28
|
+
});
|
|
29
|
+
server.tool("get_app_status", "Check if the application is enabled.", {}, async () => {
|
|
30
|
+
const result = await keapRequest({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/v2/settings/applications:isEnabled",
|
|
33
|
+
});
|
|
34
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
35
|
+
});
|
|
36
|
+
// ─── USERS ─────────────────────────────────────────────────
|
|
37
|
+
server.tool("list_users", "List all users in the Keap account.", {
|
|
38
|
+
page_size: z.number().optional(),
|
|
39
|
+
page_token: z.string().optional(),
|
|
40
|
+
filter: z.string().optional(),
|
|
41
|
+
}, async (args) => {
|
|
42
|
+
const result = await keapRequest({
|
|
43
|
+
method: "GET",
|
|
44
|
+
path: "/v2/users",
|
|
45
|
+
query: { page_size: args.page_size, page_token: args.page_token, filter: args.filter },
|
|
46
|
+
});
|
|
47
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
48
|
+
});
|
|
49
|
+
server.tool("get_user", "Retrieve a specific user by ID.", { user_id: z.string().describe("The user ID") }, async (args) => {
|
|
50
|
+
const result = await keapRequest({
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: `/v2/users/${args.user_id}`,
|
|
53
|
+
});
|
|
54
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
55
|
+
});
|
|
56
|
+
server.tool("create_user", "Create a new user (v1 only).", {
|
|
57
|
+
email: z.string().describe("User email address"),
|
|
58
|
+
given_name: z.string().describe("First name"),
|
|
59
|
+
family_name: z.string().describe("Last name"),
|
|
60
|
+
admin: z.boolean().optional().describe("Whether the user is an admin"),
|
|
61
|
+
additional_fields: z.record(z.unknown()).optional(),
|
|
62
|
+
}, async (args) => {
|
|
63
|
+
const body = {
|
|
64
|
+
email_address: args.email,
|
|
65
|
+
given_name: args.given_name,
|
|
66
|
+
family_name: args.family_name,
|
|
67
|
+
};
|
|
68
|
+
if (args.admin !== undefined)
|
|
69
|
+
body.admin = args.admin;
|
|
70
|
+
if (args.additional_fields)
|
|
71
|
+
Object.assign(body, args.additional_fields);
|
|
72
|
+
const result = await keapRequest({
|
|
73
|
+
method: "POST",
|
|
74
|
+
path: "/v1/users",
|
|
75
|
+
body,
|
|
76
|
+
});
|
|
77
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
78
|
+
});
|
|
79
|
+
server.tool("get_user_info", "Retrieve the currently authenticated user's info.", {}, async () => {
|
|
80
|
+
const result = await keapRequest({
|
|
81
|
+
method: "GET",
|
|
82
|
+
path: "/v2/oauth/connect/userinfo",
|
|
83
|
+
});
|
|
84
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
85
|
+
});
|
|
86
|
+
server.tool("get_user_signature", "Get a user's email signature HTML.", { user_id: z.string().describe("The user ID") }, async (args) => {
|
|
87
|
+
const result = await keapRequest({
|
|
88
|
+
method: "GET",
|
|
89
|
+
path: `/v2/users/${args.user_id}/signature`,
|
|
90
|
+
});
|
|
91
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
92
|
+
});
|
|
93
|
+
// ─── FILES ─────────────────────────────────────────────────
|
|
94
|
+
server.tool("list_files", "List files with optional filtering.", {
|
|
95
|
+
page_size: z.number().optional(),
|
|
96
|
+
page_token: z.string().optional(),
|
|
97
|
+
filter: z.string().optional(),
|
|
98
|
+
}, async (args) => {
|
|
99
|
+
const result = await keapRequest({
|
|
100
|
+
method: "GET",
|
|
101
|
+
path: "/v2/files",
|
|
102
|
+
query: { page_size: args.page_size, page_token: args.page_token, filter: args.filter },
|
|
103
|
+
});
|
|
104
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
105
|
+
});
|
|
106
|
+
server.tool("get_file", "Retrieve a specific file by ID.", { file_id: z.string().describe("The file ID") }, async (args) => {
|
|
107
|
+
const result = await keapRequest({
|
|
108
|
+
method: "GET",
|
|
109
|
+
path: `/v2/files/${args.file_id}`,
|
|
110
|
+
});
|
|
111
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
112
|
+
});
|
|
113
|
+
server.tool("upload_file", "Upload a file.", {
|
|
114
|
+
file_name: z.string().describe("Name of the file"),
|
|
115
|
+
file_data: z.string().describe("Base64-encoded file data"),
|
|
116
|
+
contact_id: z.string().optional().describe("Contact ID to associate with"),
|
|
117
|
+
is_public: z.boolean().optional().describe("Whether the file is publicly accessible"),
|
|
118
|
+
}, async (args) => {
|
|
119
|
+
const body = {
|
|
120
|
+
file_name: args.file_name,
|
|
121
|
+
file_data: args.file_data,
|
|
122
|
+
};
|
|
123
|
+
if (args.contact_id)
|
|
124
|
+
body.contact_id = args.contact_id;
|
|
125
|
+
if (args.is_public !== undefined)
|
|
126
|
+
body.is_public = args.is_public;
|
|
127
|
+
const result = await keapRequest({
|
|
128
|
+
method: "POST",
|
|
129
|
+
path: "/v2/files",
|
|
130
|
+
body,
|
|
131
|
+
});
|
|
132
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
133
|
+
});
|
|
134
|
+
server.tool("delete_file", "Delete a file by ID.", { file_id: z.string().describe("The file ID") }, async (args) => {
|
|
135
|
+
const result = await keapRequest({
|
|
136
|
+
method: "DELETE",
|
|
137
|
+
path: `/v2/files/${args.file_id}`,
|
|
138
|
+
});
|
|
139
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
140
|
+
});
|
|
141
|
+
// ─── REPORTING ─────────────────────────────────────────────
|
|
142
|
+
server.tool("list_reports", "List available reports.", {}, async () => {
|
|
143
|
+
const result = await keapRequest({
|
|
144
|
+
method: "GET",
|
|
145
|
+
path: "/v2/reporting/reports",
|
|
146
|
+
});
|
|
147
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
148
|
+
});
|
|
149
|
+
server.tool("get_report", "Retrieve a specific report by ID.", { report_id: z.string().describe("The report ID") }, async (args) => {
|
|
150
|
+
const result = await keapRequest({
|
|
151
|
+
method: "GET",
|
|
152
|
+
path: `/v2/reporting/reports/${args.report_id}`,
|
|
153
|
+
});
|
|
154
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
155
|
+
});
|
|
156
|
+
server.tool("run_report", "Run/execute a report and get results.", {
|
|
157
|
+
report_id: z.string().describe("The report ID"),
|
|
158
|
+
parameters: z.record(z.unknown()).optional().describe("Report parameters"),
|
|
159
|
+
}, async (args) => {
|
|
160
|
+
const result = await keapRequest({
|
|
161
|
+
method: "POST",
|
|
162
|
+
path: `/v2/reporting/reports/${args.report_id}:run`,
|
|
163
|
+
body: args.parameters || {},
|
|
164
|
+
});
|
|
165
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
166
|
+
});
|
|
167
|
+
// ─── LOCALE ────────────────────────────────────────────────
|
|
168
|
+
server.tool("list_countries", "List all countries.", {}, async () => {
|
|
169
|
+
const result = await keapRequest({
|
|
170
|
+
method: "GET",
|
|
171
|
+
path: "/v2/locales/countries",
|
|
172
|
+
});
|
|
173
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
174
|
+
});
|
|
175
|
+
server.tool("list_provinces", "List provinces/states for a country.", { country_code: z.string().describe("Country code (e.g. 'US')") }, async (args) => {
|
|
176
|
+
const result = await keapRequest({
|
|
177
|
+
method: "GET",
|
|
178
|
+
path: `/v2/locales/countries/${args.country_code}/provinces`,
|
|
179
|
+
});
|
|
180
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
181
|
+
});
|
|
182
|
+
server.tool("get_contact_option_types", "Get contact option types (lead statuses, etc.).", {}, async () => {
|
|
183
|
+
const result = await keapRequest({
|
|
184
|
+
method: "GET",
|
|
185
|
+
path: "/v2/settings/contactOptionTypes",
|
|
186
|
+
});
|
|
187
|
+
return { content: [{ type: "text", text: formatResponse(result) }] };
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/tools/admin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,8DAA8D;IAE9D,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,uCAAuC,EACvC,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;YAC/B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,qBAAqB;SAC5B,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IACvE,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,qCAAqC,EACrC;QACE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;KAClE,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;YAC/B,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,IAAI,CAAC,aAAa;SACzB,CAAC,CAAC;QACH,OA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