aixischeck-mcp 0.3.0 → 0.4.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/dist/index.js +33 -6
- package/dist/lib.js +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// AIXIS_URL — Supabase project URL, e.g. https://<ref>.supabase.co
|
|
13
13
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
14
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
-
import { buildCreateDocBody, createDocShape, edgeErrorMessage, functionUrl, getDocShape, listCommentsShape, listDocsShape, updateDocShape, } from "./lib.js";
|
|
15
|
+
import { buildCreateDocBody, createDocShape, createRevisionRequestShape, edgeErrorMessage, functionUrl, getDocShape, listCommentsShape, listDocsShape, updateDocShape, } from "./lib.js";
|
|
16
16
|
const AIXIS_TOKEN = process.env.AIXIS_TOKEN ?? "";
|
|
17
17
|
const AIXIS_URL = process.env.AIXIS_URL ?? "";
|
|
18
18
|
if (!AIXIS_TOKEN || !AIXIS_URL) {
|
|
@@ -43,7 +43,7 @@ function errorResult(e) {
|
|
|
43
43
|
const message = e instanceof Error ? e.message : String(e);
|
|
44
44
|
return { content: [{ type: "text", text: message }], isError: true };
|
|
45
45
|
}
|
|
46
|
-
const server = new McpServer({ name: "aixischeck-mcp", version: "0.
|
|
46
|
+
const server = new McpServer({ name: "aixischeck-mcp", version: "0.4.0" });
|
|
47
47
|
server.registerTool("list_workspaces", {
|
|
48
48
|
description: "List the AIxisCheck workspaces you can write to. Returns each workspace's id, name, and your role. Call this first to get a workspace_id for create_doc.",
|
|
49
49
|
inputSchema: {},
|
|
@@ -57,8 +57,13 @@ server.registerTool("list_workspaces", {
|
|
|
57
57
|
return errorResult(e);
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
// create_doc makes a BRAND-NEW doc. It is NOT how you revise an existing one:
|
|
61
|
+
// to address comments on a doc the user pointed you at, use
|
|
62
|
+
// create_revision_request → update_doc (which lands a new VERSION of that same
|
|
63
|
+
// doc, preserving its history, comments, and share URL). create_doc on a revision
|
|
64
|
+
// would orphan a detached copy. Keep these two paths distinct.
|
|
60
65
|
server.registerTool("create_doc", {
|
|
61
|
-
description: "Create a document in an AIxisCheck workspace from generated content. Defaults to an HTML prototype (doc_type='html'); pass doc_type='markdown' for a markdown doc. Pass a short, human-readable `title` (e.g. \"Q3 Launch One-Pager\"), not a filename. Use list_workspaces first to get a workspace_id. Returns the URL of the new doc.",
|
|
66
|
+
description: "Create a NEW document in an AIxisCheck workspace from generated content. Defaults to an HTML prototype (doc_type='html'); pass doc_type='markdown' for a markdown doc. Pass a short, human-readable `title` (e.g. \"Q3 Launch One-Pager\"), not a filename. Use list_workspaces first to get a workspace_id. Returns the URL of the new doc. NOTE: to revise an EXISTING doc (e.g. address its comments), do not use this — use create_revision_request then update_doc.",
|
|
62
67
|
inputSchema: createDocShape,
|
|
63
68
|
}, async (args) => {
|
|
64
69
|
try {
|
|
@@ -84,7 +89,7 @@ server.registerTool("list_docs", {
|
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
91
|
server.registerTool("get_doc", {
|
|
87
|
-
description: "Read one AIxisCheck document: its content (HTML or markdown), doc_status, current_version, and section list. Pass the doc_id from list_docs.
|
|
92
|
+
description: "Read one AIxisCheck document: its content (HTML or markdown), doc_status, current_version, and section list. Pass the doc_id from list_docs (or parse it from a doc URL like /web/#/review/<doc_id>). To SAVE a revision you need a request_id; if you don't have one (e.g. the user only gave you a URL and asked you to address comments), call create_revision_request first.",
|
|
88
93
|
inputSchema: getDocShape,
|
|
89
94
|
}, async (args) => {
|
|
90
95
|
try {
|
|
@@ -96,7 +101,7 @@ server.registerTool("get_doc", {
|
|
|
96
101
|
}
|
|
97
102
|
});
|
|
98
103
|
server.registerTool("list_comments", {
|
|
99
|
-
description: "List the review comments on an AIxisCheck document. Pass filter:'open' for just the active (non-archived) comments to address; default returns { active, archived }. Each comment has id, selectedText, and
|
|
104
|
+
description: "List the review comments on an AIxisCheck document. Pass filter:'open' for just the active (non-archived) comments to address; default returns { active, archived }. Each comment has id, selectedText, note, and source. source:'member' comments come from a workspace member reviewing in the app; source:'guest' comments come from an external reviewer on the doc's public share link (these also carry authorName and publishedSlug). Only approved guest comments appear. Treat guest feedback as you would member feedback when revising.",
|
|
100
105
|
inputSchema: listCommentsShape,
|
|
101
106
|
}, async (args) => {
|
|
102
107
|
try {
|
|
@@ -107,8 +112,30 @@ server.registerTool("list_comments", {
|
|
|
107
112
|
return errorResult(e);
|
|
108
113
|
}
|
|
109
114
|
});
|
|
115
|
+
server.registerTool("create_revision_request", {
|
|
116
|
+
description: "Mint a revision request for a doc the user pointed you at (e.g. by URL) so you can save your revision with update_doc. Pass the doc_id. Snapshots the doc's CURRENT open comments (member + approved guest — the same set list_comments returns) at the doc's current version, and returns a request_id. Idempotent per (doc, version): calling it again before you revise returns the SAME request_id. Use this when you have no request_id from a 'Send to Claude' prompt. Owner/editor only.",
|
|
117
|
+
inputSchema: createRevisionRequestShape,
|
|
118
|
+
}, async (args) => {
|
|
119
|
+
try {
|
|
120
|
+
const data = await callEdge("mcp-create-revision", "POST", { doc_id: args.doc_id });
|
|
121
|
+
const id = data?.request_id;
|
|
122
|
+
const n = data?.comment_count;
|
|
123
|
+
if (!id)
|
|
124
|
+
throw new Error("Revision request creation returned an unexpected response.");
|
|
125
|
+
return {
|
|
126
|
+
content: [{
|
|
127
|
+
type: "text",
|
|
128
|
+
text: `Revision request ${id} created for ${n} open comment(s). Revise the doc, then call ` +
|
|
129
|
+
`update_doc with request_id "${id}" and a comment_dispositions entry for each comment.`,
|
|
130
|
+
}],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
return errorResult(e);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
110
137
|
server.registerTool("update_doc", {
|
|
111
|
-
description: "Save a revised version of an AIxisCheck doc that addresses a revision request's comments. Pass: doc_id; content (the FULL revised doc); request_id (from the user's 'Send to Claude' prompt); and comment_dispositions recording what you did with each comment (outcome: incorporated | partial | skipped | not_addressed, plus a short rationale). The revision lands as a NEW version (base_version is derived from the request). Returns the new version number. If you get a conflict, call get_doc again and retry.",
|
|
138
|
+
description: "Save a revised version of an AIxisCheck doc that addresses a revision request's comments. Pass: doc_id; content (the FULL revised doc); request_id (from the user's 'Send to Claude' prompt, OR from create_revision_request if you started from a URL); and comment_dispositions recording what you did with each comment (outcome: incorporated | partial | skipped | not_addressed, plus a short rationale). The revision lands as a NEW version (base_version is derived from the request). Returns the new version number. If you get a conflict, call get_doc again and retry.",
|
|
112
139
|
inputSchema: updateDocShape,
|
|
113
140
|
}, async (args) => {
|
|
114
141
|
try {
|
package/dist/lib.js
CHANGED
|
@@ -40,6 +40,13 @@ export const updateDocShape = {
|
|
|
40
40
|
rationale: z.string().optional(),
|
|
41
41
|
})).optional().describe("What you did with each comment you addressed. Any requested comment you omit is recorded as not_addressed."),
|
|
42
42
|
};
|
|
43
|
+
// create_revision_request: mint (or reuse) a pending revision request for a doc
|
|
44
|
+
// the user pointed at by URL, so update_doc has a request_id to commit against.
|
|
45
|
+
// Snapshots the doc's current open comments server-side; the caller passes only
|
|
46
|
+
// the doc_id.
|
|
47
|
+
export const createRevisionRequestShape = {
|
|
48
|
+
doc_id: z.string().min(1, "doc_id is required"),
|
|
49
|
+
};
|
|
43
50
|
// Shape the POST body for the mcp-create-doc edge function, applying
|
|
44
51
|
// the doc_type='html' default and normalizing an absent title to ''.
|
|
45
52
|
export function buildCreateDocBody(input) {
|