@ebitex/mcp 1.1.0 → 1.1.314

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
@@ -1,144 +1,144 @@
1
- # @ebitex/mcp
2
-
3
- An [MCP](https://modelcontextprotocol.io) server for the **ebitex suite**. Point an AI agent at it and
4
- it can work in your apps through your own management keys. Today that is **Content**: it can build a
5
- content model end to end (Contracts and their fields, Templates, Components, the Experience tree) and
6
- publish it. Each further app arrives as another set of tools in this same server, so there is one
7
- package to install and one entry in your MCP client, not one per app.
8
-
9
- It runs locally, over `stdio`, authenticated by management keys you mint yourself. Nothing is hosted
10
- by ebitex, so your write-capable keys never leave your machine.
11
-
12
- > This package was published as `@ebitex/content-mcp` until it became the suite's server. That name
13
- > still runs this one and is deprecated; change it to `@ebitex/mcp` when convenient. Nothing else
14
- > changes: the Content tools, resources and environment variables are the same.
15
-
16
- ## Configure it
17
-
18
- ```json
19
- {
20
- "mcpServers": {
21
- "ebitex": {
22
- "command": "npx",
23
- "args": ["-y", "@ebitex/mcp"],
24
- "env": { "EBITEX_CONTENT_MANAGEMENT_KEY": "frm_live_..." }
25
- }
26
- }
27
- }
28
- ```
29
-
30
- **An app's tools appear when its key is set.** Each app has its own key, minted in that app and bound to
31
- one organization, so a session that should reach two apps carries two keys. A server with no app key
32
- set refuses to start and names each variable.
33
-
34
- Shared by every app:
35
-
36
- | Variable | |
37
- |---|---|
38
- | `EBITEX_API_BASE` | Defaults to `https://api.ebitex.io` |
39
- | `EBITEX_MCP_READ_ONLY` | Set to `1` to hide every write tool in every app, regardless of the keys' scopes |
40
-
41
- Content:
42
-
43
- | Variable | |
44
- |---|---|
45
- | `EBITEX_CONTENT_MANAGEMENT_KEY` | **Required to use Content.** Mint one in Content under Settings → API Keys → Management keys |
46
- | `EBITEX_CONTENT_TARGET_MANAGEMENT_KEY` | A second key, for `content_transfer` to import into |
47
- | `EBITEX_CONTENT_REALM` | The realm key the management key is expected to act in. Startup stops if it does not (a key is bound to one realm; this checks, it does not select). Unset: not checked |
48
-
49
- The names from when this server only did Content, `EBITEX_CONTENT_API_BASE` and
50
- `EBITEX_CONTENT_MCP_READ_ONLY`, are still read. If both spellings of the base URL are set the new one
51
- wins; if either read-only variable is set, the session is read-only.
52
-
53
- ## Mint the key deliberately
54
-
55
- A management key is bound to **one organization and one authoring environment**, and acts as **one
56
- role**. That binding is the real safety boundary here, and it is the one this server cannot supply
57
- for you:
58
-
59
- - **Bind it to a non-production authoring environment.** This server has no way to tell which of
60
- your environments is production — that is your own topology, and a management key deliberately
61
- cannot see it. A heuristic would be worse than nothing, because it would be believed.
62
- - **Leave the authoring scope off unless the agent needs to write.** Without it, the write tools are
63
- not merely refused; they are not offered at all.
64
- - **Give it a role with the access it needs and no more.** Branch access rules and workflow gating
65
- apply to a key exactly as they do to a person.
66
-
67
- On startup the server prints, to stderr, which organization and environment the key reached and
68
- which role it acts as. Read it once; if it is not what you expected, stop.
69
-
70
- ## Content tools
71
-
72
- Ten, shaped around what an agent does rather than around REST routes.
73
-
74
- | | |
75
- |---|---|
76
- | `content_whoami` | Where this key is scoped: organization, environment, role, scopes, this server's version, and which tools were withheld and why. Needs no scope, so a key that can do almost nothing can still ask why |
77
- | `content_describe` | What can exist here: every field type with its **own settings schema**, plus this environment's Contracts and Templates |
78
- | `content_find` | Locate entities by kind, search or external id, with one paging contract across both listings |
79
- | `content_get` | Read one entity in full |
80
- | `content_write` | Create or update one entity |
81
- | `content_delete` | Delete one, behind an explicit confirmation |
82
- | `content_publish` | Plan, read the blockers, then publish |
83
- | `content_operation_status` | Poll a job |
84
- | `content_transfer` | Move a whole model between environments, atomically. `identityMode` picks how items are matched: `externalId` (the default, by natural key), `preserve` (by id), or `fresh` (everything new) |
85
- | `content_topology` | Where this environment sits: the delivery environments a publish lands in, and its promotion neighbours. One hop only |
86
-
87
- Which of them appear depends on your key's scopes: a read-scoped key gets a server with no write
88
- tools at all, rather than tools that always fail. `content_whoami` is the exception and always
89
- appears — it reports which tools were withheld and what each would need, so an absent tool is
90
- explained rather than merely missing.
91
-
92
- Every result also names the organization and environment it was answered in, and an empty one says so
93
- explicitly. A key reads and writes exactly one authoring environment, so "no Contracts" always means
94
- "none here" — an agent that reads it as "none anywhere" creates duplicates.
95
-
96
- ## Content: authoring is half the job
97
-
98
- This server builds and publishes a content model. The site that **renders** it reads the Content
99
- Delivery API, and that has its own client, [`@ebitex/content-sdk`](https://www.npmjs.com/package/@ebitex/content-sdk)
100
- (or `Ebitex.Content.Delivery` for .NET). The server's instructions and the
101
- `ebitex-content://help/rendering-your-site` resource tell an agent so before it writes a renderer; if
102
- you are briefing an agent yourself, say the same.
103
-
104
- ## Content: why it cannot drift
105
-
106
- The Content app encodes **no knowledge of the content model**. It does not know what field types exist,
107
- what a Contract may contain, or what makes a document valid. All three are answered at runtime:
108
- `content_describe` returns each field type's own declared schema, and every write is validated by the
109
- server that stores it. There is nothing here to fall out of step, because nothing is duplicated.
110
-
111
- That also shapes how errors work. A refusal is relayed **whole**, with its field paths intact and no
112
- summarizing, because for an agent the error is the control loop: try, read the error, fix the one
113
- field it names, call again.
114
-
115
- ## Content resources
116
-
117
- Alongside the tools, the server offers the Content documentation as MCP resources — start with
118
- `ebitex-content://help/agent-authoring`, which explains what Contracts, Templates, Presentations,
119
- Adapters and the Experience tree are for, and the order to create them in. Then read
120
- `ebitex-content://help/content-modelling` before you decide what the model looks like: it says what belongs in a Contract and what in a Template,
121
- which field to use, how to name things, how to build containers such as tabs and accordions, and how to ship a model to others.
122
-
123
- ## Embedding it
124
-
125
- ```ts
126
- import { buildServer, readConfig } from '@ebitex/mcp'
127
-
128
- const { server, banner } = await buildServer({ config: readConfig() })
129
- console.error(banner) // never stdout — on stdio, that stream is the protocol
130
- ```
131
-
132
- ## A note on `zod`
133
-
134
- This package pins `zod` to `^3.25.76` rather than `^4`, even though `@modelcontextprotocol/sdk`
135
- accepts either. The reason is type identity, not capability: the SDK's schema types are written
136
- against whichever `zod` resolves for *it*, and a second copy at a different major produces a type
137
- mismatch on every tool registration. Pinning to the version the SDK resolves keeps one `zod` in the
138
- tree. This matters at build time only; at runtime the SDK handles both.
139
-
140
- ## Licence
141
-
142
- Apache-2.0 — © ebitex software LLC.
143
-
144
- Full guide: [developers.ebitex.io](https://developers.ebitex.io/getting-started/content-as-code/).
1
+ # @ebitex/mcp
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server for the **ebitex suite**. Point an AI agent at it and
4
+ it can work in your apps through your own management keys. Today that is **Content**: it can build a
5
+ content model end to end (Contracts and their fields, Templates, Components, the Experience tree) and
6
+ publish it. Each further app arrives as another set of tools in this same server, so there is one
7
+ package to install and one entry in your MCP client, not one per app.
8
+
9
+ It runs locally, over `stdio`, authenticated by management keys you mint yourself. Nothing is hosted
10
+ by ebitex, so your write-capable keys never leave your machine.
11
+
12
+ > This package was published as `@ebitex/content-mcp` until it became the suite's server. That name
13
+ > still runs this one and is deprecated; change it to `@ebitex/mcp` when convenient. Nothing else
14
+ > changes: the Content tools, resources and environment variables are the same.
15
+
16
+ ## Configure it
17
+
18
+ ```json
19
+ {
20
+ "mcpServers": {
21
+ "ebitex": {
22
+ "command": "npx",
23
+ "args": ["-y", "@ebitex/mcp"],
24
+ "env": { "EBITEX_CONTENT_MANAGEMENT_KEY": "frm_live_..." }
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ **An app's tools appear when its key is set.** Each app has its own key, minted in that app and bound to
31
+ one organization, so a session that should reach two apps carries two keys. A server with no app key
32
+ set refuses to start and names each variable.
33
+
34
+ Shared by every app:
35
+
36
+ | Variable | |
37
+ |---|---|
38
+ | `EBITEX_API_BASE` | Defaults to `https://api.ebitex.io` |
39
+ | `EBITEX_MCP_READ_ONLY` | Set to `1` to hide every write tool in every app, regardless of the keys' scopes |
40
+
41
+ Content:
42
+
43
+ | Variable | |
44
+ |---|---|
45
+ | `EBITEX_CONTENT_MANAGEMENT_KEY` | **Required to use Content.** Mint one in Content under Settings → API Keys → Management keys |
46
+ | `EBITEX_CONTENT_TARGET_MANAGEMENT_KEY` | A second key, for `content_transfer` to import into |
47
+ | `EBITEX_CONTENT_REALM` | The realm key the management key is expected to act in. Startup stops if it does not (a key is bound to one realm; this checks, it does not select). Unset: not checked |
48
+
49
+ The names from when this server only did Content, `EBITEX_CONTENT_API_BASE` and
50
+ `EBITEX_CONTENT_MCP_READ_ONLY`, are still read. If both spellings of the base URL are set the new one
51
+ wins; if either read-only variable is set, the session is read-only.
52
+
53
+ ## Mint the key deliberately
54
+
55
+ A management key is bound to **one organization and one authoring environment**, and acts as **one
56
+ role**. That binding is the real safety boundary here, and it is the one this server cannot supply
57
+ for you:
58
+
59
+ - **Bind it to a non-production authoring environment.** This server has no way to tell which of
60
+ your environments is production — that is your own topology, and a management key deliberately
61
+ cannot see it. A heuristic would be worse than nothing, because it would be believed.
62
+ - **Leave the authoring scope off unless the agent needs to write.** Without it, the write tools are
63
+ not merely refused; they are not offered at all.
64
+ - **Give it a role with the access it needs and no more.** Branch access rules and workflow gating
65
+ apply to a key exactly as they do to a person.
66
+
67
+ On startup the server prints, to stderr, which organization and environment the key reached and
68
+ which role it acts as. Read it once; if it is not what you expected, stop.
69
+
70
+ ## Content tools
71
+
72
+ Ten, shaped around what an agent does rather than around REST routes.
73
+
74
+ | | |
75
+ |---|---|
76
+ | `content_whoami` | Where this key is scoped: organization, environment, role, scopes, this server's version, and which tools were withheld and why. Needs no scope, so a key that can do almost nothing can still ask why |
77
+ | `content_describe` | What can exist here: every field type with its **own settings schema**, plus this environment's Contracts and Templates |
78
+ | `content_find` | Locate entities by kind, search or external id, with one paging contract across both listings |
79
+ | `content_get` | Read one entity in full |
80
+ | `content_write` | Create or update one entity |
81
+ | `content_delete` | Delete one, behind an explicit confirmation |
82
+ | `content_publish` | Plan, read the blockers, then publish |
83
+ | `content_operation_status` | Poll a job |
84
+ | `content_transfer` | Move a whole model between environments, atomically. `identityMode` picks how items are matched: `externalId` (the default, by natural key), `preserve` (by id), or `fresh` (everything new) |
85
+ | `content_topology` | Where this environment sits: the delivery environments a publish lands in, and its promotion neighbours. One hop only |
86
+
87
+ Which of them appear depends on your key's scopes: a read-scoped key gets a server with no write
88
+ tools at all, rather than tools that always fail. `content_whoami` is the exception and always
89
+ appears — it reports which tools were withheld and what each would need, so an absent tool is
90
+ explained rather than merely missing.
91
+
92
+ Every result also names the organization and environment it was answered in, and an empty one says so
93
+ explicitly. A key reads and writes exactly one authoring environment, so "no Contracts" always means
94
+ "none here" — an agent that reads it as "none anywhere" creates duplicates.
95
+
96
+ ## Content: authoring is half the job
97
+
98
+ This server builds and publishes a content model. The site that **renders** it reads the Content
99
+ Delivery API, and that has its own client, [`@ebitex/content-sdk`](https://www.npmjs.com/package/@ebitex/content-sdk)
100
+ (or `Ebitex.Content.Delivery` for .NET). The server's instructions and the
101
+ `ebitex-content://help/rendering-your-site` resource tell an agent so before it writes a renderer; if
102
+ you are briefing an agent yourself, say the same.
103
+
104
+ ## Content: why it cannot drift
105
+
106
+ The Content app encodes **no knowledge of the content model**. It does not know what field types exist,
107
+ what a Contract may contain, or what makes a document valid. All three are answered at runtime:
108
+ `content_describe` returns each field type's own declared schema, and every write is validated by the
109
+ server that stores it. There is nothing here to fall out of step, because nothing is duplicated.
110
+
111
+ That also shapes how errors work. A refusal is relayed **whole**, with its field paths intact and no
112
+ summarizing, because for an agent the error is the control loop: try, read the error, fix the one
113
+ field it names, call again.
114
+
115
+ ## Content resources
116
+
117
+ Alongside the tools, the server offers the Content documentation as MCP resources — start with
118
+ `ebitex-content://help/agent-authoring`, which explains what Contracts, Templates, Presentations,
119
+ Adapters and the Experience tree are for, and the order to create them in. Then read
120
+ `ebitex-content://help/content-modelling` before you decide what the model looks like: it says what belongs in a Contract and what in a Template,
121
+ which field to use, how to name things, how to build containers such as tabs and accordions, and how to ship a model to others.
122
+
123
+ ## Embedding it
124
+
125
+ ```ts
126
+ import { buildServer, readConfig } from '@ebitex/mcp'
127
+
128
+ const { server, banner } = await buildServer({ config: readConfig() })
129
+ console.error(banner) // never stdout — on stdio, that stream is the protocol
130
+ ```
131
+
132
+ ## A note on `zod`
133
+
134
+ This package pins `zod` to `^3.25.76` rather than `^4`, even though `@modelcontextprotocol/sdk`
135
+ accepts either. The reason is type identity, not capability: the SDK's schema types are written
136
+ against whichever `zod` resolves for *it*, and a second copy at a different major produces a type
137
+ mismatch on every tool registration. Pinning to the version the SDK resolves keeps one `zod` in the
138
+ tree. This matters at build time only; at runtime the SDK handles both.
139
+
140
+ ## Licence
141
+
142
+ Apache-2.0 — © ebitex software LLC.
143
+
144
+ Full guide: [developers.ebitex.io](https://developers.ebitex.io/getting-started/content-as-code/).