mindgraph-mcp 0.21.0 → 0.22.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
@@ -287,6 +287,35 @@ lifecycle observation, context delivery, and managed curation.
287
287
 
288
288
  Search strategy is **keyword-first**: `mindgraph_retrieve` defaults to `action: "context"`, which seeds bounded cheapest-first graph expansion from BM25/hybrid recall. Escalate to `semantic` or `hybrid` only when keywords fail. Set `graph_expansion_limit: 0` when direct-only retrieval is required. For model-facing reads, `max_output_chars` bounds the rendered response from 512 to 24,000 characters while preserving whole evidence items and reporting omissions; `format: "json"` deliberately bypasses that rendering contract.
289
289
 
290
+ ## Hosted mode
291
+
292
+ The same tool surface is importable as a library for a hosted Streamable HTTP
293
+ endpoint (the `https://mindgraph.cloud/mcp` connector that claude.ai, Claude
294
+ Code, ChatGPT and Cursor sign in to with OAuth). `mindgraph-mcp/server` exports
295
+ a per-request factory and has no load-time side effects — it never exits for a
296
+ missing key or touches hook files:
297
+
298
+ ```ts
299
+ import { handleHostedRequest } from "mindgraph-mcp/server";
300
+
301
+ // After the route has verified the OAuth bearer and exchanged it for an API token:
302
+ return handleHostedRequest(request, {
303
+ client, bearer, baseUrl, orgId, orgName, agentId: `mcp:${clientHost}:${userId}`,
304
+ user: { id: userId, name, email },
305
+ profile: "general", harness: "hosted", serverVersion,
306
+ caches, // { generatedTools: Map, governance: Map } — one entry per org, kept by the route
307
+ });
308
+ ```
309
+
310
+ Hosted mode serves the `general` profile plus the org's generated ontology
311
+ tools and three extra tools — `search`, `fetch` (the ChatGPT connector
312
+ contract, `structuredContent` + text twin) and `whoami` — each annotated and
313
+ carrying `_meta.securitySchemes` with its `graph:read` / `graph:write` /
314
+ `graph:evolve` scope. The signed-in member's identity overwrites `agent_id`
315
+ on every call; a model-supplied value is kept only as `requested_agent_id`
316
+ metadata. `mindgraph_code`, `mindgraph_sync` and hook installation are stdio-only.
317
+ The HTTP auth gate (401/403) is the route's job, not the library's.
318
+
290
319
  ## Development
291
320
 
292
321
  ```bash