@littlebigbrain/mcp 0.2.1 → 0.2.3
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 +44 -323
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,369 +1,90 @@
|
|
|
1
1
|
# @littlebigbrain/mcp
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
graph
|
|
5
|
-
[`@littlebigbrain/client`](https://www.npmjs.com/package/@littlebigbrain/client) TypeScript SDK and ships two ways: a local
|
|
6
|
-
stdio shim (`npx @littlebigbrain/mcp`) and a hosted streamable-HTTP endpoint.
|
|
3
|
+
Eleven task-shaped MCP tools for searching, querying, and writing a little big
|
|
4
|
+
brain graph from Claude, Cursor, Codex, or another MCP client.
|
|
7
5
|
|
|
8
|
-
##
|
|
6
|
+
## Hosted OAuth
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
Use the hosted endpoint; the client opens WorkOS sign-in and your machine never
|
|
9
|
+
stores a little big brain stack key:
|
|
11
10
|
|
|
12
11
|
```json
|
|
13
12
|
{
|
|
14
13
|
"mcpServers": {
|
|
15
14
|
"lbb": {
|
|
16
|
-
"
|
|
17
|
-
"args": ["-y", "@littlebigbrain/mcp"],
|
|
18
|
-
"env": {
|
|
19
|
-
"LBB_BASE_URL": "https://db.eu.littlebigbrain.com",
|
|
20
|
-
"LBB_API_KEY": "lbb_sk_live_…"
|
|
21
|
-
}
|
|
15
|
+
"url": "https://mcp.littlebigbrain.com/mcp/<stack-slug>"
|
|
22
16
|
}
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
```
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
For a local server, point `LBB_BASE_URL` at `http://127.0.0.1:7400` and use the
|
|
29
|
-
single-mode token.
|
|
30
|
-
|
|
31
|
-
## Hosted (streamable-HTTP, WorkOS OAuth)
|
|
32
|
-
|
|
33
|
-
The hosted endpoint at `https://mcp.littlebigbrain.com` is served by little big
|
|
34
|
-
brain's hosted SaaS API and authenticated with **native WorkOS MCP OAuth** — there is
|
|
35
|
-
no static bearer key. It is an OAuth 2.1 protected resource: WorkOS AuthKit is
|
|
36
|
-
the authorization server. Claude-style clients can use the per-stack URL:
|
|
21
|
+
Codex Desktop should use the origin plus a stack header:
|
|
37
22
|
|
|
38
23
|
```json
|
|
39
24
|
{
|
|
40
25
|
"mcpServers": {
|
|
41
26
|
"lbb": {
|
|
42
|
-
"
|
|
27
|
+
"type": "http",
|
|
28
|
+
"url": "https://mcp.littlebigbrain.com",
|
|
29
|
+
"headers": { "X-LBB-Stack": "<stack-slug>" }
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
32
|
}
|
|
46
33
|
```
|
|
47
34
|
|
|
48
|
-
|
|
49
|
-
flow automatically: the server answers an unauthenticated request with `401` and
|
|
50
|
-
a `WWW-Authenticate` challenge pointing at
|
|
51
|
-
`/.well-known/oauth-protected-resource/mcp/<slug>`, the client runs the AuthKit
|
|
52
|
-
sign-in (DCR/PKCE), and presents the resulting access token. The endpoint
|
|
53
|
-
validates the WorkOS JWT, confirms your account owns the stack, mints a
|
|
54
|
-
short-lived data-plane session, and runs the tools scoped to that stack — your
|
|
55
|
-
machine never holds a little big brain key. Add `?graph=`/`?branch=` to the URL to target a
|
|
56
|
-
graph/branch other than `main`.
|
|
57
|
-
|
|
58
|
-
Codex Desktop currently sends the MCP server URL as an OAuth `resource`
|
|
59
|
-
parameter and also appends any configured `oauth_resource`, which produces a
|
|
60
|
-
duplicate `resource` query that AuthKit rejects. For Codex, use the MCP origin
|
|
61
|
-
as the URL and pass the stack in a header; do not set `oauth_resource`:
|
|
35
|
+
## Local stdio
|
|
62
36
|
|
|
63
37
|
```json
|
|
64
38
|
{
|
|
65
39
|
"mcpServers": {
|
|
66
40
|
"lbb": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": ["-y", "@littlebigbrain/mcp"],
|
|
43
|
+
"env": {
|
|
44
|
+
"LBB_BASE_URL": "https://db.eu.littlebigbrain.com",
|
|
45
|
+
"LBB_API_KEY": "lbb_sk_live_..."
|
|
71
46
|
}
|
|
72
47
|
}
|
|
73
48
|
}
|
|
74
49
|
}
|
|
75
50
|
```
|
|
76
51
|
|
|
77
|
-
|
|
78
|
-
same tools over streamable-HTTP (default `127.0.0.1:8080/mcp`) with a simpler
|
|
79
|
-
**key** bearer passed straight through — use this only behind your own auth,
|
|
80
|
-
not as a multi-tenant public endpoint. It binds loopback by default and
|
|
81
|
-
rejects non-loopback `Host`/`Origin` headers (DNS-rebinding protection); set
|
|
82
|
-
`LBB_MCP_HOST` to bind another interface deliberately, and
|
|
83
|
-
`LBB_MCP_ALLOWED_HOSTS` / `LBB_MCP_ALLOWED_ORIGINS` (comma-separated) when it
|
|
84
|
-
sits behind a hostname you control.
|
|
52
|
+
Set `LBB_GRAPH` or `LBB_BRANCH` when the scope is not `main`.
|
|
85
53
|
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
The package entrypoint exposes a small, supported library API in addition to
|
|
89
|
-
the `lbb-mcp` executable:
|
|
54
|
+
## Tools
|
|
90
55
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
56
|
+
| Tool | Use it for |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `lbb_search` | hybrid retrieval, multi-query fusion, optional path following |
|
|
59
|
+
| `lbb_ask` | grounded answers with citations |
|
|
60
|
+
| `lbb_decode` | constrained relation decoding |
|
|
61
|
+
| `lbb_ground` | vocabulary completion and resolution |
|
|
62
|
+
| `lbb_inspect` | ontology, entity, state, history, provenance, traversal |
|
|
63
|
+
| `lbb_query` | SPARQL, structured analytics, SHACL, inference |
|
|
64
|
+
| `lbb_commit` | facts, properties, and embeddings |
|
|
65
|
+
| `lbb_observe` | conversation episodes plus reviewed extraction |
|
|
66
|
+
| `lbb_branch` | isolation branches and validated merge |
|
|
67
|
+
| `lbb_configure` | ontology, schema, and inference rules |
|
|
68
|
+
| `lbb_index` | BM25, vector, and adjacency refresh |
|
|
69
|
+
|
|
70
|
+
Read tools return compact structured envelopes by default. Use `detail`,
|
|
71
|
+
`row_limit`, and returned cursors to page without silently truncating results.
|
|
72
|
+
Write tools derive idempotency keys unless you provide one.
|
|
73
|
+
|
|
74
|
+
## Embed the server
|
|
97
75
|
|
|
98
76
|
```ts
|
|
99
|
-
import {
|
|
100
|
-
createMcpHttpServer,
|
|
101
|
-
type McpHttpServerOptions,
|
|
102
|
-
} from "@littlebigbrain/mcp";
|
|
77
|
+
import { createMcpHttpServer } from "@littlebigbrain/mcp";
|
|
103
78
|
|
|
104
|
-
|
|
79
|
+
createMcpHttpServer({
|
|
105
80
|
baseUrl: "https://db.eu.littlebigbrain.com",
|
|
106
81
|
mcpPath: "/mcp",
|
|
107
|
-
maxBodyBytes: 1_048_576,
|
|
108
|
-
requestTimeoutMs: 30_000,
|
|
109
|
-
// DNS-rebinding protection: reject other Host/Origin headers on the MCP
|
|
110
|
-
// route. Omit only when an edge you control already pins Host.
|
|
111
82
|
allowedHosts: ["127.0.0.1", "localhost", "::1", "[::1]"],
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
createMcpHttpServer(options).listen(8080, "127.0.0.1");
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Clients call `POST /mcp` with `Content-Type: application/json` and
|
|
119
|
-
`Authorization: Bearer <LBB_API_KEY>`; add `?graph=` / `?branch=` to override
|
|
120
|
-
the default scope. `clientFactory` is also available in
|
|
121
|
-
`McpHttpServerOptions` for dependency injection. The hosted multi-tenant OAuth
|
|
122
|
-
edge is intentionally not part of this library API.
|
|
123
|
-
|
|
124
|
-
### Create an ontology (so agents can use a typed graph)
|
|
125
|
-
|
|
126
|
-
`lbb_configure` with `action: "define_ontology"` creates a **new** graph with a custom ontology, since the
|
|
127
|
-
ontology is fixed at graph creation. Give it entity-type and relation names (the
|
|
128
|
-
agent-friendly "spec" shape) and little big brain fills in ids and sensible defaults:
|
|
129
|
-
|
|
130
|
-
```jsonc
|
|
131
|
-
// lbb_configure
|
|
132
|
-
{
|
|
133
|
-
"action": "define_ontology",
|
|
134
|
-
"graph": "support",
|
|
135
|
-
"entity_types": [{ "name": "Customer" }, { "name": "Ticket" }],
|
|
136
|
-
"relations": [
|
|
137
|
-
{ "name": "OPENED", "source": ["Customer"], "target": ["Ticket"], "reducer": "append_only" }
|
|
138
|
-
]
|
|
139
|
-
}
|
|
83
|
+
}).listen(8080, "127.0.0.1");
|
|
140
84
|
```
|
|
141
85
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
or `lbb_json`; omit or `auto` to auto-detect) instead of the structured
|
|
146
|
-
fields.
|
|
147
|
-
|
|
148
|
-
## Tools
|
|
149
|
-
|
|
150
|
-
Agent-shaped task tools, not one tool per route. The previous route-shaped
|
|
151
|
-
surface is replaced by these eleven task tools, with no legacy aliases.
|
|
152
|
-
|
|
153
|
-
| Tool | Purpose |
|
|
154
|
-
| --- | --- |
|
|
155
|
-
| `lbb_search` | natural-language retrieval, multi-query fusion, and optional text-seeded path following |
|
|
156
|
-
| `lbb_ask` | grounded natural-language answers with citations |
|
|
157
|
-
| `lbb_decode` | name a relation from the graph's admissible vocabulary |
|
|
158
|
-
| `lbb_ground` | complete, resolve, or audit terms against real graph vocabulary |
|
|
159
|
-
| `lbb_inspect` | graph context and exact reads: guide, ontology, RDF/SHACL schema, stored rules, metadata, entity, state, history, why, traverse |
|
|
160
|
-
| `lbb_query` | analytical/expert reads: structured query, SPARQL text, SHACL, inference, retrieval premises, canned analysis |
|
|
161
|
-
| `lbb_commit` | write triplets, embeddings, or entity properties; omitted idempotency keys are content-derived for agent retries |
|
|
162
|
-
| `lbb_observe` | store a conversation episode and gate extracted facts on an isolation branch |
|
|
163
|
-
| `lbb_branch` | create and validate-then-merge graph branches |
|
|
164
|
-
| `lbb_configure` | define a new graph ontology, publish a previewed RDF/SHACL schema, or replace stored inference rules |
|
|
165
|
-
| `lbb_index` | refresh persisted BM25, vector, and adjacency indexes |
|
|
166
|
-
|
|
167
|
-
Read tools accept `detail: "compact" | "standard" | "full"` and default to
|
|
168
|
-
compact structured envelopes: `{summary, data, counts?, truncated?, rows_shown?, next?}`.
|
|
169
|
-
`detail` controls verbosity only. Query row volume is controlled by
|
|
170
|
-
`row_limit` plus cursor paging: tabular `lbb_query` responses include
|
|
171
|
-
`row_page: {returned, total, offset, limit, has_more, next_offset?}`. Whenever a
|
|
172
|
-
query page is partial, `summary` says `returned X of Y rows` and `next` contains
|
|
173
|
-
`{mode, cursor, row_limit, detail}`; pass that cursor back to continue without
|
|
174
|
-
hand-writing `LIMIT/OFFSET`. Cursor continuation reuses the original query/body
|
|
175
|
-
and pins every page to the head commit observed on page 1, so live writes between
|
|
176
|
-
pages cannot shift offset slicing. When the server returns a *complete* page
|
|
177
|
-
(`has_more: false`) whose rows are nonetheless too large to fit one MCP tool
|
|
178
|
-
result, the envelope caps the displayed rows and reports `rows_shown` (fewer than
|
|
179
|
-
`row_page.returned`) so the cap is never silent; `summary` reads
|
|
180
|
-
`MCP showed N of M rows` and `next` still carries a cursor that re-pages the same
|
|
181
|
-
result set at a smaller `row_limit`. A large result that *does* fit carries no
|
|
182
|
-
hard-cap warning and no `rows_shown`.
|
|
183
|
-
`lbb_inspect action=entity` samples its `incoming`/`outgoing`/`history` arrays to
|
|
184
|
-
the detail cap while `counts` holds the true totals; on a high-degree node the
|
|
185
|
-
response carries an `edge_sample` block (`{note, capped_totals, full_reads}`) with
|
|
186
|
-
runnable paged `edges`/`history` reads, so reading every edge of a supernode is
|
|
187
|
-
discoverable in-band rather than a workaround you have to already know.
|
|
188
|
-
Mode/action tools use discriminated schemas, so each selected mode or action
|
|
189
|
-
only accepts the fields that apply to that branch.
|
|
190
|
-
All server `LbbError` fields survive the MCP boundary in
|
|
191
|
-
`structuredContent.error` so agents can self-correct. A graph-scope 404 (the
|
|
192
|
-
raw `not found: tenants/…/graphs/<g>/branches/<b>/heads/current.json` object
|
|
193
|
-
key) is rewritten into an actionable message that lists the tenant's real
|
|
194
|
-
graphs — or, when the graph exists but the branch does not, its real branches —
|
|
195
|
-
and tells you which `graph=`/`branch=` to pass. The connection targets a default
|
|
196
|
-
graph/branch (often `main`) when you omit them.
|
|
197
|
-
When `lbb_commit` omits `idempotency_key`, MCP derives one from the graph,
|
|
198
|
-
branch, and payload; intentionally repeating an identical commit within the
|
|
199
|
-
server retention window requires an explicit different `idempotency_key`.
|
|
200
|
-
MCP defaults `edge_idempotency` to `append`, so new evidence on an existing edge
|
|
201
|
-
is recorded. Pass `edge_idempotency: "skip_unchanged"` for re-runnable
|
|
202
|
-
backfills; exact duplicate current edges are skipped server-side, including
|
|
203
|
-
evidence-only repeats.
|
|
204
|
-
|
|
205
|
-
### Migration table
|
|
206
|
-
|
|
207
|
-
| Old tool | New tool/action or mode |
|
|
208
|
-
| --- | --- |
|
|
209
|
-
| `lbb_multi_search` | `lbb_search` with `queries` |
|
|
210
|
-
| `lbb_semantic_traverse` | `lbb_search` with `follow_paths: true` |
|
|
211
|
-
| `lbb_traverse` | `lbb_inspect` with `action: "traverse"` |
|
|
212
|
-
| `lbb_current_state` | `lbb_inspect` with `action: "state"` |
|
|
213
|
-
| `lbb_history` | `lbb_inspect` with `action: "history"` |
|
|
214
|
-
| `lbb_why` | `lbb_inspect` with `action: "why"` |
|
|
215
|
-
| `lbb_ontology_search` | `lbb_inspect` with `action: "ontology_search"` |
|
|
216
|
-
| `lbb_ontology_view` | `lbb_inspect` with `action: "ontology"` |
|
|
217
|
-
| `lbb_graph_metadata` | `lbb_inspect` with `action: "metadata"` |
|
|
218
|
-
| entity detail | `lbb_inspect` with `action: "entity"` |
|
|
219
|
-
| `lbb_query_guide` | `lbb_inspect` with `action: "guide"` |
|
|
220
|
-
| schema view / audit / preview | `lbb_inspect` with `action: "schema"`, `"schema_audit"`, or `"schema_preview"` |
|
|
221
|
-
| stored rules view | `lbb_inspect` with `action: "rules"` |
|
|
222
|
-
| `lbb_sparql` | `lbb_query` with `mode: "sparql"` |
|
|
223
|
-
| `lbb_shacl` | `lbb_query` with `mode: "shacl"` |
|
|
224
|
-
| `lbb_infer` | `lbb_query` with `mode: "infer"` |
|
|
225
|
-
| `lbb_retrieval_premises` | `lbb_query` with `mode: "retrieval_premises"` |
|
|
226
|
-
| `lbb_analyze` | `lbb_query` with `mode: "analyze"` |
|
|
227
|
-
| `lbb_define_rules` | `lbb_configure` with `action: "define_rules"` |
|
|
228
|
-
| `lbb_ontology_define` | `lbb_configure` with `action: "define_ontology"` |
|
|
229
|
-
| schema publish | `lbb_configure` with `action: "publish_schema"` |
|
|
230
|
-
| `lbb_index_build` | `lbb_index` |
|
|
231
|
-
| `lbb_json` | no MCP replacement; use `@littlebigbrain/client` or direct HTTP for raw/operator endpoints intentionally outside the agent tool belt |
|
|
232
|
-
|
|
233
|
-
### Querying: SPARQL-subset, SHACL, inference
|
|
234
|
-
|
|
235
|
-
Three complementary surfaces sit over the object-storage permutation view:
|
|
236
|
-
|
|
237
|
-
- **`lbb_query` mode `structured`** is a SPARQL-subset SELECT/ASK over a conjunctive basic graph
|
|
238
|
-
pattern (`patterns`) with `filters` (typed-literal FILTER), `group_by` +
|
|
239
|
-
`aggregates` (COUNT/SUM/AVG/MIN/MAX), `having`, `order_by`,
|
|
240
|
-
and `as_of_valid_time`. A `filters`/`having` entry has the exact shape
|
|
241
|
-
`{ compare: { op: eq|ne|lt|le|gt|ge, left, right } }` (or `and`/`or`/`not`),
|
|
242
|
-
where each operand is `{ var }`, `{ property: { var, field } }`, or a typed
|
|
243
|
-
`{ value: { str | i64 | f64 | bool | date_time | entity } }` — e.g.
|
|
244
|
-
`filters: [{ compare: { op: "ge", left: { property: { var: "d", field: "amount" } }, right: { value: { f64: 1000000 } } } }]`.
|
|
245
|
-
A pattern `predicate` is a relation name and is case-insensitive here. GROUP BY
|
|
246
|
-
is not limited to entity identity — `group_keys` can key on a typed scalar
|
|
247
|
-
attribute (`{ property: { var, field, as } }`) or a calendar bucket of a
|
|
248
|
-
datetime attribute (`{ date_bucket: { var, field, granularity, as } }`), and
|
|
249
|
-
those same attribute fields work in `filters` and as SUM/AVG/MIN/MAX operands.
|
|
250
|
-
So "commits per area per month" is one server-side query, not N entity fetches
|
|
251
|
-
bucketed by hand:
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
{
|
|
255
|
-
"patterns": [{ "subject": { "var": "c" }, "predicate": "committed_to", "object": { "var": "repo" } }],
|
|
256
|
-
"group_keys": [
|
|
257
|
-
{ "date_bucket": { "var": "c", "field": "committed_at", "granularity": "month", "as": "m" } },
|
|
258
|
-
{ "property": { "var": "c", "field": "area", "as": "area" } }
|
|
259
|
-
],
|
|
260
|
-
"aggregates": [{ "func": "count", "as": "n" }],
|
|
261
|
-
"order_by": [{ "var": "m" }]
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
`area`/`committed_at` are typed entity attributes (set via `entity_properties`,
|
|
266
|
-
read back flat under `attributes` — there is no nested `metadata.attributes`
|
|
267
|
-
blob); discover the queryable field names with `lbb_inspect action=ontology`
|
|
268
|
-
(`property_defs`) or `action=schema`. Pass `combinators` (`union`/`optional`/`minus`/
|
|
269
|
-
`exists`/`not_exists`) for group-graph-pattern legs — those return `solutions`
|
|
270
|
-
and are a separate request shape from aggregation. In MCP, use `row_limit` and
|
|
271
|
-
the returned `next.cursor` for row pages; the tool applies request-level
|
|
272
|
-
`limit`/`offset` for you and a cursor continuation reuses the original body.
|
|
273
|
-
Cheap aggregate count: pair an equality `having` (`{ compare: { op: "eq",
|
|
274
|
-
left: { var: "n" }, right: { value: { i64: 4 } } } }`) with `row_limit: 1` and
|
|
275
|
-
read the number of matching groups off `row_page.total` — no need to page every
|
|
276
|
-
matching row.
|
|
277
|
-
- **`lbb_query` mode `shacl`** evaluates node shapes: `shacl_mode: select` returns focus nodes
|
|
278
|
-
that match, `shacl_mode: validate` returns a conformance `report`. It is the home of
|
|
279
|
-
**property paths** (`path_expr`: `inverse`, `sequence`, `alternative`,
|
|
280
|
-
`one_or_more`/`zero_or_more`/`zero_or_one`), literal constraints (`datatype`,
|
|
281
|
-
`minInclusive`…, `pattern`, length), `unique` cross-node keys, `closed`
|
|
282
|
-
nodes, and logical `and`/`or`/`not`/`xone`.
|
|
283
|
-
- **`lbb_query` mode `infer`** runs SHACL-AF inference rules to a bounded fixpoint and
|
|
284
|
-
previews the derived edges (never written). **`lbb_configure` action
|
|
285
|
-
`define_rules`** stores a rule set so SHACL `include_derived` can
|
|
286
|
-
validate/select over inferred facts.
|
|
287
|
-
|
|
288
|
-
SPARQL text (`mode: "sparql"`) addresses relations/types/properties as
|
|
289
|
-
`<https://littlebigbrain.com/{r,class,p}/name>`, and the local name is **always
|
|
290
|
-
lowercase** — an uppercase one (e.g. `<…/r/FOR_CLIENT>`) is a different,
|
|
291
|
-
non-existent IRI that silently matches nothing. The tool auto-lowercases those
|
|
292
|
-
little big brain IRI local names for you (percent-escapes preserved; foreign IRIs and string
|
|
293
|
-
literals untouched) and reports each rewrite under `notes`, so a stray uppercase
|
|
294
|
-
resolves instead of returning an empty result with no error.
|
|
295
|
-
|
|
296
|
-
### RDF schema and stored rules workflow
|
|
297
|
-
|
|
298
|
-
Agents should treat RDF/SHACL schema changes as preview-then-publish:
|
|
299
|
-
|
|
300
|
-
1. Read current state with `lbb_inspect` `action: "schema"` and stored rules with
|
|
301
|
-
`action: "rules"`.
|
|
302
|
-
2. Preview proposed SHACL/RDF shapes with `lbb_inspect`
|
|
303
|
-
`action: "schema_preview"`. Shape sources accept `auto`, `turtle`,
|
|
304
|
-
`n_triples`, `n_quads`, or `trig`. Ontology sources accept `auto`, `spec`,
|
|
305
|
-
`lbb_json`, `json_ld`, `rdf_xml`, `csv`, `tsv`, or `turtle`.
|
|
306
|
-
|
|
307
|
-
```jsonc
|
|
308
|
-
// lbb_inspect
|
|
309
|
-
{
|
|
310
|
-
"action": "schema_preview",
|
|
311
|
-
"desired_mode": "reject",
|
|
312
|
-
"shapes": {
|
|
313
|
-
"format": "turtle",
|
|
314
|
-
"source": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n..."
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
The preview result includes the `preview_digest`, compatibility verdict, allowed
|
|
320
|
-
publish modes, audit summary, messages, and a `suggested_publish_schema` tool
|
|
321
|
-
call when the bundle can be activated in some mode. Publish only with the exact
|
|
322
|
-
source used for preview:
|
|
323
|
-
|
|
324
|
-
```jsonc
|
|
325
|
-
// lbb_configure
|
|
326
|
-
{
|
|
327
|
-
"action": "publish_schema",
|
|
328
|
-
"preview_digest": "sha256:...",
|
|
329
|
-
"desired_mode": "warn",
|
|
330
|
-
"confirm_restrictive": true,
|
|
331
|
-
"shapes": {
|
|
332
|
-
"format": "turtle",
|
|
333
|
-
"source": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n..."
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
After publishing, run `lbb_inspect` `action: "schema_audit"` and read back
|
|
339
|
-
`action: "schema"`. For stored inference rules, preview behavior with
|
|
340
|
-
`lbb_query` `mode: "infer"` first, then replace the branch rule set with
|
|
341
|
-
`lbb_configure` `action: "define_rules"`. `define_rules` requires a `rules`
|
|
342
|
-
array; replacing the stored set with an empty array requires
|
|
343
|
-
`confirm_empty: true`.
|
|
344
|
-
|
|
345
|
-
SPARQL text `SELECT`/`ASK` is exposed through `lbb_query` `mode: "sparql"` and
|
|
346
|
-
returns SPARQL Results JSON inside the MCP row-page envelope. SPARQL Update,
|
|
347
|
-
SPARQL Protocol details, and SHACL-SPARQL/AF conformance remain a separate
|
|
348
|
-
compliance track; the structured SHACL/inference tools above are the
|
|
349
|
-
object-storage-native shape/inference surface.
|
|
350
|
-
|
|
351
|
-
Operator-only actions (index GC, compaction, storage inspection) are
|
|
352
|
-
intentionally left to the [`lbb` CLI](https://docs.littlebigbrain.com/sdks/cli/), not the agent
|
|
353
|
-
tool belt.
|
|
354
|
-
|
|
355
|
-
## Develop
|
|
356
|
-
|
|
357
|
-
```sh
|
|
358
|
-
npm install
|
|
359
|
-
npm run build
|
|
360
|
-
npm test # in-memory MCP + bounded localhost HTTP tests
|
|
361
|
-
npm run test:coverage
|
|
362
|
-
npm run pack:check # exact tarball: publint + ATTW
|
|
363
|
-
npm start # stdio server from the environment
|
|
364
|
-
```
|
|
86
|
+
The embedded HTTP server passes a key bearer to the database and is for
|
|
87
|
+
self-hosting behind your own auth. The hosted endpoint's OAuth/ownership layer
|
|
88
|
+
is served by the little big brain API.
|
|
365
89
|
|
|
366
|
-
|
|
367
|
-
request timeout, requires JSON plus a bearer token, and redacts unexpected
|
|
368
|
-
internal errors. Override its path with `LBB_MCP_PATH`; the hosted multi-tenant
|
|
369
|
-
endpoint remains the WorkOS OAuth service described above.
|
|
90
|
+
Full tool schemas and examples: [MCP documentation](https://docs.littlebigbrain.com/sdks/mcp/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@littlebigbrain/mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "MCP server for little big brain — graph and hybrid search tools for agents",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"test:coverage": "npm run clean:test && tsc -p tsconfig.test.json && node --test --experimental-test-coverage --test-coverage-include=test-dist/*.js --test-coverage-exclude=test-dist/*.test.js --test-coverage-exclude=test-dist/stdio.js --test-coverage-exclude=test-dist/test-support.js --test-coverage-lines=90 --test-coverage-branches=70 --test-coverage-functions=85 \"test-dist/**/*.test.js\""
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@littlebigbrain/client": "
|
|
55
|
+
"@littlebigbrain/client": "^0.4.0",
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1",
|
|
57
57
|
"zod": "^3"
|
|
58
58
|
},
|