@naumu/mcp 0.7.1 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.js +166 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2131,6 +2131,164 @@ function registerChatgptFetch(server2, client2) {
2131
2131
  );
2132
2132
  }
2133
2133
 
2134
+ // ../mcp-core/src/tools/admission-status.ts
2135
+ import { z as z46 } from "zod";
2136
+ function registerAdmissionStatus(server2, client2) {
2137
+ server2.registerTool(
2138
+ "naumu_admission_status",
2139
+ {
2140
+ title: "Admission Status",
2141
+ annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
2142
+ description: "Show who can auto-join a Naumu space (graph) and who is waiting for approval: the whitelisted emails (people who join the moment they sign in with that email), the auto-join domain wildcards, and the count of pending join requests. When there are pending requests, this also returns the full list (who requested, their email, git-email hint, and message) so you can act on them with naumu_resolve_join_request. Use it during repo init to review or seed access, or whenever the user asks who has access to a space or who is asking to join.",
2143
+ inputSchema: z46.object({
2144
+ graphId: z46.string().describe("The space (graph) ID to inspect admission for. You must be a member of this space.")
2145
+ })
2146
+ },
2147
+ async ({ graphId }) => {
2148
+ try {
2149
+ const status = await client2.get(
2150
+ `/api/graphs/${graphId}/admission`
2151
+ );
2152
+ let pendingRequests;
2153
+ if (status && status.pendingRequestCount > 0) {
2154
+ pendingRequests = await client2.get(
2155
+ `/api/graphs/${graphId}/admission/requests?status=pending`
2156
+ );
2157
+ }
2158
+ const result = { ...status, pendingRequests };
2159
+ return {
2160
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
2161
+ };
2162
+ } catch (err) {
2163
+ const message = err instanceof Error ? err.message : String(err);
2164
+ return {
2165
+ content: [{ type: "text", text: `Error: ${message}` }],
2166
+ isError: true
2167
+ };
2168
+ }
2169
+ }
2170
+ );
2171
+ }
2172
+
2173
+ // ../mcp-core/src/tools/whitelist-members.ts
2174
+ import { z as z47 } from "zod";
2175
+ function registerWhitelistMembers(server2, client2) {
2176
+ server2.registerTool(
2177
+ "naumu_whitelist_members",
2178
+ {
2179
+ title: "Whitelist Members",
2180
+ annotations: {
2181
+ readOnlyHint: false,
2182
+ destructiveHint: false,
2183
+ idempotentHint: false,
2184
+ openWorldHint: false
2185
+ },
2186
+ description: "Whitelist emails so those people auto-join a Naumu space (graph) the moment they sign in with that email. Use this during repo init: after you scrub git history, present the curated list of collaborators to the user, and get their explicit confirmation, call this with the confirmed emails. It is silent - it sends no invite emails, it just pre-authorizes those addresses. Returns which entries were created and which were skipped (already whitelisted or already members). Set repoInit true when this call is part of the repo init flow.",
2187
+ inputSchema: z47.object({
2188
+ graphId: z47.string().describe("The space (graph) ID to whitelist emails for. You must be a member of this space."),
2189
+ emails: z47.array(z47.string()).min(1).describe("The emails to whitelist. Each becomes an exact-match auto-join entry. Present these to the user and get confirmation before calling."),
2190
+ repoInit: z47.boolean().optional().describe("Set true when this whitelist is being seeded as part of the repo init flow, so onboarding is tracked correctly.")
2191
+ })
2192
+ },
2193
+ async ({ graphId, emails, repoInit }) => {
2194
+ try {
2195
+ const result = await client2.post(`/api/graphs/${graphId}/admission/whitelist`, {
2196
+ entries: emails.map((email) => ({ email })),
2197
+ repoInit
2198
+ });
2199
+ return {
2200
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
2201
+ };
2202
+ } catch (err) {
2203
+ const message = err instanceof Error ? err.message : String(err);
2204
+ return {
2205
+ content: [{ type: "text", text: `Error: ${message}` }],
2206
+ isError: true
2207
+ };
2208
+ }
2209
+ }
2210
+ );
2211
+ }
2212
+
2213
+ // ../mcp-core/src/tools/resolve-admission.ts
2214
+ import { z as z48 } from "zod";
2215
+ function registerResolveAdmission(server2, client2) {
2216
+ server2.registerTool(
2217
+ "naumu_resolve_admission",
2218
+ {
2219
+ title: "Resolve Admission",
2220
+ annotations: {
2221
+ readOnlyHint: false,
2222
+ destructiveHint: false,
2223
+ idempotentHint: false,
2224
+ openWorldHint: false
2225
+ },
2226
+ description: "The call a coding agent makes right after connecting when a repo's .naumu references a space the user is not yet a member of. It evaluates whether the user can join and does it: outcome is joined-whitelist or joined-wildcard (the user is now a member - proceed), already-member (nothing to do), request-created (a join request was just filed and is awaiting a member's approval), or request-pending (a request was already open). When the response also carries reason 'seat-limit' on a request-created/request-pending outcome, the user WOULD have auto-joined via a whitelist/domain match but the space is at its seat limit - so their access is pending an admin approving them or upgrading the plan; relay that specific reason honestly, do not just say 'no match'. Pass gitEmailHint from `git config user.email` so a matching whitelist or domain rule can admit them. Relay the outcome to the user honestly: say plainly whether they joined or are waiting for approval - never imply access that is still pending.",
2227
+ inputSchema: z48.object({
2228
+ graphId: z48.string().describe("The space (graph) ID referenced by the repo .naumu file that the user wants to join."),
2229
+ gitEmailHint: z48.string().optional().describe("The email from `git config user.email`, used to match whitelist entries and auto-join domains.")
2230
+ })
2231
+ },
2232
+ async ({ graphId, gitEmailHint }) => {
2233
+ try {
2234
+ const result = await client2.post("/api/admission/resolve", {
2235
+ graphId,
2236
+ gitEmailHint
2237
+ });
2238
+ return {
2239
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
2240
+ };
2241
+ } catch (err) {
2242
+ const message = err instanceof Error ? err.message : String(err);
2243
+ return {
2244
+ content: [{ type: "text", text: `Error: ${message}` }],
2245
+ isError: true
2246
+ };
2247
+ }
2248
+ }
2249
+ );
2250
+ }
2251
+
2252
+ // ../mcp-core/src/tools/resolve-join-request.ts
2253
+ import { z as z49 } from "zod";
2254
+ function registerResolveJoinRequest(server2, client2) {
2255
+ server2.registerTool(
2256
+ "naumu_resolve_join_request",
2257
+ {
2258
+ title: "Resolve Join Request",
2259
+ annotations: {
2260
+ readOnlyHint: false,
2261
+ destructiveHint: false,
2262
+ idempotentHint: false,
2263
+ openWorldHint: false
2264
+ },
2265
+ description: "For a member resolving a pending join request surfaced by naumu_admission_status. Approve to add the requester to the space as a member, or deny to reject the request. Get the requestId from naumu_admission_status's pending list, and confirm the decision with the user before calling since approving grants access.",
2266
+ inputSchema: z49.object({
2267
+ graphId: z49.string().describe("The space (graph) ID the request is for. You must be a member of this space."),
2268
+ requestId: z49.string().describe("The pending join request ID, taken from naumu_admission_status."),
2269
+ action: z49.enum(["approve", "deny"]).describe("approve adds the requester as a member; deny rejects the request.")
2270
+ })
2271
+ },
2272
+ async ({ graphId, requestId, action }) => {
2273
+ try {
2274
+ const result = await client2.post(
2275
+ `/api/graphs/${graphId}/admission/requests/${requestId}/resolve`,
2276
+ { action }
2277
+ );
2278
+ return {
2279
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
2280
+ };
2281
+ } catch (err) {
2282
+ const message = err instanceof Error ? err.message : String(err);
2283
+ return {
2284
+ content: [{ type: "text", text: `Error: ${message}` }],
2285
+ isError: true
2286
+ };
2287
+ }
2288
+ }
2289
+ );
2290
+ }
2291
+
2134
2292
  // ../mcp-core/src/tools/index.ts
2135
2293
  var TOOL_REGISTRARS = {
2136
2294
  naumu_list_graphs: registerListGraphs,
@@ -2182,7 +2340,14 @@ var TOOL_REGISTRARS = {
2182
2340
  // search + node read and emit the `{ results }` / `{ id, title, text, url }`
2183
2341
  // shapes that client expects (see chatgpt-search.ts / chatgpt-fetch.ts).
2184
2342
  search: registerChatgptSearch,
2185
- fetch: registerChatgptFetch
2343
+ fetch: registerChatgptFetch,
2344
+ // Admission / onboarding-wedge tools (user-surface only — omitted from
2345
+ // BOT_ONLY_TOOL_NAMES and from the backend PERMISSION_TO_MCP_TOOLS map, so
2346
+ // bots never receive them, matching the naumu_list_graphs precedent).
2347
+ naumu_admission_status: registerAdmissionStatus,
2348
+ naumu_whitelist_members: registerWhitelistMembers,
2349
+ naumu_resolve_admission: registerResolveAdmission,
2350
+ naumu_resolve_join_request: registerResolveJoinRequest
2186
2351
  };
2187
2352
  var BOT_ONLY_TOOL_NAMES = /* @__PURE__ */ new Set(["naumu_create_thread"]);
2188
2353
  var ALL_TOOL_NAMES = Object.keys(TOOL_REGISTRARS).filter(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naumu/mcp",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "MCP server for Naumu – access your knowledge graph from Claude Code, Cursor, and other AI coding agents",
5
5
  "license": "MIT",
6
6
  "author": "Naumu <hello@naumu.ai>",