@littlebigbrain/mcp 0.2.0 → 0.2.2
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 +6 -6
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/stdio.js +1 -1
- package/dist/tool-runtime.js +6 -6
- package/dist/tools.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @littlebigbrain/mcp
|
|
2
2
|
|
|
3
3
|
An [MCP](https://modelcontextprotocol.io) server that gives an agent a small,
|
|
4
|
-
graph-aware tool belt over a [
|
|
4
|
+
graph-aware tool belt over a [little big brain](https://littlebigbrain.com) server. It wraps the
|
|
5
5
|
[`@littlebigbrain/client`](https://www.npmjs.com/package/@littlebigbrain/client) TypeScript SDK and ships two ways: a local
|
|
6
6
|
stdio shim (`npx @littlebigbrain/mcp`) and a hosted streamable-HTTP endpoint.
|
|
7
7
|
|
|
@@ -30,8 +30,8 @@ single-mode token.
|
|
|
30
30
|
|
|
31
31
|
## Hosted (streamable-HTTP, WorkOS OAuth)
|
|
32
32
|
|
|
33
|
-
The hosted endpoint at `https://mcp.littlebigbrain.com` is served by
|
|
34
|
-
|
|
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
35
|
no static bearer key. It is an OAuth 2.1 protected resource: WorkOS AuthKit is
|
|
36
36
|
the authorization server. Claude-style clients can use the per-stack URL:
|
|
37
37
|
|
|
@@ -52,7 +52,7 @@ a `WWW-Authenticate` challenge pointing at
|
|
|
52
52
|
sign-in (DCR/PKCE), and presents the resulting access token. The endpoint
|
|
53
53
|
validates the WorkOS JWT, confirms your account owns the stack, mints a
|
|
54
54
|
short-lived data-plane session, and runs the tools scoped to that stack — your
|
|
55
|
-
machine never holds a
|
|
55
|
+
machine never holds a little big brain key. Add `?graph=`/`?branch=` to the URL to target a
|
|
56
56
|
graph/branch other than `main`.
|
|
57
57
|
|
|
58
58
|
Codex Desktop currently sends the MCP server URL as an OAuth `resource`
|
|
@@ -125,7 +125,7 @@ edge is intentionally not part of this library API.
|
|
|
125
125
|
|
|
126
126
|
`lbb_configure` with `action: "define_ontology"` creates a **new** graph with a custom ontology, since the
|
|
127
127
|
ontology is fixed at graph creation. Give it entity-type and relation names (the
|
|
128
|
-
agent-friendly "spec" shape) and
|
|
128
|
+
agent-friendly "spec" shape) and little big brain fills in ids and sensible defaults:
|
|
129
129
|
|
|
130
130
|
```jsonc
|
|
131
131
|
// lbb_configure
|
|
@@ -289,7 +289,7 @@ SPARQL text (`mode: "sparql"`) addresses relations/types/properties as
|
|
|
289
289
|
`<https://littlebigbrain.com/{r,class,p}/name>`, and the local name is **always
|
|
290
290
|
lowercase** — an uppercase one (e.g. `<…/r/FOR_CLIENT>`) is a different,
|
|
291
291
|
non-existent IRI that silently matches nothing. The tool auto-lowercases those
|
|
292
|
-
|
|
292
|
+
little big brain IRI local names for you (percent-escapes preserved; foreign IRIs and string
|
|
293
293
|
literals untouched) and reports each rewrite under `notes`, so a stray uppercase
|
|
294
294
|
resolves instead of returning an empty result with no error.
|
|
295
295
|
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import type { LbbClient } from "@littlebigbrain/client";
|
|
3
|
-
/** Build an MCP server exposing the
|
|
3
|
+
/** Build an MCP server exposing the little big brain tool belt, bound to one client. */
|
|
4
4
|
export declare function buildLbbServer(client: LbbClient): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { registerLbbTools } from "./tools.js";
|
|
3
|
-
/** Build an MCP server exposing the
|
|
3
|
+
/** Build an MCP server exposing the little big brain tool belt, bound to one client. */
|
|
4
4
|
export function buildLbbServer(client) {
|
|
5
5
|
const server = new McpServer({ name: "lbb", version: "0.1.0" });
|
|
6
6
|
registerLbbTools(server, client);
|
package/dist/stdio.js
CHANGED
|
@@ -4,7 +4,7 @@ import { LbbClient } from "@littlebigbrain/client";
|
|
|
4
4
|
import { buildLbbServer } from "./server.js";
|
|
5
5
|
/**
|
|
6
6
|
* Local stdio entrypoint (`npx @littlebigbrain/mcp`). Reads the connection from the
|
|
7
|
-
* environment and serves the
|
|
7
|
+
* environment and serves the little big brain tools over stdio, the transport every
|
|
8
8
|
* editor (Claude Code, Cursor, Codex) supports.
|
|
9
9
|
*
|
|
10
10
|
* LBB_BASE_URL (default http://127.0.0.1:7400)
|
package/dist/tool-runtime.js
CHANGED
|
@@ -136,16 +136,16 @@ export function stable(value) {
|
|
|
136
136
|
export function stableJson(value) {
|
|
137
137
|
return JSON.stringify(stable(value));
|
|
138
138
|
}
|
|
139
|
-
//
|
|
139
|
+
// little big brain's RDF projection mints relation/class/property predicate IRIs from the
|
|
140
140
|
// *normalized* (lowercased) name, so the canonical local part is always
|
|
141
141
|
// lowercase. A SPARQL term like <https://littlebigbrain.com/r/FOR_CLIENT> is therefore a
|
|
142
142
|
// different — and non-existent — IRI than the real <…/r/for_client>, and it
|
|
143
143
|
// matches nothing while returning **no error** (the silent-0 trap: structured
|
|
144
144
|
// mode is case-insensitive, SPARQL text is not). These helpers canonicalize the
|
|
145
|
-
// local-name case for the three
|
|
145
|
+
// local-name case for the three little big brain namespaces so an MCP SPARQL query just works.
|
|
146
146
|
export const LBB_IRI_RE = /<https:\/\/littlebigbrain\.com\/(r|class|p)\/([^>]*)>/g;
|
|
147
147
|
/**
|
|
148
|
-
* Lowercase the ASCII letters of a
|
|
148
|
+
* Lowercase the ASCII letters of a little big brain IRI local part while leaving `%XX`
|
|
149
149
|
* percent-escapes byte-for-byte (the projection's `encode_segment` emits *upper*
|
|
150
150
|
* hex, e.g. `a%2Fb`, so lowercasing the escape would break the match). Real
|
|
151
151
|
* relation names are identifiers like `FOR_CLIENT` with no escapes, so this is a
|
|
@@ -166,9 +166,9 @@ export function lowercaseLocalName(local) {
|
|
|
166
166
|
return out;
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* Canonicalize the case of
|
|
169
|
+
* Canonicalize the case of little big brain relation/class/property IRI local names in a
|
|
170
170
|
* SPARQL text query, and report each distinct rewrite so the change is never
|
|
171
|
-
* hidden. Only touches angle-bracket IRIs under the three
|
|
171
|
+
* hidden. Only touches angle-bracket IRIs under the three little big brain namespaces, so
|
|
172
172
|
* string literals and foreign IRIs (rdfs:label, foaf, …) are untouched. Because
|
|
173
173
|
* the canonical form is already lowercase, an already-lowercase query is an
|
|
174
174
|
* exact no-op (no rewrite, no note).
|
|
@@ -1065,7 +1065,7 @@ export async function schemaPreview(target, p) {
|
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
/**
|
|
1068
|
-
* Register the hard-break v2
|
|
1068
|
+
* Register the hard-break v2 little big brain tool belt on an MCP server. The surface is
|
|
1069
1069
|
* task-oriented for agents; each tool dispatches to the existing @littlebigbrain/client
|
|
1070
1070
|
* routes without adding new HTTP or SDK APIs.
|
|
1071
1071
|
*/
|
package/dist/tools.js
CHANGED
|
@@ -450,7 +450,7 @@ export function registerLbbTools(server, client) {
|
|
|
450
450
|
const next = rowPageNext(cursorBase, rowPage);
|
|
451
451
|
return toolResult(queryEnvelope(`lbb_query.${args.mode}`, response, detail, rowPage, next, cursorBase));
|
|
452
452
|
}
|
|
453
|
-
// Canonicalize
|
|
453
|
+
// Canonicalize little big brain relation/class/property IRI local-name case up
|
|
454
454
|
// front, then use the normalized text everywhere (mismatch check,
|
|
455
455
|
// request, cursor) so a continuation page that re-passes the raw
|
|
456
456
|
// query still matches the already-normalized cursor query. A cursor's
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@littlebigbrain/mcp",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "MCP server for
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "MCP server for little big brain — graph and hybrid search tools for agents",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -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": "^0.
|
|
55
|
+
"@littlebigbrain/client": "^0.4.0",
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1",
|
|
57
57
|
"zod": "^3"
|
|
58
58
|
},
|