@archbee/mcp 2.0.0 → 2.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/README.md +50 -3
- package/dist/index.js +110 -24
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +183 -46
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server for the [Archbee API](https://docs.archbee.com/get-document). It lets an LLM client read, search, create, update and delete the documentation in your Archbee space.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
With a space API key every tool acts on that one space, and `docSpaceId` never has to be passed in. With a team key (`abteam_…`) the assistant reaches every space in the team, and the space-level tools take a `docSpaceId` argument per call.
|
|
6
6
|
|
|
7
7
|
### Tools
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ Read:
|
|
|
27
27
|
- `query` (string): text to look for in titles
|
|
28
28
|
- Returns: documents with a matching title, as `DocResponse[]`
|
|
29
29
|
|
|
30
|
-
Write — these need
|
|
30
|
+
Write — these need an API key, space or team (the configurations below):
|
|
31
31
|
|
|
32
32
|
5. `create_doc`
|
|
33
33
|
- Creates a document from Markdown or MDX content
|
|
@@ -106,7 +106,7 @@ You can get an API token from Space Settings in Archbee app.
|
|
|
106
106
|
|
|
107
107
|
Use the live space id here. A `PUBLISHED-` or `PREVIEW-` snapshot id reads fine, but the API refuses every write through a snapshot credential.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
A space API key belongs to one space, so this configuration reads and writes that space only. For every space in the team, use a team key instead.
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
{
|
|
@@ -122,3 +122,50 @@ An API key belongs to one space, so this server writes to that space only. To gi
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
```
|
|
125
|
+
|
|
126
|
+
### Environment Variables - team key
|
|
127
|
+
|
|
128
|
+
Reads and writes every space in the team. The organization super-admin creates the key in Settings → Organization settings → Organization API key; it is shown once, on creation, and cannot be read back afterwards. Revoking it stops every assistant configured with it.
|
|
129
|
+
|
|
130
|
+
- `API_KEY`: Team key, starting with `abteam_`
|
|
131
|
+
|
|
132
|
+
A team key is accepted on the MCP endpoints only — the rest of the Public API and the CLI still take a space key.
|
|
133
|
+
|
|
134
|
+
No `SPACE_ID`: the key is not bound to a space, so the space travels per call. `get_doc`, `get_all_docs`, `search_query`, `search_title`, `create_doc`, `update_doc`, `delete_doc`, `update_doc_space` and `delete_doc_space` take a `docSpaceId` argument; `create_doc_space`, `create_space_group` and `delete_space_group` act on the team and take none.
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"archbee": {
|
|
140
|
+
"command": "pnpm",
|
|
141
|
+
"args": ["dlx", "@archbee/mcp"],
|
|
142
|
+
"env": {
|
|
143
|
+
"API_KEY": "abteam_<team-key>"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Environment Variables - other Archbee installs
|
|
151
|
+
|
|
152
|
+
Both API-key configurations talk to `https://api.archbee.com` by default — the same host the Archbee CLI and the public API reference use. Point them elsewhere with:
|
|
153
|
+
|
|
154
|
+
- `ARCHBEE_API_URL`: Origin of your Archbee API, e.g. `https://qa.archbee.com` or `http://localhost:4000`
|
|
155
|
+
|
|
156
|
+
Give the origin only — the server appends `/api/public-mcp` itself. A value without a scheme is rejected rather than silently falling back to the cloud. `API_BASE` (the public-portal configuration) is a full link and ignores this.
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"archbee": {
|
|
162
|
+
"command": "pnpm",
|
|
163
|
+
"args": ["dlx", "@archbee/mcp"],
|
|
164
|
+
"env": {
|
|
165
|
+
"ARCHBEE_API_URL": "https://qa.archbee.com",
|
|
166
|
+
"API_KEY": "abteam_<team-key>"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -8,41 +8,69 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
8
8
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
9
9
|
const axios_1 = __importDefault(require("axios"));
|
|
10
10
|
const zod_1 = require("zod");
|
|
11
|
+
// A team key is not bound to a space, so the space travels per call instead of
|
|
12
|
+
// being packed into the credential like a space key is.
|
|
13
|
+
const TEAM_API_KEY_PREFIX = 'abteam_';
|
|
14
|
+
const usesTeamApiKey = () => (process.env.API_KEY || '').startsWith(TEAM_API_KEY_PREFIX);
|
|
15
|
+
const docSpaceIdArg = {
|
|
16
|
+
docSpaceId: zod_1.z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Space to act on. Required when API_KEY is a team key (starts with `abteam_`), which can reach every space in the team. Ignored with a space API key, since that key already names its space.'),
|
|
20
|
+
};
|
|
11
21
|
const MDX_FORMAT_DESCRIPTION = 'Format of `content`. Use `mdx` when the content contains JSX-style Archbee components such as `<hint>`, `<CtaButton />` or `<Tabs>` — with plain markdown those degrade to raw html blocks. Directive-style components (`:::hint{type="info"}`) work in both formats. Defaults to markdown when omitted.';
|
|
12
22
|
// Create an MCP server
|
|
13
23
|
const server = new mcp_js_1.McpServer({
|
|
14
24
|
name: 'Archbee MCP',
|
|
15
|
-
version: '1.0
|
|
25
|
+
version: '2.1.0',
|
|
16
26
|
});
|
|
17
|
-
server.tool('get_all_docs', {}, async ({}) => {
|
|
27
|
+
server.tool('get_all_docs', 'Read every document in the Archbee doc space, with its content, and each document carries the name of the space it belongs to (docSpaceName). Returns the whole space, so prefer search_query or search_title when looking for something specific.', { ...docSpaceIdArg }, async ({ docSpaceId }) => {
|
|
18
28
|
const params = {
|
|
19
29
|
tool: 'get-all-docs',
|
|
30
|
+
docSpaceId,
|
|
20
31
|
};
|
|
21
32
|
return callMcpApi(params);
|
|
22
33
|
});
|
|
23
|
-
server.tool('get_doc',
|
|
34
|
+
server.tool('get_doc', 'Read one Archbee document by id and return its content as markdown, alongside the id and name of the space it lives in.', {
|
|
35
|
+
docId: zod_1.z
|
|
36
|
+
.string()
|
|
37
|
+
.describe('ID of the document to read, as returned by search_query, search_title or get_all_docs.'),
|
|
38
|
+
...docSpaceIdArg,
|
|
39
|
+
}, async ({ docId, docSpaceId }) => {
|
|
24
40
|
const params = {
|
|
25
41
|
tool: 'get-doc',
|
|
26
42
|
docId,
|
|
43
|
+
docSpaceId,
|
|
27
44
|
};
|
|
28
45
|
return callMcpApi(params);
|
|
29
46
|
});
|
|
30
|
-
server.tool('search_query',
|
|
47
|
+
server.tool('search_query', 'Search the Archbee doc space by document content and return the matching documents. This is the tool to use for answering a question from the documentation. An empty query returns every document.', {
|
|
48
|
+
query: zod_1.z
|
|
49
|
+
.string()
|
|
50
|
+
.describe('Text to look for inside the content of the documents.'),
|
|
51
|
+
...docSpaceIdArg,
|
|
52
|
+
}, async ({ query, docSpaceId }) => {
|
|
31
53
|
const params = {
|
|
32
54
|
tool: 'search-query',
|
|
33
55
|
query,
|
|
56
|
+
docSpaceId,
|
|
34
57
|
};
|
|
35
58
|
return callMcpApi(params);
|
|
36
59
|
});
|
|
37
|
-
server.tool('search_title',
|
|
60
|
+
server.tool('search_title', 'Search the Archbee doc space by document title. Use this when looking for a page by name; use search_query to search inside document content.', {
|
|
61
|
+
query: zod_1.z.string().describe('Text to look for in the document titles.'),
|
|
62
|
+
...docSpaceIdArg,
|
|
63
|
+
}, async ({ query, docSpaceId }) => {
|
|
38
64
|
const params = {
|
|
39
65
|
tool: 'search-title',
|
|
40
66
|
query,
|
|
67
|
+
docSpaceId,
|
|
41
68
|
};
|
|
42
69
|
return callMcpApi(params);
|
|
43
70
|
});
|
|
44
|
-
// Write tools.
|
|
45
|
-
//
|
|
71
|
+
// Write tools. With a space key the target space comes from SPACE_ID; with a
|
|
72
|
+
// team key it comes from the docSpaceId argument, which the three team-level
|
|
73
|
+
// tools below do not take because they act on the team, not on a space.
|
|
46
74
|
server.tool('create_doc', 'Create a new document in the Archbee doc space from Markdown or MDX content.', {
|
|
47
75
|
content: zod_1.z
|
|
48
76
|
.string()
|
|
@@ -69,6 +97,7 @@ server.tool('create_doc', 'Create a new document in the Archbee doc space from M
|
|
|
69
97
|
.boolean()
|
|
70
98
|
.optional()
|
|
71
99
|
.describe('When true, the document is hidden from navigation.'),
|
|
100
|
+
...docSpaceIdArg,
|
|
72
101
|
}, async (args) => callWriteApi({ tool: 'create-doc', ...args }));
|
|
73
102
|
server.tool('update_doc', 'Update an existing Archbee document. Only the provided fields are changed.', {
|
|
74
103
|
docId: zod_1.z.string().describe('ID of the document to update.'),
|
|
@@ -98,6 +127,7 @@ server.tool('update_doc', 'Update an existing Archbee document. Only the provide
|
|
|
98
127
|
.boolean()
|
|
99
128
|
.optional()
|
|
100
129
|
.describe('When true, the document is hidden from navigation.'),
|
|
130
|
+
...docSpaceIdArg,
|
|
101
131
|
}, async (args) => callWriteApi({ tool: 'update-doc', ...args }));
|
|
102
132
|
server.tool('delete_doc', 'Permanently delete an Archbee document. This is destructive and cannot be undone: the document is removed together with every file and image uploaded to it, and any documents nested underneath it are deleted as well. Ask the user to confirm before calling this tool.', {
|
|
103
133
|
docId: zod_1.z.string().describe('ID of the document to delete.'),
|
|
@@ -105,6 +135,7 @@ server.tool('delete_doc', 'Permanently delete an Archbee document. This is destr
|
|
|
105
135
|
.boolean()
|
|
106
136
|
.optional()
|
|
107
137
|
.describe('Required (set to true) to delete a document that has nested child documents, which deletes those children too. When the document has children and this is not set, the call is rejected and the response lists the child documents that would be affected.'),
|
|
138
|
+
...docSpaceIdArg,
|
|
108
139
|
}, async (args) => callWriteApi({ tool: 'delete-doc', ...args }));
|
|
109
140
|
server.tool('create_doc_space', 'Create a new doc space (documentation space) in the current Archbee team.', {
|
|
110
141
|
name: zod_1.z.string().describe('Name of the new doc space.'),
|
|
@@ -157,7 +188,11 @@ const publicAccessControlPartSchema = zod_1.z
|
|
|
157
188
|
conditionalRuleId: zod_1.z.string().optional(),
|
|
158
189
|
})
|
|
159
190
|
.passthrough();
|
|
160
|
-
server.tool('update_doc_space', 'Update
|
|
191
|
+
server.tool('update_doc_space', 'Update an Archbee doc space: rename it, or change its hostname, space links or public access control. Only the provided parts are changed, and at least one must be provided. The response echoes the space name, and get_all_docs / get_doc report it too, so a rename can be verified.', {
|
|
192
|
+
name: zod_1.z
|
|
193
|
+
.string()
|
|
194
|
+
.optional()
|
|
195
|
+
.describe('New display name for the space (renames it).'),
|
|
161
196
|
hostnamePart: zod_1.z
|
|
162
197
|
.object({ hostname: zod_1.z.string(), hostnamePath: zod_1.z.string() })
|
|
163
198
|
.optional()
|
|
@@ -169,8 +204,9 @@ server.tool('update_doc_space', 'Update settings of the Archbee doc space (hostn
|
|
|
169
204
|
publicAccessControlPart: publicAccessControlPartSchema
|
|
170
205
|
.optional()
|
|
171
206
|
.describe('Public access control and authentication configuration.'),
|
|
207
|
+
...docSpaceIdArg,
|
|
172
208
|
}, async (args) => callWriteApi({ tool: 'update-doc-space', ...args }));
|
|
173
|
-
server.tool('delete_doc_space', 'Permanently delete
|
|
209
|
+
server.tool('delete_doc_space', 'Permanently delete an Archbee doc space together with every document inside it. This is destructive and cannot be undone. With a space API key the space deleted is the one SPACE_ID points at, so that key dies with it and no further tool call will work; with a team key it is the space named by docSpaceId. Ask the user to confirm before calling this tool.', { ...docSpaceIdArg }, async (args) => callWriteApi({ tool: 'delete-doc-space', ...args }));
|
|
174
210
|
server.tool('create_space_group', 'Create a new space group (collection of doc spaces) in the current Archbee team. Requires a team admin.', {
|
|
175
211
|
name: zod_1.z.string().describe('Name of the new space group.'),
|
|
176
212
|
isAiEnabled: zod_1.z
|
|
@@ -189,6 +225,32 @@ server.tool('create_space_group', 'Create a new space group (collection of doc s
|
|
|
189
225
|
server.tool('delete_space_group', 'Delete a space group (collection of doc spaces) from the current Archbee team. Requires a team admin. The group must already be empty: move or delete every doc space it still contains first, otherwise the call is rejected.', {
|
|
190
226
|
docSpaceGroupId: zod_1.z.string().describe('ID of the space group to delete.'),
|
|
191
227
|
}, async (args) => callWriteApi({ tool: 'delete-space-group', ...args }));
|
|
228
|
+
server.tool('create_category', 'Create a category (a folder in the space navigation) in an Archbee doc space. A category holds documents but has no content of its own. To put a document inside it, pass the returned categoryId as `parentDocId` on create_doc or update_doc.', {
|
|
229
|
+
categoryName: zod_1.z.string().describe('Name of the category to create.'),
|
|
230
|
+
parentDocId: zod_1.z
|
|
231
|
+
.string()
|
|
232
|
+
.optional()
|
|
233
|
+
.describe('ID of the document or category to nest this category under. Omit to create it at the top level of the space.'),
|
|
234
|
+
...docSpaceIdArg,
|
|
235
|
+
}, async (args) => callWriteApi({ tool: 'create-category', ...args }));
|
|
236
|
+
server.tool('delete_category', 'Delete a category from an Archbee doc space. The category must already be empty: move or delete the documents inside it first, otherwise the call is rejected. Deleting a category never deletes documents.', {
|
|
237
|
+
categoryId: zod_1.z.string().describe('ID of the category to delete.'),
|
|
238
|
+
...docSpaceIdArg,
|
|
239
|
+
}, async (args) => callWriteApi({ tool: 'delete-category', ...args }));
|
|
240
|
+
// Origin of the Archbee API the key belongs to, same variable the CLI takes.
|
|
241
|
+
// app.archbee.com/api is being phased out, so the default is api.archbee.com.
|
|
242
|
+
const apiMcpUrl = () => {
|
|
243
|
+
const apiUrlInput = (process.env.ARCHBEE_API_URL || '').trim();
|
|
244
|
+
if (!apiUrlInput) {
|
|
245
|
+
return 'https://api.archbee.com/api/public-mcp';
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
return new URL('/api/public-mcp', apiUrlInput).toString();
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
192
254
|
const processUrl = (urlInput) => {
|
|
193
255
|
try {
|
|
194
256
|
const url = new URL(urlInput);
|
|
@@ -201,10 +263,27 @@ const processUrl = (urlInput) => {
|
|
|
201
263
|
return null;
|
|
202
264
|
}
|
|
203
265
|
};
|
|
266
|
+
// A team key authenticates on its own, so team-level tools need no space at all.
|
|
267
|
+
// A space key carries no space id, so it travels packed with one.
|
|
268
|
+
const authorizationHeader = (docSpaceId) => {
|
|
269
|
+
const apiKey = process.env.API_KEY || '';
|
|
270
|
+
if (!apiKey) {
|
|
271
|
+
return '';
|
|
272
|
+
}
|
|
273
|
+
if (usesTeamApiKey()) {
|
|
274
|
+
return `Bearer ${apiKey}`;
|
|
275
|
+
}
|
|
276
|
+
return docSpaceId
|
|
277
|
+
? `Bearer ${Buffer.from(`${docSpaceId}~${apiKey}`).toString('base64')}`
|
|
278
|
+
: '';
|
|
279
|
+
};
|
|
204
280
|
const callMcpApi = async (params) => {
|
|
205
281
|
const urlInput = process.env.API_BASE || '';
|
|
206
|
-
const
|
|
207
|
-
|
|
282
|
+
const teamMode = usesTeamApiKey();
|
|
283
|
+
const docSpaceIdInput = teamMode
|
|
284
|
+
? params.docSpaceId || ''
|
|
285
|
+
: process.env.SPACE_ID || '';
|
|
286
|
+
if (!teamMode && !urlInput && !docSpaceIdInput) {
|
|
208
287
|
return {
|
|
209
288
|
content: [{ type: 'text', text: 'API base URL or docSpaceId not set.' }],
|
|
210
289
|
isError: true,
|
|
@@ -216,24 +295,28 @@ const callMcpApi = async (params) => {
|
|
|
216
295
|
isError: true,
|
|
217
296
|
};
|
|
218
297
|
}
|
|
219
|
-
const urlMcp = urlInput
|
|
220
|
-
? processUrl(urlInput)
|
|
221
|
-
: 'https://app.archbee.com/api/public-mcp';
|
|
298
|
+
const urlMcp = urlInput ? processUrl(urlInput) : apiMcpUrl();
|
|
222
299
|
if (urlMcp === null) {
|
|
223
300
|
return {
|
|
224
|
-
content: [
|
|
301
|
+
content: [
|
|
302
|
+
{
|
|
303
|
+
type: 'text',
|
|
304
|
+
text: 'Invalid API base URL or ARCHBEE_API_URL format.',
|
|
305
|
+
},
|
|
306
|
+
],
|
|
225
307
|
isError: true,
|
|
226
308
|
};
|
|
227
309
|
}
|
|
310
|
+
const authorization = authorizationHeader(docSpaceIdInput);
|
|
228
311
|
try {
|
|
229
312
|
let dataText;
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
313
|
+
if (authorization) {
|
|
314
|
+
if (docSpaceIdInput) {
|
|
315
|
+
params.docSpaceId = docSpaceIdInput;
|
|
316
|
+
}
|
|
234
317
|
const response = await axios_1.default.post(urlMcp, params, {
|
|
235
318
|
headers: {
|
|
236
|
-
Authorization:
|
|
319
|
+
Authorization: authorization,
|
|
237
320
|
'Content-Type': 'application/json',
|
|
238
321
|
},
|
|
239
322
|
timeout: 30000,
|
|
@@ -265,13 +348,16 @@ const callMcpApi = async (params) => {
|
|
|
265
348
|
// made with a PUBLISHED-/PREVIEW- snapshot credential. Both cases fail here with
|
|
266
349
|
// an explanation rather than as an opaque rejection from the server.
|
|
267
350
|
const callWriteApi = async (params) => {
|
|
268
|
-
const
|
|
269
|
-
|
|
351
|
+
const teamMode = usesTeamApiKey();
|
|
352
|
+
const docSpaceIdInput = teamMode
|
|
353
|
+
? params.docSpaceId || ''
|
|
354
|
+
: process.env.SPACE_ID || '';
|
|
355
|
+
if (!process.env.API_KEY || (!teamMode && !docSpaceIdInput)) {
|
|
270
356
|
return {
|
|
271
357
|
content: [
|
|
272
358
|
{
|
|
273
359
|
type: 'text',
|
|
274
|
-
text: 'Write tools need
|
|
360
|
+
text: 'Write tools need an API_KEY, plus SPACE_ID when the key is a space key. The API_BASE configuration is read-only.',
|
|
275
361
|
},
|
|
276
362
|
],
|
|
277
363
|
isError: true,
|
|
@@ -283,7 +369,7 @@ const callWriteApi = async (params) => {
|
|
|
283
369
|
content: [
|
|
284
370
|
{
|
|
285
371
|
type: 'text',
|
|
286
|
-
text: '
|
|
372
|
+
text: 'The target space is a published/preview snapshot, which cannot be written to. Use the live space id from the space URL in the Archbee app.',
|
|
287
373
|
},
|
|
288
374
|
],
|
|
289
375
|
isError: true,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,oEAAmE;AACnE,wEAAgF;AAEhF,kDAAyB;AACzB,6BAAuB;AA0BvB,MAAM,sBAAsB,GAC1B,0SAA0S,CAAA;AAE5S,uBAAuB;AACvB,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;IAC3B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;IAC3C,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,cAAc;KACrB,CAAA;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,SAAS;QACf,KAAK;KACN,CAAA;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,cAAc;QACpB,KAAK;KACN,CAAA;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,EAAE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B,CAAC,CAAA;IAED,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAE/B,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAC/B,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,6BAA6B,EAC7B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAC/C,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archbee/mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"compile": "rm -rf ./dist && tsc",
|
|
16
|
+
"ts-check": "tsc --noEmit",
|
|
16
17
|
"serve": "PORT=5001 pnpm run compile && PORT=5001 node ./dist/index.js",
|
|
17
18
|
"start": "PORT=5001 node ./dist/index.js",
|
|
18
19
|
"release:dry": "pnpm run compile && npm publish --access public --dry-run",
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
|
|
4
4
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
5
|
-
import { type CallToolResult } from '@modelcontextprotocol/sdk/types'
|
|
5
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js'
|
|
6
6
|
import axios from 'axios'
|
|
7
7
|
import { z } from 'zod'
|
|
8
8
|
|
|
@@ -21,6 +21,8 @@ interface McpApiParams {
|
|
|
21
21
|
hidden?: boolean
|
|
22
22
|
recursive?: boolean
|
|
23
23
|
name?: string
|
|
24
|
+
categoryName?: string
|
|
25
|
+
categoryId?: string
|
|
24
26
|
docSpaceGroupId?: string
|
|
25
27
|
isAiEnabled?: boolean
|
|
26
28
|
isReviewSystemEnabled?: boolean
|
|
@@ -30,48 +32,104 @@ interface McpApiParams {
|
|
|
30
32
|
publicAccessControlPart?: Record<string, unknown>
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
// A team key is not bound to a space, so the space travels per call instead of
|
|
36
|
+
// being packed into the credential like a space key is.
|
|
37
|
+
const TEAM_API_KEY_PREFIX = 'abteam_'
|
|
38
|
+
|
|
39
|
+
const usesTeamApiKey = (): boolean =>
|
|
40
|
+
(process.env.API_KEY || '').startsWith(TEAM_API_KEY_PREFIX)
|
|
41
|
+
|
|
42
|
+
const docSpaceIdArg = {
|
|
43
|
+
docSpaceId: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe(
|
|
47
|
+
'Space to act on. Required when API_KEY is a team key (starts with `abteam_`), which can reach every space in the team. Ignored with a space API key, since that key already names its space.'
|
|
48
|
+
),
|
|
49
|
+
}
|
|
50
|
+
|
|
33
51
|
const MDX_FORMAT_DESCRIPTION =
|
|
34
52
|
'Format of `content`. Use `mdx` when the content contains JSX-style Archbee components such as `<hint>`, `<CtaButton />` or `<Tabs>` — with plain markdown those degrade to raw html blocks. Directive-style components (`:::hint{type="info"}`) work in both formats. Defaults to markdown when omitted.'
|
|
35
53
|
|
|
36
54
|
// Create an MCP server
|
|
37
55
|
const server = new McpServer({
|
|
38
56
|
name: 'Archbee MCP',
|
|
39
|
-
version: '1.0
|
|
57
|
+
version: '2.1.0',
|
|
40
58
|
})
|
|
41
59
|
|
|
42
|
-
server.tool(
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
server.tool(
|
|
61
|
+
'get_all_docs',
|
|
62
|
+
'Read every document in the Archbee doc space, with its content, and each document carries the name of the space it belongs to (docSpaceName). Returns the whole space, so prefer search_query or search_title when looking for something specific.',
|
|
63
|
+
{ ...docSpaceIdArg },
|
|
64
|
+
async ({ docSpaceId }) => {
|
|
65
|
+
const params = {
|
|
66
|
+
tool: 'get-all-docs',
|
|
67
|
+
docSpaceId,
|
|
68
|
+
}
|
|
69
|
+
return callMcpApi(params)
|
|
45
70
|
}
|
|
46
|
-
|
|
47
|
-
})
|
|
71
|
+
)
|
|
48
72
|
|
|
49
|
-
server.tool(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
server.tool(
|
|
74
|
+
'get_doc',
|
|
75
|
+
'Read one Archbee document by id and return its content as markdown, alongside the id and name of the space it lives in.',
|
|
76
|
+
{
|
|
77
|
+
docId: z
|
|
78
|
+
.string()
|
|
79
|
+
.describe(
|
|
80
|
+
'ID of the document to read, as returned by search_query, search_title or get_all_docs.'
|
|
81
|
+
),
|
|
82
|
+
...docSpaceIdArg,
|
|
83
|
+
},
|
|
84
|
+
async ({ docId, docSpaceId }) => {
|
|
85
|
+
const params = {
|
|
86
|
+
tool: 'get-doc',
|
|
87
|
+
docId,
|
|
88
|
+
docSpaceId,
|
|
89
|
+
}
|
|
90
|
+
return callMcpApi(params)
|
|
53
91
|
}
|
|
54
|
-
|
|
55
|
-
})
|
|
92
|
+
)
|
|
56
93
|
|
|
57
|
-
server.tool(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
94
|
+
server.tool(
|
|
95
|
+
'search_query',
|
|
96
|
+
'Search the Archbee doc space by document content and return the matching documents. This is the tool to use for answering a question from the documentation. An empty query returns every document.',
|
|
97
|
+
{
|
|
98
|
+
query: z
|
|
99
|
+
.string()
|
|
100
|
+
.describe('Text to look for inside the content of the documents.'),
|
|
101
|
+
...docSpaceIdArg,
|
|
102
|
+
},
|
|
103
|
+
async ({ query, docSpaceId }) => {
|
|
104
|
+
const params = {
|
|
105
|
+
tool: 'search-query',
|
|
106
|
+
query,
|
|
107
|
+
docSpaceId,
|
|
108
|
+
}
|
|
109
|
+
return callMcpApi(params)
|
|
61
110
|
}
|
|
62
|
-
|
|
63
|
-
})
|
|
111
|
+
)
|
|
64
112
|
|
|
65
|
-
server.tool(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
113
|
+
server.tool(
|
|
114
|
+
'search_title',
|
|
115
|
+
'Search the Archbee doc space by document title. Use this when looking for a page by name; use search_query to search inside document content.',
|
|
116
|
+
{
|
|
117
|
+
query: z.string().describe('Text to look for in the document titles.'),
|
|
118
|
+
...docSpaceIdArg,
|
|
119
|
+
},
|
|
120
|
+
async ({ query, docSpaceId }) => {
|
|
121
|
+
const params = {
|
|
122
|
+
tool: 'search-title',
|
|
123
|
+
query,
|
|
124
|
+
docSpaceId,
|
|
125
|
+
}
|
|
126
|
+
return callMcpApi(params)
|
|
69
127
|
}
|
|
70
|
-
|
|
71
|
-
})
|
|
128
|
+
)
|
|
72
129
|
|
|
73
|
-
// Write tools.
|
|
74
|
-
//
|
|
130
|
+
// Write tools. With a space key the target space comes from SPACE_ID; with a
|
|
131
|
+
// team key it comes from the docSpaceId argument, which the three team-level
|
|
132
|
+
// tools below do not take because they act on the team, not on a space.
|
|
75
133
|
|
|
76
134
|
server.tool(
|
|
77
135
|
'create_doc',
|
|
@@ -104,6 +162,7 @@ server.tool(
|
|
|
104
162
|
.boolean()
|
|
105
163
|
.optional()
|
|
106
164
|
.describe('When true, the document is hidden from navigation.'),
|
|
165
|
+
...docSpaceIdArg,
|
|
107
166
|
},
|
|
108
167
|
async (args) => callWriteApi({ tool: 'create-doc', ...args })
|
|
109
168
|
)
|
|
@@ -141,6 +200,7 @@ server.tool(
|
|
|
141
200
|
.boolean()
|
|
142
201
|
.optional()
|
|
143
202
|
.describe('When true, the document is hidden from navigation.'),
|
|
203
|
+
...docSpaceIdArg,
|
|
144
204
|
},
|
|
145
205
|
async (args) => callWriteApi({ tool: 'update-doc', ...args })
|
|
146
206
|
)
|
|
@@ -156,6 +216,7 @@ server.tool(
|
|
|
156
216
|
.describe(
|
|
157
217
|
'Required (set to true) to delete a document that has nested child documents, which deletes those children too. When the document has children and this is not set, the call is rejected and the response lists the child documents that would be affected.'
|
|
158
218
|
),
|
|
219
|
+
...docSpaceIdArg,
|
|
159
220
|
},
|
|
160
221
|
async (args) => callWriteApi({ tool: 'delete-doc', ...args })
|
|
161
222
|
)
|
|
@@ -223,8 +284,12 @@ const publicAccessControlPartSchema = z
|
|
|
223
284
|
|
|
224
285
|
server.tool(
|
|
225
286
|
'update_doc_space',
|
|
226
|
-
'Update
|
|
287
|
+
'Update an Archbee doc space: rename it, or change its hostname, space links or public access control. Only the provided parts are changed, and at least one must be provided. The response echoes the space name, and get_all_docs / get_doc report it too, so a rename can be verified.',
|
|
227
288
|
{
|
|
289
|
+
name: z
|
|
290
|
+
.string()
|
|
291
|
+
.optional()
|
|
292
|
+
.describe('New display name for the space (renames it).'),
|
|
228
293
|
hostnamePart: z
|
|
229
294
|
.object({ hostname: z.string(), hostnamePath: z.string() })
|
|
230
295
|
.optional()
|
|
@@ -238,15 +303,16 @@ server.tool(
|
|
|
238
303
|
publicAccessControlPart: publicAccessControlPartSchema
|
|
239
304
|
.optional()
|
|
240
305
|
.describe('Public access control and authentication configuration.'),
|
|
306
|
+
...docSpaceIdArg,
|
|
241
307
|
},
|
|
242
308
|
async (args) => callWriteApi({ tool: 'update-doc-space', ...args })
|
|
243
309
|
)
|
|
244
310
|
|
|
245
311
|
server.tool(
|
|
246
312
|
'delete_doc_space',
|
|
247
|
-
'Permanently delete
|
|
248
|
-
{},
|
|
249
|
-
async () => callWriteApi({ tool: 'delete-doc-space' })
|
|
313
|
+
'Permanently delete an Archbee doc space together with every document inside it. This is destructive and cannot be undone. With a space API key the space deleted is the one SPACE_ID points at, so that key dies with it and no further tool call will work; with a team key it is the space named by docSpaceId. Ask the user to confirm before calling this tool.',
|
|
314
|
+
{ ...docSpaceIdArg },
|
|
315
|
+
async (args) => callWriteApi({ tool: 'delete-doc-space', ...args })
|
|
250
316
|
)
|
|
251
317
|
|
|
252
318
|
server.tool(
|
|
@@ -281,6 +347,48 @@ server.tool(
|
|
|
281
347
|
async (args) => callWriteApi({ tool: 'delete-space-group', ...args })
|
|
282
348
|
)
|
|
283
349
|
|
|
350
|
+
server.tool(
|
|
351
|
+
'create_category',
|
|
352
|
+
'Create a category (a folder in the space navigation) in an Archbee doc space. A category holds documents but has no content of its own. To put a document inside it, pass the returned categoryId as `parentDocId` on create_doc or update_doc.',
|
|
353
|
+
{
|
|
354
|
+
categoryName: z.string().describe('Name of the category to create.'),
|
|
355
|
+
parentDocId: z
|
|
356
|
+
.string()
|
|
357
|
+
.optional()
|
|
358
|
+
.describe(
|
|
359
|
+
'ID of the document or category to nest this category under. Omit to create it at the top level of the space.'
|
|
360
|
+
),
|
|
361
|
+
...docSpaceIdArg,
|
|
362
|
+
},
|
|
363
|
+
async (args) => callWriteApi({ tool: 'create-category', ...args })
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
server.tool(
|
|
367
|
+
'delete_category',
|
|
368
|
+
'Delete a category from an Archbee doc space. The category must already be empty: move or delete the documents inside it first, otherwise the call is rejected. Deleting a category never deletes documents.',
|
|
369
|
+
{
|
|
370
|
+
categoryId: z.string().describe('ID of the category to delete.'),
|
|
371
|
+
...docSpaceIdArg,
|
|
372
|
+
},
|
|
373
|
+
async (args) => callWriteApi({ tool: 'delete-category', ...args })
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
// Origin of the Archbee API the key belongs to, same variable the CLI takes.
|
|
377
|
+
// app.archbee.com/api is being phased out, so the default is api.archbee.com.
|
|
378
|
+
const apiMcpUrl = (): string | null => {
|
|
379
|
+
const apiUrlInput = (process.env.ARCHBEE_API_URL || '').trim()
|
|
380
|
+
|
|
381
|
+
if (!apiUrlInput) {
|
|
382
|
+
return 'https://api.archbee.com/api/public-mcp'
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
try {
|
|
386
|
+
return new URL('/api/public-mcp', apiUrlInput).toString()
|
|
387
|
+
} catch {
|
|
388
|
+
return null
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
284
392
|
const processUrl = (urlInput: string): string | null => {
|
|
285
393
|
try {
|
|
286
394
|
const url = new URL(urlInput)
|
|
@@ -295,11 +403,32 @@ const processUrl = (urlInput: string): string | null => {
|
|
|
295
403
|
}
|
|
296
404
|
}
|
|
297
405
|
|
|
406
|
+
// A team key authenticates on its own, so team-level tools need no space at all.
|
|
407
|
+
// A space key carries no space id, so it travels packed with one.
|
|
408
|
+
const authorizationHeader = (docSpaceId: string): string => {
|
|
409
|
+
const apiKey = process.env.API_KEY || ''
|
|
410
|
+
|
|
411
|
+
if (!apiKey) {
|
|
412
|
+
return ''
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (usesTeamApiKey()) {
|
|
416
|
+
return `Bearer ${apiKey}`
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return docSpaceId
|
|
420
|
+
? `Bearer ${Buffer.from(`${docSpaceId}~${apiKey}`).toString('base64')}`
|
|
421
|
+
: ''
|
|
422
|
+
}
|
|
423
|
+
|
|
298
424
|
const callMcpApi = async (params: McpApiParams): Promise<CallToolResult> => {
|
|
299
425
|
const urlInput = process.env.API_BASE || ''
|
|
300
|
-
const
|
|
426
|
+
const teamMode = usesTeamApiKey()
|
|
427
|
+
const docSpaceIdInput = teamMode
|
|
428
|
+
? params.docSpaceId || ''
|
|
429
|
+
: process.env.SPACE_ID || ''
|
|
301
430
|
|
|
302
|
-
if (!urlInput && !docSpaceIdInput) {
|
|
431
|
+
if (!teamMode && !urlInput && !docSpaceIdInput) {
|
|
303
432
|
return {
|
|
304
433
|
content: [{ type: 'text', text: 'API base URL or docSpaceId not set.' }],
|
|
305
434
|
isError: true,
|
|
@@ -313,28 +442,33 @@ const callMcpApi = async (params: McpApiParams): Promise<CallToolResult> => {
|
|
|
313
442
|
}
|
|
314
443
|
}
|
|
315
444
|
|
|
316
|
-
const urlMcp = urlInput
|
|
317
|
-
? processUrl(urlInput)
|
|
318
|
-
: 'https://app.archbee.com/api/public-mcp'
|
|
445
|
+
const urlMcp = urlInput ? processUrl(urlInput) : apiMcpUrl()
|
|
319
446
|
|
|
320
447
|
if (urlMcp === null) {
|
|
321
448
|
return {
|
|
322
|
-
content: [
|
|
449
|
+
content: [
|
|
450
|
+
{
|
|
451
|
+
type: 'text',
|
|
452
|
+
text: 'Invalid API base URL or ARCHBEE_API_URL format.',
|
|
453
|
+
},
|
|
454
|
+
],
|
|
323
455
|
isError: true,
|
|
324
456
|
}
|
|
325
457
|
}
|
|
326
458
|
|
|
459
|
+
const authorization = authorizationHeader(docSpaceIdInput)
|
|
460
|
+
|
|
327
461
|
try {
|
|
328
462
|
let dataText: string
|
|
329
463
|
|
|
330
|
-
if (
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
464
|
+
if (authorization) {
|
|
465
|
+
if (docSpaceIdInput) {
|
|
466
|
+
params.docSpaceId = docSpaceIdInput
|
|
467
|
+
}
|
|
334
468
|
|
|
335
469
|
const response = await axios.post(urlMcp, params, {
|
|
336
470
|
headers: {
|
|
337
|
-
Authorization:
|
|
471
|
+
Authorization: authorization,
|
|
338
472
|
'Content-Type': 'application/json',
|
|
339
473
|
},
|
|
340
474
|
timeout: 30000,
|
|
@@ -366,14 +500,17 @@ const callMcpApi = async (params: McpApiParams): Promise<CallToolResult> => {
|
|
|
366
500
|
// made with a PUBLISHED-/PREVIEW- snapshot credential. Both cases fail here with
|
|
367
501
|
// an explanation rather than as an opaque rejection from the server.
|
|
368
502
|
const callWriteApi = async (params: McpApiParams): Promise<CallToolResult> => {
|
|
369
|
-
const
|
|
503
|
+
const teamMode = usesTeamApiKey()
|
|
504
|
+
const docSpaceIdInput = teamMode
|
|
505
|
+
? params.docSpaceId || ''
|
|
506
|
+
: process.env.SPACE_ID || ''
|
|
370
507
|
|
|
371
|
-
if (!
|
|
508
|
+
if (!process.env.API_KEY || (!teamMode && !docSpaceIdInput)) {
|
|
372
509
|
return {
|
|
373
510
|
content: [
|
|
374
511
|
{
|
|
375
512
|
type: 'text',
|
|
376
|
-
text: 'Write tools need
|
|
513
|
+
text: 'Write tools need an API_KEY, plus SPACE_ID when the key is a space key. The API_BASE configuration is read-only.',
|
|
377
514
|
},
|
|
378
515
|
],
|
|
379
516
|
isError: true,
|
|
@@ -388,7 +525,7 @@ const callWriteApi = async (params: McpApiParams): Promise<CallToolResult> => {
|
|
|
388
525
|
content: [
|
|
389
526
|
{
|
|
390
527
|
type: 'text',
|
|
391
|
-
text: '
|
|
528
|
+
text: 'The target space is a published/preview snapshot, which cannot be written to. Use the live space id from the space URL in the Archbee app.',
|
|
392
529
|
},
|
|
393
530
|
],
|
|
394
531
|
isError: true,
|