@enfyra/mcp-server 0.0.81 → 0.0.82
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.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"description": "MCP server for Enfyra - manage Enfyra instances from MCP-compatible coding tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"enfyra-mcp-server": "src/index.mjs"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"src"
|
|
14
|
-
".codex/skills"
|
|
13
|
+
"src"
|
|
15
14
|
],
|
|
16
15
|
"scripts": {
|
|
17
16
|
"start": "node src/index.mjs",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Enfyra MCP Performance And Debug Mode
|
|
2
|
-
|
|
3
|
-
Use this skill when designing, reviewing, or debugging Enfyra apps through MCP where performance, read/write shape, indexes, websocket latency, RLS filters, or query correctness matter.
|
|
4
|
-
|
|
5
|
-
## Rules
|
|
6
|
-
- Verify capability with live metadata before claiming performance behavior. Use `inspect_table`, `inspect_route`, `discover_query_capabilities`, and `discover_runtime_context` first.
|
|
7
|
-
- Prefer indexed relation filters over scalar mirror columns. Relation property names can be used in `indexes` and `uniques`; Enfyra resolves them to physical FK columns.
|
|
8
|
-
- For hot read paths, design indexes with the most selective/user-scoped field first. Examples: `["member","is_read","conversation"]` for unread lookup and `["conversation","member","is_read"]` for mark-read updates.
|
|
9
|
-
- Use existence checks for UI dots and badges unless the user explicitly needs exact counts. Avoid count queries on every conversation row.
|
|
10
|
-
- Use `meta=filterCount` or MCP `count_records` only when count is the product requirement.
|
|
11
|
-
- For RLS hooks, mutate `@QUERY.filter` and preserve existing user filters with `_and`. `@QUERY.filter` is already `{}` when omitted.
|
|
12
|
-
- For dynamic scripts, keep runtime values in their original type. Do not wrap ids or payload values in `String(...)`, `Number(...)`, or `Boolean(...)`.
|
|
13
|
-
- For websocket apps, connect browsers through the Enfyra app/Nuxt bridge, not the hidden backend. Event handlers should be script-owned and use `@SOCKET` explicitly.
|
|
14
|
-
- Authenticated websocket gateways load `user_definition` once and expose it as `@USER`; do not ask clients to send their own `senderId`.
|
|
15
|
-
- Enfyra automatically joins authenticated sockets to `user_<userId>` after the connection script succeeds. App scripts should use this for `emitToUser` and should not re-join that room manually.
|
|
16
|
-
|
|
17
|
-
## Debug Workflow
|
|
18
|
-
1. Inspect the table schema, relations, indexes, and route permissions before changing code.
|
|
19
|
-
2. Reproduce with the smallest real request or Socket.IO event. Prefer `test_rest_endpoint` or `run_admin_test` when available.
|
|
20
|
-
3. If the problem is performance, state the exact query shape and expected index. Add or update `indexes` on `table_definition` through `create_table` or `update_table`.
|
|
21
|
-
4. Reload metadata/cache after schema or script changes when the tool does not do it automatically.
|
|
22
|
-
5. Retest the exact route/event and compare behavior before/after. Do not invent benchmark numbers.
|
|
23
|
-
|
|
24
|
-
## Chat App Review Checklist
|
|
25
|
-
- Confirm REST and Socket.IO both go through the app origin. REST uses the app proxy prefix; Socket.IO uses `/ws/<namespace>` and `path: "/ws/socket.io"` when the app bridge exposes that path.
|
|
26
|
-
- Confirm browser code never stores or forwards custom JWT cookies when the Enfyra app/proxy already manages cookies.
|
|
27
|
-
- Confirm `chat:join` queries `chat_conversation` visible to `@USER`, then joins `conversation:<id>`. Do not join rooms from raw membership member ids.
|
|
28
|
-
- Confirm `chat:message` uses `@SOCKET.broadcastToRoom("conversation:" + conversationId, ...)` and persists with `@REPOS` inside the event script. Do not add a flow just to save chat messages.
|
|
29
|
-
- Confirm new DM UX creates no empty conversation. A draft opens first; the first message calls a creation event that creates the conversation and message together.
|
|
30
|
-
- Confirm route-level RLS is server-side: pre-hooks merge membership filters into `@QUERY.filter` with `_and`; the client must not fetch all conversations then filter locally.
|
|
31
|
-
- Confirm conversation titles are computed from visible memberships from the current user's perspective. DM title should be the other person, not the current user.
|
|
32
|
-
- Confirm message history uses cursor pagination, newest messages first from the API then reversed for display; loading older messages preserves scroll.
|
|
33
|
-
- Confirm disconnect state disables chat input and shows a visible retry banner immediately.
|
|
34
|
-
- Confirm typing state is room-scoped, user-aware, and remains active while the input has text, even if the user pauses typing.
|
|
35
|
-
|
|
36
|
-
## Chat Read/Unread Pattern
|
|
37
|
-
- Use a join table, e.g. `chat_message_read`, with:
|
|
38
|
-
- `message` relation to `chat_message`
|
|
39
|
-
- `conversation` relation to `chat_conversation`
|
|
40
|
-
- `member` relation to `user_definition`
|
|
41
|
-
- `is_read` boolean
|
|
42
|
-
- `read_at` date nullable
|
|
43
|
-
- Add unique `["message","member"]`.
|
|
44
|
-
- Add indexes `["member","is_read","conversation"]` and `["conversation","member","is_read"]`.
|
|
45
|
-
- On message create, create read rows for conversation members. Sender rows start as read; other member rows start unread.
|
|
46
|
-
- On conversation open/read, update unread rows for `@USER` in that conversation to read.
|
|
47
|
-
- UI unread dots should check whether an unread row exists; count only when requested.
|