@enfyra/mcp-server 0.0.18 → 0.0.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enfyra/mcp-server",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "MCP server for Enfyra - manage your Enfyra instance via Claude Code",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,7 +48,16 @@ export function buildMcpServerInstructions(apiBaseUrl) {
48
48
  ` - **DELETE** \`${delOne}\` — delete one row.`,
49
49
  `- **No** **GET** \`${base}/<table_name>/<id>\`. For one row by id use **GET** \`${getOneById}\` or MCP \`query_table\` / \`find_one_record\`.`,
50
50
  '',
51
- '### Auth and publishedMethods (Enfyra server)',
51
+ '### Relation field format (create_record / update_record)',
52
+ '- Relation fields (mainTable, publishedMethods, availableMethods, handlers, preHooks, postHooks, etc.) use **object references with `id`**:',
53
+ ' - **Many-to-one:** `"mainTable": {"id": 4}` (single object with id)',
54
+ ' - **One-to-many / many-to-many:** `"publishedMethods": [{"id": 1}, {"id": 2}]` (array of objects with id)',
55
+ '- **Method IDs** (for publishedMethods, availableMethods, skipRoleGuardMethods): GET=1, POST=2, PATCH=3, DELETE=4, GQL_QUERY=5, GQL_MUTATION=6. Query `method_definition` table if unsure.',
56
+ '- **Wrong:** `"publishedMethods": ["GET"]` or `"publishedMethods": [{"method": "GET"}]` — rejected or silently ignored.',
57
+ '- **Right:** `"publishedMethods": [{"id": 1}]` (publishes GET). Multiple: `[{"id": 1}, {"id": 2}]` (publishes GET + POST).',
58
+ '- **To unset:** pass empty array `"publishedMethods": []`.',
59
+ '',
60
+ '### Auth and publishedMethods (Enfyra server)',
52
61
  '- Each route has **publishedMethods** (which HTTP verbs are “public”) and **routePermissions** (roles/users for protected access).',
53
62
  '- If the **current request method** is listed in **publishedMethods** for that route, the server allows the call **without** a Bearer token (`RoleGuard`).',
54
63
  '- Otherwise the client must send an **Authorization** header with **Bearer** JWT from login. Then the user must satisfy **routePermissions** (unless root admin).',
@@ -374,7 +374,7 @@ registerTableTools(server, ENFYRA_API_URL);
374
374
  // CACHE & SYSTEM TOOLS
375
375
  // ============================================================================
376
376
 
377
- server.tool('reload_all', 'Reload all caches (metadata, routes, swagger, GraphQL)', {}, async () => {
377
+ server.tool('reload_all', 'Reload all caches (metadata, routes, GraphQL)', {}, async () => {
378
378
  const result = await fetchAPI(ENFYRA_API_URL, '/admin/reload', { method: 'POST' });
379
379
  return { content: [{ type: 'text', text: `System reloaded:\n${JSON.stringify(result, null, 2)}` }] };
380
380
  });
@@ -389,11 +389,6 @@ server.tool('reload_routes', 'Reload routes cache only', {}, async () => {
389
389
  return { content: [{ type: 'text', text: `Routes reloaded:\n${JSON.stringify(result, null, 2)}` }] };
390
390
  });
391
391
 
392
- server.tool('reload_swagger', 'Reload Swagger/OpenAPI spec', {}, async () => {
393
- const result = await fetchAPI(ENFYRA_API_URL, '/admin/reload/swagger', { method: 'POST' });
394
- return { content: [{ type: 'text', text: `Swagger reloaded:\n${JSON.stringify(result, null, 2)}` }] };
395
- });
396
-
397
392
  server.tool('reload_graphql', 'Reload GraphQL schema', {}, async () => {
398
393
  const result = await fetchAPI(ENFYRA_API_URL, '/admin/reload/graphql', { method: 'POST' });
399
394
  return { content: [{ type: 'text', text: `GraphQL reloaded:\n${JSON.stringify(result, null, 2)}` }] };