@zerobuild/mcp 2.6.1
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 +114 -0
- package/dist/client.d.ts +79 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +137 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +171 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +164 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/channels.d.ts +4 -0
- package/dist/resources/channels.d.ts.map +1 -0
- package/dist/resources/channels.js +58 -0
- package/dist/resources/channels.js.map +1 -0
- package/dist/resources/contacts.d.ts +4 -0
- package/dist/resources/contacts.d.ts.map +1 -0
- package/dist/resources/contacts.js +73 -0
- package/dist/resources/contacts.js.map +1 -0
- package/dist/resources/conversations.d.ts +4 -0
- package/dist/resources/conversations.d.ts.map +1 -0
- package/dist/resources/conversations.js +97 -0
- package/dist/resources/conversations.js.map +1 -0
- package/dist/resources/documents.d.ts +4 -0
- package/dist/resources/documents.d.ts.map +1 -0
- package/dist/resources/documents.js +63 -0
- package/dist/resources/documents.js.map +1 -0
- package/dist/resources/search.d.ts +4 -0
- package/dist/resources/search.d.ts.map +1 -0
- package/dist/resources/search.js +44 -0
- package/dist/resources/search.js.map +1 -0
- package/dist/tools/conversations.d.ts +4 -0
- package/dist/tools/conversations.d.ts.map +1 -0
- package/dist/tools/conversations.js +124 -0
- package/dist/tools/conversations.js.map +1 -0
- package/dist/tools/documents.d.ts +4 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +75 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/messages.d.ts +4 -0
- package/dist/tools/messages.d.ts.map +1 -0
- package/dist/tools/messages.js +31 -0
- package/dist/tools/messages.js.map +1 -0
- package/dist/tools/search.d.ts +4 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +37 -0
- package/dist/tools/search.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @zerobuild/mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for Zerobuild. Connect Claude, Cursor, Windsurf, or any MCP-compatible AI agent to your Zerobuild workspace.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Create an API Key
|
|
8
|
+
|
|
9
|
+
In your Zerobuild workspace, go to **Settings > API Keys** and create a key with `read,write` scopes.
|
|
10
|
+
|
|
11
|
+
### 2. Configure your MCP client
|
|
12
|
+
|
|
13
|
+
**Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"zerobuild": {
|
|
19
|
+
"command": "npx",
|
|
20
|
+
"args": ["-y", "@zerobuild/mcp"],
|
|
21
|
+
"env": {
|
|
22
|
+
"ZEROBUILD_API_KEY": "zb_live_...",
|
|
23
|
+
"ZEROBUILD_URL": "https://app.zerobuild.ai"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Claude Code:**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add zerobuild -- npx -y @zerobuild/mcp
|
|
34
|
+
# Then set env vars: ZEROBUILD_API_KEY, ZEROBUILD_URL
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Cursor / Windsurf:** Same config format as Claude Desktop in their respective MCP settings.
|
|
38
|
+
|
|
39
|
+
### 3. HTTP mode (self-hosted)
|
|
40
|
+
|
|
41
|
+
Run as a hosted HTTP endpoint instead of stdio:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ZEROBUILD_API_KEY=zb_live_... \
|
|
45
|
+
ZEROBUILD_URL=https://app.zerobuild.ai \
|
|
46
|
+
npx -y @zerobuild/mcp --http
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Server starts at `http://localhost:3002/mcp` (configurable via `MCP_PORT`). Any MCP client that supports the Streamable HTTP transport can connect to this URL.
|
|
50
|
+
|
|
51
|
+
## What's Available
|
|
52
|
+
|
|
53
|
+
### Resources (read context)
|
|
54
|
+
|
|
55
|
+
| Resource | Description |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `zerobuild://conversations` | Open live chat conversations |
|
|
58
|
+
| `zerobuild://conversations/{id}` | Conversation detail with messages |
|
|
59
|
+
| `zerobuild://contacts` | All contacts |
|
|
60
|
+
| `zerobuild://contacts/{id}` | Contact detail |
|
|
61
|
+
| `zerobuild://channels` | Team chat channels |
|
|
62
|
+
| `zerobuild://channels/{id}/messages` | Recent channel messages |
|
|
63
|
+
| `zerobuild://documents` | Document tree |
|
|
64
|
+
| `zerobuild://documents/{id}` | Document content |
|
|
65
|
+
| `zerobuild://search/{query}` | Unified search |
|
|
66
|
+
|
|
67
|
+
### Tools (actions)
|
|
68
|
+
|
|
69
|
+
| Tool | Description |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `list_channels` | List channels with IDs |
|
|
72
|
+
| `list_conversations` | List conversations with IDs |
|
|
73
|
+
| `send_message` | Send message to a channel |
|
|
74
|
+
| `reply_to_conversation` | Reply to a customer |
|
|
75
|
+
| `add_internal_note` | Add internal note (team only) |
|
|
76
|
+
| `close_conversation` | Close a conversation |
|
|
77
|
+
| `assign_conversation` | Assign to an agent |
|
|
78
|
+
| `transfer_conversation` | Transfer with handoff note |
|
|
79
|
+
| `tag_conversation` | Add/remove tags |
|
|
80
|
+
| `create_document` | Create doc or folder |
|
|
81
|
+
| `update_document` | Update doc content |
|
|
82
|
+
| `search` | Full-text search |
|
|
83
|
+
|
|
84
|
+
### Prompts (workflows)
|
|
85
|
+
|
|
86
|
+
| Prompt | Description |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `summarize-conversation` | Summarize with customer context |
|
|
89
|
+
| `draft-reply` | Draft reply using conversation history |
|
|
90
|
+
| `find-related` | Find related conversations/docs |
|
|
91
|
+
| `conversation-handoff` | Generate transfer summary |
|
|
92
|
+
| `daily-digest` | Daily conversation activity digest |
|
|
93
|
+
|
|
94
|
+
## Environment Variables
|
|
95
|
+
|
|
96
|
+
| Variable | Required | Default | Description |
|
|
97
|
+
|---|---|---|---|
|
|
98
|
+
| `ZEROBUILD_API_KEY` | Yes | — | API key (`zb_live_*`) |
|
|
99
|
+
| `ZEROBUILD_URL` | No | `http://localhost:3001` | Zerobuild API base URL |
|
|
100
|
+
| `MCP_PORT` | No | `3002` | HTTP server port (--http mode only) |
|
|
101
|
+
|
|
102
|
+
## Examples
|
|
103
|
+
|
|
104
|
+
**Ask Claude to summarize today's conversations:**
|
|
105
|
+
> "Summarize all open live chat conversations in my Zerobuild workspace"
|
|
106
|
+
|
|
107
|
+
**Create a doc from a conversation:**
|
|
108
|
+
> "Take the key points from conversation #42 and create a document called 'Meeting Follow-up'"
|
|
109
|
+
|
|
110
|
+
**Reply to a customer:**
|
|
111
|
+
> "Draft a reply to the latest message in conversation #15, suggesting they check our docs"
|
|
112
|
+
|
|
113
|
+
**Search across everything:**
|
|
114
|
+
> "Search my workspace for anything related to 'shipping delay'"
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP client for the Zerobuild REST API.
|
|
3
|
+
* Handles auth, envelope unwrapping, and pagination.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ZerobuildApiError extends Error {
|
|
6
|
+
status: number;
|
|
7
|
+
code: string;
|
|
8
|
+
constructor(status: number, code: string, message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class ZerobuildClient {
|
|
11
|
+
private apiKey;
|
|
12
|
+
readonly baseUrl: string;
|
|
13
|
+
constructor(baseUrl: string, apiKey: string);
|
|
14
|
+
private request;
|
|
15
|
+
private buildQuery;
|
|
16
|
+
listConversations(params?: {
|
|
17
|
+
status?: string;
|
|
18
|
+
view?: string;
|
|
19
|
+
tagId?: string;
|
|
20
|
+
cursor?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
conversations: any[];
|
|
24
|
+
hasMore: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
getConversation(id: string): Promise<any>;
|
|
27
|
+
getConversationMessages(id: string, params?: {
|
|
28
|
+
cursor?: string;
|
|
29
|
+
limit?: number;
|
|
30
|
+
}): Promise<any[]>;
|
|
31
|
+
replyToConversation(id: string, body: {
|
|
32
|
+
content: string;
|
|
33
|
+
isInternalNote?: boolean;
|
|
34
|
+
}): Promise<any>;
|
|
35
|
+
closeConversation(id: string): Promise<void>;
|
|
36
|
+
assignConversation(id: string, userId: string | null): Promise<void>;
|
|
37
|
+
transferConversation(id: string, body: {
|
|
38
|
+
targetUserId: string;
|
|
39
|
+
note?: string;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
listContacts(params?: {
|
|
42
|
+
search?: string;
|
|
43
|
+
cursor?: string;
|
|
44
|
+
limit?: number;
|
|
45
|
+
}): Promise<any[]>;
|
|
46
|
+
getContact(id: string): Promise<any>;
|
|
47
|
+
listChannels(): Promise<any[]>;
|
|
48
|
+
getChannelMessages(channelId: string, params?: {
|
|
49
|
+
cursor?: string;
|
|
50
|
+
limit?: number;
|
|
51
|
+
}): Promise<any[]>;
|
|
52
|
+
sendChannelMessage(channelId: string, body: {
|
|
53
|
+
content: string;
|
|
54
|
+
}): Promise<any>;
|
|
55
|
+
listDocuments(params?: {
|
|
56
|
+
parentId?: string;
|
|
57
|
+
}): Promise<any[]>;
|
|
58
|
+
getDocument(id: string): Promise<any>;
|
|
59
|
+
createDocument(body: {
|
|
60
|
+
title: string;
|
|
61
|
+
content?: unknown;
|
|
62
|
+
parentId?: string | null;
|
|
63
|
+
isFolder?: boolean;
|
|
64
|
+
}): Promise<any>;
|
|
65
|
+
updateDocument(id: string, body: {
|
|
66
|
+
title?: string;
|
|
67
|
+
content?: unknown;
|
|
68
|
+
}): Promise<any>;
|
|
69
|
+
listTags(): Promise<any[]>;
|
|
70
|
+
addTagToConversation(conversationId: string, tagId: string): Promise<void>;
|
|
71
|
+
removeTagFromConversation(conversationId: string, tagId: string): Promise<void>;
|
|
72
|
+
listCannedResponses(): Promise<any[]>;
|
|
73
|
+
search(params: {
|
|
74
|
+
q: string;
|
|
75
|
+
type?: string;
|
|
76
|
+
limit?: number;
|
|
77
|
+
}): Promise<any>;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,qBAAa,iBAAkB,SAAQ,KAAK;IAEjC,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,MAAM;gBADZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM;CAKlB;AAED,qBAAa,eAAe;IAKxB,OAAO,CAAC,MAAM;IAJhB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAGvB,OAAO,EAAE,MAAM,EACP,MAAM,EAAE,MAAM;YAKV,OAAO;IAuCrB,OAAO,CAAC,UAAU;IAUZ,iBAAiB,CAAC,MAAM,CAAC,EAAE;QAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC;QAAE,aAAa,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAKjD,eAAe,CAA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handles auth, envelope unwrapping, and pagination.
|
|
4
|
+
*/
|
|
5
|
+
export class ZerobuildApiError extends Error {
|
|
6
|
+
status;
|
|
7
|
+
code;
|
|
8
|
+
constructor(status, code, message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.name = "ZerobuildApiError";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class ZerobuildClient {
|
|
16
|
+
apiKey;
|
|
17
|
+
baseUrl;
|
|
18
|
+
constructor(baseUrl, apiKey) {
|
|
19
|
+
this.apiKey = apiKey;
|
|
20
|
+
this.baseUrl = baseUrl;
|
|
21
|
+
}
|
|
22
|
+
async request(method, path, body) {
|
|
23
|
+
const url = `${this.baseUrl}/api${path}`;
|
|
24
|
+
const headers = {
|
|
25
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
};
|
|
28
|
+
const res = await fetch(url, {
|
|
29
|
+
method,
|
|
30
|
+
headers,
|
|
31
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
32
|
+
});
|
|
33
|
+
if (!res.ok) {
|
|
34
|
+
let code = "UNKNOWN";
|
|
35
|
+
let message = `API error: ${res.status} ${res.statusText}`;
|
|
36
|
+
try {
|
|
37
|
+
const err = (await res.json());
|
|
38
|
+
if (err.error) {
|
|
39
|
+
code = err.error.code;
|
|
40
|
+
message = err.error.message;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// use default message
|
|
45
|
+
}
|
|
46
|
+
throw new ZerobuildApiError(res.status, code, message);
|
|
47
|
+
}
|
|
48
|
+
const json = (await res.json());
|
|
49
|
+
if (json.error) {
|
|
50
|
+
throw new ZerobuildApiError(400, json.error.code, json.error.message);
|
|
51
|
+
}
|
|
52
|
+
return json.data;
|
|
53
|
+
}
|
|
54
|
+
buildQuery(params) {
|
|
55
|
+
const entries = Object.entries(params).filter(([, v]) => v !== undefined && v !== null);
|
|
56
|
+
if (entries.length === 0)
|
|
57
|
+
return "";
|
|
58
|
+
return "?" + entries.map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`).join("&");
|
|
59
|
+
}
|
|
60
|
+
// --- Conversations ---
|
|
61
|
+
async listConversations(params) {
|
|
62
|
+
const query = this.buildQuery(params ?? {});
|
|
63
|
+
return this.request("GET", `/conversations${query}`);
|
|
64
|
+
}
|
|
65
|
+
async getConversation(id) {
|
|
66
|
+
return this.request("GET", `/conversations/${id}`);
|
|
67
|
+
}
|
|
68
|
+
async getConversationMessages(id, params) {
|
|
69
|
+
const query = this.buildQuery(params ?? {});
|
|
70
|
+
return this.request("GET", `/conversations/${id}/messages${query}`);
|
|
71
|
+
}
|
|
72
|
+
async replyToConversation(id, body) {
|
|
73
|
+
return this.request("POST", `/conversations/${id}/messages`, body);
|
|
74
|
+
}
|
|
75
|
+
async closeConversation(id) {
|
|
76
|
+
await this.request("PATCH", `/conversations/${id}/close`);
|
|
77
|
+
}
|
|
78
|
+
async assignConversation(id, userId) {
|
|
79
|
+
await this.request("PATCH", `/conversations/${id}/assign`, { userId });
|
|
80
|
+
}
|
|
81
|
+
async transferConversation(id, body) {
|
|
82
|
+
await this.request("POST", `/conversations/${id}/transfer`, body);
|
|
83
|
+
}
|
|
84
|
+
// --- Contacts ---
|
|
85
|
+
async listContacts(params) {
|
|
86
|
+
const query = this.buildQuery(params ?? {});
|
|
87
|
+
return this.request("GET", `/contacts${query}`);
|
|
88
|
+
}
|
|
89
|
+
async getContact(id) {
|
|
90
|
+
return this.request("GET", `/contacts/${id}`);
|
|
91
|
+
}
|
|
92
|
+
// --- Channels ---
|
|
93
|
+
async listChannels() {
|
|
94
|
+
return this.request("GET", "/channels");
|
|
95
|
+
}
|
|
96
|
+
async getChannelMessages(channelId, params) {
|
|
97
|
+
const query = this.buildQuery(params ?? {});
|
|
98
|
+
return this.request("GET", `/channels/${channelId}/messages${query}`);
|
|
99
|
+
}
|
|
100
|
+
async sendChannelMessage(channelId, body) {
|
|
101
|
+
return this.request("POST", `/channels/${channelId}/messages`, body);
|
|
102
|
+
}
|
|
103
|
+
// --- Documents ---
|
|
104
|
+
async listDocuments(params) {
|
|
105
|
+
const query = this.buildQuery(params ?? {});
|
|
106
|
+
return this.request("GET", `/documents${query}`);
|
|
107
|
+
}
|
|
108
|
+
async getDocument(id) {
|
|
109
|
+
return this.request("GET", `/documents/${id}`);
|
|
110
|
+
}
|
|
111
|
+
async createDocument(body) {
|
|
112
|
+
return this.request("POST", "/documents", body);
|
|
113
|
+
}
|
|
114
|
+
async updateDocument(id, body) {
|
|
115
|
+
return this.request("PATCH", `/documents/${id}`, body);
|
|
116
|
+
}
|
|
117
|
+
// --- Tags ---
|
|
118
|
+
async listTags() {
|
|
119
|
+
return this.request("GET", "/conversation-tags");
|
|
120
|
+
}
|
|
121
|
+
async addTagToConversation(conversationId, tagId) {
|
|
122
|
+
await this.request("POST", `/conversations/${conversationId}/tags/${tagId}`);
|
|
123
|
+
}
|
|
124
|
+
async removeTagFromConversation(conversationId, tagId) {
|
|
125
|
+
await this.request("DELETE", `/conversations/${conversationId}/tags/${tagId}`);
|
|
126
|
+
}
|
|
127
|
+
// --- Canned Responses ---
|
|
128
|
+
async listCannedResponses() {
|
|
129
|
+
return this.request("GET", "/canned");
|
|
130
|
+
}
|
|
131
|
+
// --- Search ---
|
|
132
|
+
async search(params) {
|
|
133
|
+
const query = this.buildQuery(params);
|
|
134
|
+
return this.request("GET", `/search${query}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAEjC;IACA;IAFT,YACS,MAAc,EACd,IAAY,EACnB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,WA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tB,KAAa;QAEb,MAAM,IAAI,CAAC,OAAO,CAChB,MAAM,EACN,kBAAkB,cAAc,SAAS,KAAK,EAAE,CACjD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC7B,cAAsB,EACtB,KAAa;QAEb,MAAM,IAAI,CAAC,OAAO,CAChB,QAAQ,EACR,kBAAkB,cAAc,SAAS,KAAK,EAAE,CACjD,CAAC;IACJ,CAAC;IAED,2BAA2B;IAE3B,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC;IAED,iBAAiB;IAEjB,KAAK,CAAC,MAAM,CAAC,MAIZ;QACC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
|
+
import { createServer } from "node:http";
|
|
6
|
+
import { randomUUID } from "node:crypto";
|
|
7
|
+
import { ZerobuildClient } from "./client.js";
|
|
8
|
+
import { registerConversationResources } from "./resources/conversations.js";
|
|
9
|
+
import { registerContactResources } from "./resources/contacts.js";
|
|
10
|
+
import { registerChannelResources } from "./resources/channels.js";
|
|
11
|
+
import { registerDocumentResources } from "./resources/documents.js";
|
|
12
|
+
import { registerSearchResource } from "./resources/search.js";
|
|
13
|
+
import { registerConversationTools } from "./tools/conversations.js";
|
|
14
|
+
import { registerMessageTools } from "./tools/messages.js";
|
|
15
|
+
import { registerDocumentTools } from "./tools/documents.js";
|
|
16
|
+
import { registerSearchTool } from "./tools/search.js";
|
|
17
|
+
import { registerPrompts } from "./prompts/index.js";
|
|
18
|
+
const HELP = `
|
|
19
|
+
Zerobuild MCP Server
|
|
20
|
+
|
|
21
|
+
Exposes your Zerobuild workspace to AI agents via the Model Context Protocol.
|
|
22
|
+
|
|
23
|
+
Modes:
|
|
24
|
+
stdio (default) — for Claude Desktop, Cursor, etc.
|
|
25
|
+
--http — hosted HTTP endpoint for remote clients
|
|
26
|
+
|
|
27
|
+
Environment variables:
|
|
28
|
+
ZEROBUILD_API_KEY (required) API key for authentication (zb_live_*)
|
|
29
|
+
ZEROBUILD_URL (optional) API base URL (default: http://localhost:3001)
|
|
30
|
+
MCP_PORT (optional) HTTP server port when using --http (default: 3002)
|
|
31
|
+
|
|
32
|
+
Usage with Claude Desktop (stdio):
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"zerobuild": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["@zerobuild/mcp"],
|
|
38
|
+
"env": {
|
|
39
|
+
"ZEROBUILD_API_KEY": "zb_live_...",
|
|
40
|
+
"ZEROBUILD_URL": "https://your-instance.zerobuild.ai"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Usage as hosted endpoint (HTTP):
|
|
47
|
+
ZEROBUILD_API_KEY=zb_live_... zerobuild-mcp --http
|
|
48
|
+
|
|
49
|
+
Then configure clients to connect to: http://localhost:3002/mcp
|
|
50
|
+
`.trim();
|
|
51
|
+
function createMcpServer(client) {
|
|
52
|
+
const server = new McpServer({
|
|
53
|
+
name: "zerobuild",
|
|
54
|
+
version: "2.6.1",
|
|
55
|
+
});
|
|
56
|
+
// Register resources
|
|
57
|
+
registerConversationResources(server, client);
|
|
58
|
+
registerContactResources(server, client);
|
|
59
|
+
registerChannelResources(server, client);
|
|
60
|
+
registerDocumentResources(server, client);
|
|
61
|
+
registerSearchResource(server, client);
|
|
62
|
+
// Register tools
|
|
63
|
+
registerConversationTools(server, client);
|
|
64
|
+
registerMessageTools(server, client);
|
|
65
|
+
registerDocumentTools(server, client);
|
|
66
|
+
registerSearchTool(server, client);
|
|
67
|
+
// Register prompts
|
|
68
|
+
registerPrompts(server, client);
|
|
69
|
+
return server;
|
|
70
|
+
}
|
|
71
|
+
async function startStdio(client) {
|
|
72
|
+
const server = createMcpServer(client);
|
|
73
|
+
const transport = new StdioServerTransport();
|
|
74
|
+
await server.connect(transport);
|
|
75
|
+
console.error(`Zerobuild MCP server running via stdio (API: ${client.baseUrl})`);
|
|
76
|
+
}
|
|
77
|
+
async function startHttp(client) {
|
|
78
|
+
const port = parseInt(process.env.MCP_PORT || "3002", 10);
|
|
79
|
+
// Map of session ID -> transport for stateful sessions
|
|
80
|
+
const sessions = new Map();
|
|
81
|
+
const httpServer = createServer(async (req, res) => {
|
|
82
|
+
const url = new URL(req.url || "/", `http://localhost:${port}`);
|
|
83
|
+
// CORS headers
|
|
84
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
85
|
+
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
|
|
86
|
+
res.setHeader("Access-Control-Allow-Headers", "Content-Type, mcp-session-id");
|
|
87
|
+
res.setHeader("Access-Control-Expose-Headers", "mcp-session-id");
|
|
88
|
+
if (req.method === "OPTIONS") {
|
|
89
|
+
res.writeHead(204);
|
|
90
|
+
res.end();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (url.pathname !== "/mcp") {
|
|
94
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
95
|
+
res.end(JSON.stringify({ error: "Not found. MCP endpoint is at /mcp" }));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// Get or create session
|
|
99
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
100
|
+
if (req.method === "POST" && !sessionId) {
|
|
101
|
+
// New session — initialize
|
|
102
|
+
const transport = new StreamableHTTPServerTransport({
|
|
103
|
+
sessionIdGenerator: () => randomUUID(),
|
|
104
|
+
});
|
|
105
|
+
const server = createMcpServer(client);
|
|
106
|
+
await server.connect(transport);
|
|
107
|
+
// Store session after initialization sets the ID
|
|
108
|
+
transport.onclose = () => {
|
|
109
|
+
if (transport.sessionId) {
|
|
110
|
+
sessions.delete(transport.sessionId);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
await transport.handleRequest(req, res);
|
|
114
|
+
// Session ID is set after handling the initialize request
|
|
115
|
+
if (transport.sessionId) {
|
|
116
|
+
sessions.set(transport.sessionId, transport);
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (sessionId) {
|
|
121
|
+
const transport = sessions.get(sessionId);
|
|
122
|
+
if (!transport) {
|
|
123
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
124
|
+
res.end(JSON.stringify({ error: "Session not found" }));
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
await transport.handleRequest(req, res);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// GET without session (for SSE stream) or other methods
|
|
131
|
+
if (req.method === "GET") {
|
|
132
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
133
|
+
res.end(JSON.stringify({ error: "Missing mcp-session-id header" }));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
137
|
+
res.end(JSON.stringify({ error: "Missing mcp-session-id header for existing session" }));
|
|
138
|
+
});
|
|
139
|
+
httpServer.listen(port, () => {
|
|
140
|
+
console.log(`Zerobuild MCP server running at http://localhost:${port}/mcp`);
|
|
141
|
+
console.log(`API: ${client.baseUrl}`);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async function main() {
|
|
145
|
+
// Handle --help
|
|
146
|
+
if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
147
|
+
console.log(HELP);
|
|
148
|
+
process.exit(0);
|
|
149
|
+
}
|
|
150
|
+
// Read config from env
|
|
151
|
+
const apiKey = process.env.ZEROBUILD_API_KEY;
|
|
152
|
+
const baseUrl = process.env.ZEROBUILD_URL || "http://localhost:3001";
|
|
153
|
+
if (!apiKey) {
|
|
154
|
+
console.error("Error: ZEROBUILD_API_KEY environment variable is required.\n");
|
|
155
|
+
console.error(HELP);
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
const client = new ZerobuildClient(baseUrl, apiKey);
|
|
159
|
+
const httpMode = process.argv.includes("--http");
|
|
160
|
+
if (httpMode) {
|
|
161
|
+
await startHttp(client);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
await startStdio(client);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
main().catch((err) => {
|
|
168
|
+
console.error("Fatal error:", err);
|
|
169
|
+
process.exit(1);
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,C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