@archbee/mcp 2.0.0 → 2.2.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 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
- Every tool acts on the space configured below, so `docSpaceId` never has to be passed in.
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,19 +27,19 @@ 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 the space id configuration below:
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
34
34
  - Input:
35
35
  - `content` (string): body as Markdown or MDX text
36
36
  - `format` (`markdown` | `mdx`, optional): use `mdx` for JSX-style components such as `<hint>` or `<Tabs>`; directive-style (`:::hint{type="info"}`) works in both. Defaults to `markdown`
37
- - also optional: `title`, `parentDocId`, `slug`, `description`, `previewImgURL`, `hidden`
37
+ - also optional: `title`, `parentDocId`, `slug`, `description`, `previewImgURL`, `hidden`, `icon`
38
38
  6. `update_doc`
39
39
  - Updates a document; only the fields you send are changed
40
40
  - Input:
41
41
  - `docId` (string): document to update
42
- - optional: `content`, `format`, `title`, `parentDocId`, `slug`, `description`, `previewImgURL`, `hidden`
42
+ - optional: `content`, `format`, `title`, `parentDocId`, `slug`, `description`, `previewImgURL`, `hidden`, `icon`
43
43
  7. `delete_doc`
44
44
  - Permanently deletes a document, its uploaded files and images. Cannot be undone
45
45
  - Input:
@@ -49,10 +49,12 @@ Write — these need the space id configuration below:
49
49
  - Creates a doc space in the team
50
50
  - Input:
51
51
  - `name` (string): name of the new space
52
- - optional: `isReviewSystemEnabled`, `isBranchingSystemEnabled`, `docSpaceGroupId`
52
+ - optional: `isReviewSystemEnabled`, `isBranchingSystemEnabled`, `docSpaceGroupId`, `icon`
53
53
  9. `update_doc_space`
54
54
  - Updates settings of the configured space; only the parts you send are changed
55
55
  - Input, all optional:
56
+ - `name` (string): renames the space
57
+ - `icon` (string): left-nav icon
56
58
  - `hostnamePart` (`{ hostname, hostnamePath }`): custom hostname configuration
57
59
  - `spaceLinks` (`{ label, docSpaceId }[]`): links to other spaces; the list should start with the current space
58
60
  - `publicAccessControlPart`: public access control and authentication configuration
@@ -67,6 +69,70 @@ Write — these need the space id configuration below:
67
69
  - Deletes an empty space group. Requires a team admin
68
70
  - Input:
69
71
  - `docSpaceGroupId` (string): group to delete
72
+ 13. `create_category`
73
+ - Creates a category (a folder in the space navigation)
74
+ - Input:
75
+ - `categoryName` (string): name of the category
76
+ - `parentDocId` (string, optional): node to nest it under
77
+ 14. `delete_category`
78
+ - Deletes an empty category. Documents are never deleted
79
+ - Input:
80
+ - `categoryId` (string): category to delete
81
+
82
+ An `icon` is either an emoji (`"🚀"`), or a JSON string naming an icon:
83
+ `{"lucideIcon":"Rocket"}`, `{"faIcon":"fa-solid fa-rocket"}` or `{"apiMethod":"GET"}`.
84
+ An empty string clears it; anything else is rejected.
85
+
86
+ Reusable resources — templates, content snippets and variables belong to the organization, not to a
87
+ space, so these take no `docSpaceId`. The `list_*` tools work with either key; the rest need a team key:
88
+
89
+ 15. `list_templates`
90
+ - Lists the saved document templates, with their content as markdown
91
+ 16. `create_template`
92
+ - Saves a new document template
93
+ - Input:
94
+ - `name` (string): name of the template
95
+ - optional: `content`, `format`, `icon`
96
+ 17. `apply_template`
97
+ - Creates a document from a template, copying its content verbatim
98
+ - Input:
99
+ - `templateId` (string): template to apply
100
+ - optional: `title` (defaults to the template name), `parentDocId`, `slug`, `icon`
101
+ 18. `list_content_snippets`
102
+ - Lists the reusable content snippets, with their content as markdown
103
+ 19. `create_content_snippet`
104
+ - Creates a content snippet. Requires a Scaling or Enterprise subscription
105
+ - Input:
106
+ - `name` (string): name of the snippet
107
+ - optional: `content`, `format`
108
+ 20. `update_content_snippet`
109
+ - Renames a snippet, replaces its content, or both — reaching every document that embeds it
110
+ - Input:
111
+ - `snippetId` (string): snippet to update
112
+ - at least one of: `name`, `content` (plus optional `format`)
113
+ 21. `delete_content_snippet`
114
+ - Permanently deletes a content snippet. Cannot be undone
115
+ - Input:
116
+ - `snippetId` (string): snippet to delete
117
+ 22. `list_variables`
118
+ - Lists the content variables and glossary terms, with their values and overrides
119
+ - Input:
120
+ - `variableType` (`variable` | `glossary`, optional): omit for both
121
+ 23. `create_variable`
122
+ - Creates a content variable or glossary term. Requires a Scaling or Enterprise subscription
123
+ - Input:
124
+ - `name` (string): how documents reference it; unique within its type
125
+ - `variableContent` (string): value it resolves to
126
+ - optional: `description`, `variableType`, `spaceTargetMap` (per-space or per-language overrides)
127
+ 24. `update_variable`
128
+ - Updates a variable or glossary term; only the fields you send are changed
129
+ - Input:
130
+ - `variableId` (string): variable to update
131
+ - at least one of: `name`, `variableContent`, `description`, `variableType`, `spaceTargetMap`
132
+ 25. `delete_variable`
133
+ - Permanently deletes a variable or glossary term. References to it stop resolving
134
+ - Input:
135
+ - `variableId` (string): variable to delete
70
136
 
71
137
  ## Setup
72
138
 
@@ -106,7 +172,7 @@ You can get an API token from Space Settings in Archbee app.
106
172
 
107
173
  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
174
 
109
- An API key belongs to one space, so this server writes to that space only. To give an assistant write access across every space in the team, connect it to the hosted Archbee MCP endpoint instead and authorize it with your Archbee account — that connector is team-scoped and takes a `docSpaceId` per call.
175
+ 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
176
 
111
177
  ```json
112
178
  {
@@ -122,3 +188,50 @@ An API key belongs to one space, so this server writes to that space only. To gi
122
188
  }
123
189
  }
124
190
  ```
191
+
192
+ ### Environment Variables - team key
193
+
194
+ 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.
195
+
196
+ - `API_KEY`: Team key, starting with `abteam_`
197
+
198
+ A team key is accepted on the MCP endpoints only — the rest of the Public API and the CLI still take a space key.
199
+
200
+ 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`, `apply_template`, `create_category`, `delete_category`, `update_doc_space` and `delete_doc_space` take a `docSpaceId` argument; `create_doc_space`, `create_space_group`, `delete_space_group` and every reusable-resource tool act on the organization and take none.
201
+
202
+ ```json
203
+ {
204
+ "mcpServers": {
205
+ "archbee": {
206
+ "command": "pnpm",
207
+ "args": ["dlx", "@archbee/mcp"],
208
+ "env": {
209
+ "API_KEY": "abteam_<team-key>"
210
+ }
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ ### Environment Variables - other Archbee installs
217
+
218
+ 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:
219
+
220
+ - `ARCHBEE_API_URL`: Origin of your Archbee API, e.g. `https://qa.archbee.com` or `http://localhost:4000`
221
+
222
+ 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.
223
+
224
+ ```json
225
+ {
226
+ "mcpServers": {
227
+ "archbee": {
228
+ "command": "pnpm",
229
+ "args": ["dlx", "@archbee/mcp"],
230
+ "env": {
231
+ "ARCHBEE_API_URL": "https://qa.archbee.com",
232
+ "API_KEY": "abteam_<team-key>"
233
+ }
234
+ }
235
+ }
236
+ }
237
+ ```
package/dist/index.js CHANGED
@@ -7,188 +7,58 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  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
- const zod_1 = require("zod");
11
- 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.';
10
+ const tool_schemas_1 = require("./tool-schemas");
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);
12
15
  // Create an MCP server
13
16
  const server = new mcp_js_1.McpServer({
14
17
  name: 'Archbee MCP',
15
- version: '1.0.0',
18
+ version: '2.2.0',
16
19
  });
17
- server.tool('get_all_docs', {}, async ({}) => {
18
- const params = {
19
- tool: 'get-all-docs',
20
- };
21
- return callMcpApi(params);
22
- });
23
- server.tool('get_doc', { docId: zod_1.z.string() }, async ({ docId }) => {
24
- const params = {
25
- tool: 'get-doc',
26
- docId,
27
- };
28
- return callMcpApi(params);
29
- });
30
- server.tool('search_query', { query: zod_1.z.string() }, async ({ query }) => {
31
- const params = {
32
- tool: 'search-query',
33
- query,
34
- };
35
- return callMcpApi(params);
36
- });
37
- server.tool('search_title', { query: zod_1.z.string() }, async ({ query }) => {
38
- const params = {
39
- tool: 'search-title',
40
- query,
41
- };
42
- return callMcpApi(params);
43
- });
44
- // Write tools. The target space always comes from SPACE_ID — callMcpApi puts it
45
- // on every request — so no tool takes a docSpaceId argument.
46
- server.tool('create_doc', 'Create a new document in the Archbee doc space from Markdown or MDX content.', {
47
- content: zod_1.z
48
- .string()
49
- .describe('Body of the document to create, as Markdown or MDX text. JSON document content is not accepted.'),
50
- format: zod_1.z
51
- .enum(['markdown', 'mdx'])
52
- .optional()
53
- .describe(MDX_FORMAT_DESCRIPTION),
54
- title: zod_1.z.string().optional().describe('Title of the document.'),
55
- parentDocId: zod_1.z
56
- .string()
57
- .optional()
58
- .describe('ID of the parent document to nest this document under.'),
59
- slug: zod_1.z.string().optional().describe('URL slug for the document.'),
60
- description: zod_1.z
61
- .string()
62
- .optional()
63
- .describe('Short description / summary of the document.'),
64
- previewImgURL: zod_1.z
65
- .string()
66
- .optional()
67
- .describe('URL of the preview / social image for the document.'),
68
- hidden: zod_1.z
69
- .boolean()
70
- .optional()
71
- .describe('When true, the document is hidden from navigation.'),
72
- }, async (args) => callWriteApi({ tool: 'create-doc', ...args }));
73
- server.tool('update_doc', 'Update an existing Archbee document. Only the provided fields are changed.', {
74
- docId: zod_1.z.string().describe('ID of the document to update.'),
75
- content: zod_1.z
76
- .string()
77
- .optional()
78
- .describe('New body for the document, as Markdown or MDX text. JSON document content is not accepted.'),
79
- format: zod_1.z
80
- .enum(['markdown', 'mdx'])
81
- .optional()
82
- .describe(MDX_FORMAT_DESCRIPTION),
83
- title: zod_1.z.string().optional().describe('New title of the document.'),
84
- parentDocId: zod_1.z
85
- .string()
86
- .optional()
87
- .describe('ID of the parent document to move this document under.'),
88
- slug: zod_1.z.string().optional().describe('New URL slug for the document.'),
89
- description: zod_1.z
90
- .string()
91
- .optional()
92
- .describe('New short description / summary of the document.'),
93
- previewImgURL: zod_1.z
94
- .string()
95
- .optional()
96
- .describe('New preview / social image URL for the document.'),
97
- hidden: zod_1.z
98
- .boolean()
99
- .optional()
100
- .describe('When true, the document is hidden from navigation.'),
101
- }, async (args) => callWriteApi({ tool: 'update-doc', ...args }));
102
- 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
- docId: zod_1.z.string().describe('ID of the document to delete.'),
104
- recursive: zod_1.z
105
- .boolean()
106
- .optional()
107
- .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.'),
108
- }, async (args) => callWriteApi({ tool: 'delete-doc', ...args }));
109
- server.tool('create_doc_space', 'Create a new doc space (documentation space) in the current Archbee team.', {
110
- name: zod_1.z.string().describe('Name of the new doc space.'),
111
- isReviewSystemEnabled: zod_1.z
112
- .boolean()
113
- .optional()
114
- .describe('Enable the review/approval workflow for the space.'),
115
- isBranchingSystemEnabled: zod_1.z
116
- .boolean()
117
- .optional()
118
- .describe('Enable the branching (git-style) workflow for the space.'),
119
- docSpaceGroupId: zod_1.z
120
- .string()
121
- .optional()
122
- .describe('ID of the collection/group to place the new space in.'),
123
- }, async (args) => callWriteApi({ tool: 'create-doc-space', ...args }));
124
- // Mirrors PublicAPIUpdateDocSpaceRequestSchema in @archbee/data-access, which
125
- // this standalone package cannot import. The API re-validates with the real
126
- // schema, so this only has to describe the shape well enough for the model;
127
- // publicAccessControlPart passes unknown keys through so newer access-control
128
- // fields keep working without a release here.
129
- const emailListSchema = zod_1.z.array(zod_1.z.object({ email: zod_1.z.string() }));
130
- const publicAccessControlPartSchema = zod_1.z
131
- .object({
132
- publicProtectionTypes: zod_1.z
133
- .array(zod_1.z.enum([
134
- 'None',
135
- 'Password',
136
- 'Guest accounts',
137
- 'Private Accounts',
138
- 'Private Link',
139
- 'Magic Link',
140
- 'JWT',
141
- 'SAML',
142
- 'OIDC',
143
- ]))
144
- .optional(),
145
- publicPassword: zod_1.z.string().optional(),
146
- publicGuestAccounts: zod_1.z
147
- .array(zod_1.z.object({ email: zod_1.z.string(), password: zod_1.z.string() }))
148
- .optional(),
149
- publicMagicLinkAccounts: emailListSchema.optional(),
150
- publicPrivateAccounts: emailListSchema.optional(),
151
- jwtValidationType: zod_1.z.string().optional(),
152
- jwtKeyUrl: zod_1.z.string().optional(),
153
- jwtSecret: zod_1.z.string().optional(),
154
- jwtRedirectURL: zod_1.z.string().optional(),
155
- samlMetadata: zod_1.z.string().optional(),
156
- samlEntityId: zod_1.z.string().optional(),
157
- conditionalRuleId: zod_1.z.string().optional(),
158
- })
159
- .passthrough();
160
- server.tool('update_doc_space', 'Update settings of the Archbee doc space (hostname, space links, public access control). Only the provided parts are changed.', {
161
- hostnamePart: zod_1.z
162
- .object({ hostname: zod_1.z.string(), hostnamePath: zod_1.z.string() })
163
- .optional()
164
- .describe('Custom hostname configuration for the space.'),
165
- spaceLinks: zod_1.z
166
- .array(zod_1.z.object({ label: zod_1.z.string(), docSpaceId: zod_1.z.string() }))
167
- .optional()
168
- .describe('Links to other spaces. The list should start with the current space.'),
169
- publicAccessControlPart: publicAccessControlPartSchema
170
- .optional()
171
- .describe('Public access control and authentication configuration.'),
172
- }, async (args) => callWriteApi({ tool: 'update-doc-space', ...args }));
173
- server.tool('delete_doc_space', 'Permanently delete the configured Archbee doc space together with every document inside it. This is destructive and cannot be undone. The space that gets deleted is the one SPACE_ID points at, so API_KEY is destroyed along with it and no further tool call will work. Ask the user to confirm before calling this tool.', {}, async () => callWriteApi({ tool: 'delete-doc-space' }));
174
- server.tool('create_space_group', 'Create a new space group (collection of doc spaces) in the current Archbee team. Requires a team admin.', {
175
- name: zod_1.z.string().describe('Name of the new space group.'),
176
- isAiEnabled: zod_1.z
177
- .boolean()
178
- .optional()
179
- .describe('Enable AI features for the space group.'),
180
- isReviewSystemEnabled: zod_1.z
181
- .boolean()
182
- .optional()
183
- .describe('Enable the review/approval workflow for the space group.'),
184
- isBranchingSystemEnabled: zod_1.z
185
- .boolean()
186
- .optional()
187
- .describe('Enable the branching (git-style) workflow for the space group.'),
188
- }, async (args) => callWriteApi({ tool: 'create-space-group', ...args }));
189
- 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
- docSpaceGroupId: zod_1.z.string().describe('ID of the space group to delete.'),
191
- }, async (args) => callWriteApi({ tool: 'delete-space-group', ...args }));
20
+ 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.', tool_schemas_1.getAllDocsSchema, async (args) => callMcpApi({ tool: 'get-all-docs', ...args }));
21
+ 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.', tool_schemas_1.getDocSchema, async (args) => callMcpApi({ tool: 'get-doc', ...args }));
22
+ 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.', tool_schemas_1.searchQuerySchema, async (args) => callMcpApi({ tool: 'search-query', ...args }));
23
+ 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.', tool_schemas_1.searchTitleSchema, async (args) => callMcpApi({ tool: 'search-title', ...args }));
24
+ // Write tools. With a space key the target space comes from SPACE_ID; with a
25
+ // team key it comes from the docSpaceId argument, which the team-level tools
26
+ // below do not take because they act on the team, not on a space.
27
+ server.tool('create_doc', 'Create a new document in the Archbee doc space from Markdown or MDX content.', tool_schemas_1.createDocSchema, async (args) => callWriteApi({ tool: 'create-doc', ...args }));
28
+ server.tool('update_doc', 'Update an existing Archbee document. Only the provided fields are changed.', tool_schemas_1.updateDocSchema, async (args) => callWriteApi({ tool: 'update-doc', ...args }));
29
+ 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.', tool_schemas_1.deleteDocSchema, async (args) => callWriteApi({ tool: 'delete-doc', ...args }));
30
+ server.tool('create_doc_space', 'Create a new doc space (documentation space) in the current Archbee team.', tool_schemas_1.createDocSpaceSchema, async (args) => callWriteApi({ tool: 'create-doc-space', ...args }));
31
+ server.tool('update_doc_space', 'Update an Archbee doc space: rename it, or change its icon, 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 icon, and get_all_docs / get_doc report the name too, so a rename can be verified.', tool_schemas_1.updateDocSpaceSchema, async (args) => callWriteApi({ tool: 'update-doc-space', ...args }));
32
+ 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.', tool_schemas_1.deleteDocSpaceSchema, async (args) => callWriteApi({ tool: 'delete-doc-space', ...args }));
33
+ server.tool('create_space_group', 'Create a new space group (collection of doc spaces) in the current Archbee team. Requires a team admin.', tool_schemas_1.createSpaceGroupSchema, async (args) => callWriteApi({ tool: 'create-space-group', ...args }));
34
+ 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.', tool_schemas_1.deleteSpaceGroupSchema, async (args) => callWriteApi({ tool: 'delete-space-group', ...args }));
35
+ 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.', tool_schemas_1.createCategorySchema, async (args) => callWriteApi({ tool: 'create-category', ...args }));
36
+ 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.', tool_schemas_1.deleteCategorySchema, async (args) => callWriteApi({ tool: 'delete-category', ...args }));
37
+ server.tool('list_templates', 'List the document templates saved in the Archbee organization (Reusables → Templates), each with its id, name and content as markdown. Use apply_template to create a document from one.', tool_schemas_1.listTemplatesSchema, async () => callMcpApi({ tool: 'list-templates' }));
38
+ server.tool('create_template', 'Save a new document template in the Archbee organization, from Markdown or MDX content. A template is a starting point for new documents; it is not itself a published page.', tool_schemas_1.createTemplateSchema, async (args) => callWriteApi({ tool: 'create-template', ...args }));
39
+ server.tool('apply_template', 'Create a new Archbee document from a saved template. The template content is copied verbatim, including blocks markdown cannot express (API endpoints, diagrams). The template itself is unchanged.', tool_schemas_1.applyTemplateSchema, async (args) => callWriteApi({ tool: 'apply-template', ...args }));
40
+ server.tool('list_content_snippets', 'List the reusable content snippets saved in the Archbee organization (Reusables → Content snippets), each with its id, name and content as markdown. A snippet is a block of content embedded into many documents and edited in one place.', tool_schemas_1.listContentSnippetsSchema, async () => callMcpApi({ tool: 'list-content-snippets' }));
41
+ server.tool('create_content_snippet', 'Create a reusable content snippet in the Archbee organization, from Markdown or MDX content. Requires a Scaling or Enterprise subscription.', tool_schemas_1.createContentSnippetSchema, async (args) => callWriteApi({ tool: 'create-content-snippet', ...args }));
42
+ server.tool('update_content_snippet', 'Update a reusable content snippet: rename it, replace its content, or both. The change reaches every document the snippet is embedded in. At least one of name or content must be provided.', tool_schemas_1.updateContentSnippetSchema, async (args) => callWriteApi({ tool: 'update-content-snippet', ...args }));
43
+ server.tool('delete_content_snippet', 'Permanently delete a reusable content snippet from the Archbee organization. Documents that embed it lose that content. This cannot be undone — ask the user to confirm before calling this tool.', tool_schemas_1.deleteContentSnippetSchema, async (args) => callWriteApi({ tool: 'delete-content-snippet', ...args }));
44
+ server.tool('list_variables', 'List the content variables and glossary terms saved in the Archbee organization (Reusables → Variables / Glossary), each with its id, name, value and per-space or per-language overrides.', tool_schemas_1.listVariablesSchema, async (args) => callMcpApi({ tool: 'list-variables', ...args }));
45
+ server.tool('create_variable', 'Create a content variable (or a glossary term) in the Archbee organization. A variable is referenced by name inside document content and resolved at render time. Requires a Scaling or Enterprise subscription.', tool_schemas_1.createVariableSchema, async (args) => callWriteApi({ tool: 'create-variable', ...args }));
46
+ server.tool('update_variable', 'Update a content variable or glossary term. Only the provided fields change, and at least one must be provided. The new value reaches every document that references it.', tool_schemas_1.updateVariableSchema, async (args) => callWriteApi({ tool: 'update-variable', ...args }));
47
+ server.tool('delete_variable', 'Permanently delete a content variable or glossary term from the Archbee organization. Documents that reference it by name stop resolving. Ask the user to confirm before calling this tool.', tool_schemas_1.deleteVariableSchema, async (args) => callWriteApi({ tool: 'delete-variable', ...args }));
48
+ // Origin of the Archbee API the key belongs to, same variable the CLI takes.
49
+ // app.archbee.com/api is being phased out, so the default is api.archbee.com.
50
+ const apiMcpUrl = () => {
51
+ const apiUrlInput = (process.env.ARCHBEE_API_URL || '').trim();
52
+ if (!apiUrlInput) {
53
+ return 'https://api.archbee.com/api/public-mcp';
54
+ }
55
+ try {
56
+ return new URL('/api/public-mcp', apiUrlInput).toString();
57
+ }
58
+ catch {
59
+ return null;
60
+ }
61
+ };
192
62
  const processUrl = (urlInput) => {
193
63
  try {
194
64
  const url = new URL(urlInput);
@@ -201,10 +71,27 @@ const processUrl = (urlInput) => {
201
71
  return null;
202
72
  }
203
73
  };
74
+ // A team key authenticates on its own, so team-level tools need no space at all.
75
+ // A space key carries no space id, so it travels packed with one.
76
+ const authorizationHeader = (docSpaceId) => {
77
+ const apiKey = process.env.API_KEY || '';
78
+ if (!apiKey) {
79
+ return '';
80
+ }
81
+ if (usesTeamApiKey()) {
82
+ return `Bearer ${apiKey}`;
83
+ }
84
+ return docSpaceId
85
+ ? `Bearer ${Buffer.from(`${docSpaceId}~${apiKey}`).toString('base64')}`
86
+ : '';
87
+ };
204
88
  const callMcpApi = async (params) => {
205
89
  const urlInput = process.env.API_BASE || '';
206
- const docSpaceIdInput = process.env.SPACE_ID || '';
207
- if (!urlInput && !docSpaceIdInput) {
90
+ const teamMode = usesTeamApiKey();
91
+ const docSpaceIdInput = teamMode
92
+ ? params.docSpaceId || ''
93
+ : process.env.SPACE_ID || '';
94
+ if (!teamMode && !urlInput && !docSpaceIdInput) {
208
95
  return {
209
96
  content: [{ type: 'text', text: 'API base URL or docSpaceId not set.' }],
210
97
  isError: true,
@@ -216,24 +103,28 @@ const callMcpApi = async (params) => {
216
103
  isError: true,
217
104
  };
218
105
  }
219
- const urlMcp = urlInput
220
- ? processUrl(urlInput)
221
- : 'https://app.archbee.com/api/public-mcp';
106
+ const urlMcp = urlInput ? processUrl(urlInput) : apiMcpUrl();
222
107
  if (urlMcp === null) {
223
108
  return {
224
- content: [{ type: 'text', text: 'Invalid API base URL format.' }],
109
+ content: [
110
+ {
111
+ type: 'text',
112
+ text: 'Invalid API base URL or ARCHBEE_API_URL format.',
113
+ },
114
+ ],
225
115
  isError: true,
226
116
  };
227
117
  }
118
+ const authorization = authorizationHeader(docSpaceIdInput);
228
119
  try {
229
120
  let dataText;
230
- if (docSpaceIdInput) {
231
- params.docSpaceId = docSpaceIdInput;
232
- const rawAuth = `${docSpaceIdInput}~${process.env.API_KEY}`;
233
- const base64Auth = Buffer.from(rawAuth).toString('base64');
121
+ if (authorization) {
122
+ if (docSpaceIdInput) {
123
+ params.docSpaceId = docSpaceIdInput;
124
+ }
234
125
  const response = await axios_1.default.post(urlMcp, params, {
235
126
  headers: {
236
- Authorization: `Bearer ${base64Auth}`,
127
+ Authorization: authorization,
237
128
  'Content-Type': 'application/json',
238
129
  },
239
130
  timeout: 30000,
@@ -265,13 +156,16 @@ const callMcpApi = async (params) => {
265
156
  // made with a PUBLISHED-/PREVIEW- snapshot credential. Both cases fail here with
266
157
  // an explanation rather than as an opaque rejection from the server.
267
158
  const callWriteApi = async (params) => {
268
- const docSpaceIdInput = process.env.SPACE_ID || '';
269
- if (!docSpaceIdInput || !process.env.API_KEY) {
159
+ const teamMode = usesTeamApiKey();
160
+ const docSpaceIdInput = teamMode
161
+ ? params.docSpaceId || ''
162
+ : process.env.SPACE_ID || '';
163
+ if (!process.env.API_KEY || (!teamMode && !docSpaceIdInput)) {
270
164
  return {
271
165
  content: [
272
166
  {
273
167
  type: 'text',
274
- text: 'Write tools need both SPACE_ID and API_KEY to be set. The API_BASE configuration is read-only.',
168
+ 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
169
  },
276
170
  ],
277
171
  isError: true,
@@ -283,7 +177,7 @@ const callWriteApi = async (params) => {
283
177
  content: [
284
178
  {
285
179
  type: 'text',
286
- text: 'SPACE_ID points at a published/preview snapshot, which cannot be written to. Set it to the live space id from the space URL in the Archbee app.',
180
+ 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
181
  },
288
182
  ],
289
183
  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,EA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