whiteboard-mcp-server 1.1.0 → 2.1.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/api-client.d.ts +78 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +76 -0
- package/dist/api-client.js.map +1 -1
- package/dist/index.js +353 -22
- package/dist/index.js.map +1 -1
- package/dist/tools/bulk-resolve-paper.d.ts +15 -0
- package/dist/tools/bulk-resolve-paper.d.ts.map +1 -0
- package/dist/tools/bulk-resolve-paper.js +30 -0
- package/dist/tools/bulk-resolve-paper.js.map +1 -0
- package/dist/tools/compile-paper.d.ts +14 -0
- package/dist/tools/compile-paper.d.ts.map +1 -0
- package/dist/tools/compile-paper.js +25 -0
- package/dist/tools/compile-paper.js.map +1 -0
- package/dist/tools/create-paper.d.ts +24 -0
- package/dist/tools/create-paper.d.ts.map +1 -0
- package/dist/tools/create-paper.js +41 -0
- package/dist/tools/create-paper.js.map +1 -0
- package/dist/tools/delete-paper.d.ts +12 -0
- package/dist/tools/delete-paper.d.ts.map +1 -0
- package/dist/tools/delete-paper.js +13 -0
- package/dist/tools/delete-paper.js.map +1 -0
- package/dist/tools/get-paper-comments.d.ts +15 -0
- package/dist/tools/get-paper-comments.d.ts.map +1 -0
- package/dist/tools/get-paper-comments.js +43 -0
- package/dist/tools/get-paper-comments.js.map +1 -0
- package/dist/tools/list-paper-versions.d.ts +18 -0
- package/dist/tools/list-paper-versions.d.ts.map +1 -0
- package/dist/tools/list-paper-versions.js +35 -0
- package/dist/tools/list-paper-versions.js.map +1 -0
- package/dist/tools/list-papers.d.ts +18 -0
- package/dist/tools/list-papers.d.ts.map +1 -0
- package/dist/tools/list-papers.js +22 -0
- package/dist/tools/list-papers.js.map +1 -0
- package/dist/tools/read-paper-version.d.ts +15 -0
- package/dist/tools/read-paper-version.d.ts.map +1 -0
- package/dist/tools/read-paper-version.js +26 -0
- package/dist/tools/read-paper-version.js.map +1 -0
- package/dist/tools/read-paper.d.ts +12 -0
- package/dist/tools/read-paper.d.ts.map +1 -0
- package/dist/tools/read-paper.js +22 -0
- package/dist/tools/read-paper.js.map +1 -0
- package/dist/tools/resolve-paper-thread.d.ts +18 -0
- package/dist/tools/resolve-paper-thread.d.ts.map +1 -0
- package/dist/tools/resolve-paper-thread.js +17 -0
- package/dist/tools/resolve-paper-thread.js.map +1 -0
- package/dist/tools/restore-paper-version.d.ts +15 -0
- package/dist/tools/restore-paper-version.d.ts.map +1 -0
- package/dist/tools/restore-paper-version.js +19 -0
- package/dist/tools/restore-paper-version.js.map +1 -0
- package/dist/tools/update-paper.d.ts +15 -0
- package/dist/tools/update-paper.d.ts.map +1 -0
- package/dist/tools/update-paper.js +16 -0
- package/dist/tools/update-paper.js.map +1 -0
- package/package.json +2 -2
package/dist/api-client.d.ts
CHANGED
|
@@ -21,6 +21,32 @@ export interface NotesListResponse {
|
|
|
21
21
|
limit: number;
|
|
22
22
|
totalPages: number;
|
|
23
23
|
}
|
|
24
|
+
export interface Paper {
|
|
25
|
+
id: string;
|
|
26
|
+
slug: string;
|
|
27
|
+
content: string;
|
|
28
|
+
sharingMode: string;
|
|
29
|
+
metadata: {
|
|
30
|
+
engine?: string;
|
|
31
|
+
packages?: string[];
|
|
32
|
+
};
|
|
33
|
+
workspaceId: string | null;
|
|
34
|
+
ownerId: string;
|
|
35
|
+
publishedContent: string | null;
|
|
36
|
+
publishedAt: string | null;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
export interface PaperWithPermission extends Paper {
|
|
41
|
+
permission: 'read' | 'write' | 'none';
|
|
42
|
+
}
|
|
43
|
+
export interface PapersListResponse {
|
|
44
|
+
items: Paper[];
|
|
45
|
+
total: number;
|
|
46
|
+
page: number;
|
|
47
|
+
limit: number;
|
|
48
|
+
totalPages: number;
|
|
49
|
+
}
|
|
24
50
|
export interface CommentThread {
|
|
25
51
|
id: string;
|
|
26
52
|
noteId: string;
|
|
@@ -72,6 +98,27 @@ export interface NoteVersionsListResponse {
|
|
|
72
98
|
items: NoteVersion[];
|
|
73
99
|
total: number;
|
|
74
100
|
}
|
|
101
|
+
export interface PaperVersion {
|
|
102
|
+
id: string;
|
|
103
|
+
paperId: string;
|
|
104
|
+
versionNumber: number;
|
|
105
|
+
content: string;
|
|
106
|
+
contentLength: number;
|
|
107
|
+
createdById: string | null;
|
|
108
|
+
createdBy: {
|
|
109
|
+
id: string;
|
|
110
|
+
name: string | null;
|
|
111
|
+
email: string;
|
|
112
|
+
} | null;
|
|
113
|
+
changeSummary: string | null;
|
|
114
|
+
charsAdded: number;
|
|
115
|
+
charsRemoved: number;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
}
|
|
118
|
+
export interface PaperVersionsListResponse {
|
|
119
|
+
items: PaperVersion[];
|
|
120
|
+
total: number;
|
|
121
|
+
}
|
|
75
122
|
export declare class ApiClient {
|
|
76
123
|
private config;
|
|
77
124
|
constructor(config: Config);
|
|
@@ -100,5 +147,36 @@ export declare class ApiClient {
|
|
|
100
147
|
listNoteVersions(noteId: string, page?: number, limit?: number): Promise<NoteVersionsListResponse>;
|
|
101
148
|
getNoteVersion(noteId: string, versionRef: string): Promise<NoteVersion>;
|
|
102
149
|
restoreNoteVersion(noteId: string, versionRef: string): Promise<Note>;
|
|
150
|
+
listPapers(options?: {
|
|
151
|
+
workspaceId?: string;
|
|
152
|
+
page?: number;
|
|
153
|
+
limit?: number;
|
|
154
|
+
}): Promise<PapersListResponse>;
|
|
155
|
+
getPaperBySlug(slug: string): Promise<PaperWithPermission>;
|
|
156
|
+
createPaper(data: {
|
|
157
|
+
slug: string;
|
|
158
|
+
content?: string;
|
|
159
|
+
workspaceId?: string;
|
|
160
|
+
sharingMode?: string;
|
|
161
|
+
metadata?: {
|
|
162
|
+
engine?: string;
|
|
163
|
+
packages?: string[];
|
|
164
|
+
};
|
|
165
|
+
}): Promise<Paper>;
|
|
166
|
+
updatePaper(id: string, data: {
|
|
167
|
+
slug?: string;
|
|
168
|
+
content?: string;
|
|
169
|
+
}): Promise<Paper>;
|
|
170
|
+
deletePaper(id: string): Promise<void>;
|
|
171
|
+
listPaperCommentThreads(paperId: string): Promise<CommentThread[]>;
|
|
172
|
+
resolvePaperThread(paperId: string, threadId: string, resolved: boolean): Promise<CommentThread>;
|
|
173
|
+
listPaperVersions(paperId: string, page?: number, limit?: number): Promise<PaperVersionsListResponse>;
|
|
174
|
+
getPaperVersion(paperId: string, versionRef: string): Promise<PaperVersion>;
|
|
175
|
+
restorePaperVersion(paperId: string, versionRef: string): Promise<Paper>;
|
|
176
|
+
compilePaper(source: string, engine?: string): Promise<{
|
|
177
|
+
status: number;
|
|
178
|
+
log: string;
|
|
179
|
+
pdfSize: number | null;
|
|
180
|
+
}>;
|
|
103
181
|
}
|
|
104
182
|
//# sourceMappingURL=api-client.d.ts.map
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI;IAC9C,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,I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EAAE,CAAC;IAIlE,kBAAkB,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,aAAa,CAAC;IAUnB,iBAAiB,CACrB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,yBAAyB,CAAC;IAU/B,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,CAAC;IAMlB,mBAAmB,CACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,KAAK,CAAC;IAOX,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAmB,GAC1B,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAoBpE"}
|
package/dist/api-client.js
CHANGED
|
@@ -22,6 +22,7 @@ export class ApiClient {
|
|
|
22
22
|
}
|
|
23
23
|
return response.json();
|
|
24
24
|
}
|
|
25
|
+
// ============ Notes ============
|
|
25
26
|
async listNotes(options) {
|
|
26
27
|
const params = new URLSearchParams();
|
|
27
28
|
if (options?.workspaceId)
|
|
@@ -84,5 +85,80 @@ export class ApiClient {
|
|
|
84
85
|
async restoreNoteVersion(noteId, versionRef) {
|
|
85
86
|
return this.request(`/notes/${noteId}/versions/${encodeURIComponent(versionRef)}/restore`, { method: 'POST' });
|
|
86
87
|
}
|
|
88
|
+
// ============ Papers ============
|
|
89
|
+
async listPapers(options) {
|
|
90
|
+
const params = new URLSearchParams();
|
|
91
|
+
if (options?.workspaceId)
|
|
92
|
+
params.set('workspaceId', options.workspaceId);
|
|
93
|
+
if (options?.page)
|
|
94
|
+
params.set('page', String(options.page));
|
|
95
|
+
if (options?.limit)
|
|
96
|
+
params.set('limit', String(options.limit));
|
|
97
|
+
const query = params.toString();
|
|
98
|
+
return this.request(`/papers${query ? `?${query}` : ''}`);
|
|
99
|
+
}
|
|
100
|
+
async getPaperBySlug(slug) {
|
|
101
|
+
const response = await this.request(`/papers/by-slug/${encodeURIComponent(slug)}`);
|
|
102
|
+
return { ...response.paper, permission: response.permission };
|
|
103
|
+
}
|
|
104
|
+
async createPaper(data) {
|
|
105
|
+
return this.request('/papers', {
|
|
106
|
+
method: 'POST',
|
|
107
|
+
body: JSON.stringify(data),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async updatePaper(id, data) {
|
|
111
|
+
return this.request(`/papers/${id}`, {
|
|
112
|
+
method: 'PUT',
|
|
113
|
+
body: JSON.stringify(data),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
async deletePaper(id) {
|
|
117
|
+
await this.request(`/papers/${id}`, {
|
|
118
|
+
method: 'DELETE',
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async listPaperCommentThreads(paperId) {
|
|
122
|
+
return this.request(`/papers/${paperId}/threads`);
|
|
123
|
+
}
|
|
124
|
+
async resolvePaperThread(paperId, threadId, resolved) {
|
|
125
|
+
return this.request(`/papers/${paperId}/threads/${threadId}`, {
|
|
126
|
+
method: 'PUT',
|
|
127
|
+
body: JSON.stringify({ resolved }),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async listPaperVersions(paperId, page, limit) {
|
|
131
|
+
const params = new URLSearchParams();
|
|
132
|
+
if (page)
|
|
133
|
+
params.set('page', String(page));
|
|
134
|
+
if (limit)
|
|
135
|
+
params.set('limit', String(limit));
|
|
136
|
+
const query = params.toString();
|
|
137
|
+
return this.request(`/papers/${paperId}/versions${query ? `?${query}` : ''}`);
|
|
138
|
+
}
|
|
139
|
+
async getPaperVersion(paperId, versionRef) {
|
|
140
|
+
return this.request(`/papers/${paperId}/versions/${encodeURIComponent(versionRef)}`);
|
|
141
|
+
}
|
|
142
|
+
async restorePaperVersion(paperId, versionRef) {
|
|
143
|
+
return this.request(`/papers/${paperId}/versions/${encodeURIComponent(versionRef)}/restore`, { method: 'POST' });
|
|
144
|
+
}
|
|
145
|
+
async compilePaper(source, engine = 'pdflatex') {
|
|
146
|
+
const url = `${this.config.frontendUrl}/texlive/compile`;
|
|
147
|
+
const response = await fetch(url, {
|
|
148
|
+
method: 'POST',
|
|
149
|
+
headers: { 'Content-Type': 'application/json' },
|
|
150
|
+
body: JSON.stringify({ source, engine }),
|
|
151
|
+
});
|
|
152
|
+
if (!response.ok) {
|
|
153
|
+
const text = await response.text();
|
|
154
|
+
throw new Error(`Compile error ${response.status}: ${text}`);
|
|
155
|
+
}
|
|
156
|
+
const data = await response.json();
|
|
157
|
+
return {
|
|
158
|
+
status: data.status,
|
|
159
|
+
log: data.log,
|
|
160
|
+
pdfSize: data.pdf ? Math.round(data.pdf.length * 3 / 4) : null,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
87
163
|
}
|
|
88
164
|
//# sourceMappingURL=api-client.js.map
|
package/dist/api-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AA2HA,MAAM,OAAO,SAAS;IACZ,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,OAAO,CACnB,IAAY,EACZ,UAAuB,EAAE;QAEzB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,WAAW,E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AAM,CAAC,WAAW,kBAAkB,CAAC;QACzD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SACzC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAyD,CAAC;QAC1F,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;SAC/D,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { getConfig } from './config.js';
|
|
6
6
|
import { ApiClient } from './api-client.js';
|
|
7
|
+
// Note tools
|
|
7
8
|
import { listNotes, listNotesSchema } from './tools/list-notes.js';
|
|
8
9
|
import { readNote, readNoteSchema } from './tools/read-note.js';
|
|
9
10
|
import { updateNote, updateNoteSchema } from './tools/update-note.js';
|
|
@@ -15,11 +16,24 @@ import { bulkResolve, bulkResolveSchema } from './tools/bulk-resolve.js';
|
|
|
15
16
|
import { listVersions, listVersionsSchema } from './tools/list-versions.js';
|
|
16
17
|
import { readVersion, readVersionSchema } from './tools/read-version.js';
|
|
17
18
|
import { restoreVersion, restoreVersionSchema } from './tools/restore-version.js';
|
|
19
|
+
// Paper tools
|
|
20
|
+
import { listPapers, listPapersSchema } from './tools/list-papers.js';
|
|
21
|
+
import { readPaper, readPaperSchema } from './tools/read-paper.js';
|
|
22
|
+
import { createPaper, createPaperSchema } from './tools/create-paper.js';
|
|
23
|
+
import { updatePaper, updatePaperSchema } from './tools/update-paper.js';
|
|
24
|
+
import { deletePaper, deletePaperSchema } from './tools/delete-paper.js';
|
|
25
|
+
import { getPaperComments, getPaperCommentsSchema } from './tools/get-paper-comments.js';
|
|
26
|
+
import { resolvePaperThread, resolvePaperThreadSchema } from './tools/resolve-paper-thread.js';
|
|
27
|
+
import { bulkResolvePaper, bulkResolvePaperSchema } from './tools/bulk-resolve-paper.js';
|
|
28
|
+
import { listPaperVersions, listPaperVersionsSchema } from './tools/list-paper-versions.js';
|
|
29
|
+
import { readPaperVersion, readPaperVersionSchema } from './tools/read-paper-version.js';
|
|
30
|
+
import { restorePaperVersion, restorePaperVersionSchema } from './tools/restore-paper-version.js';
|
|
31
|
+
import { compilePaper, compilePaperSchema } from './tools/compile-paper.js';
|
|
18
32
|
const config = getConfig();
|
|
19
33
|
const apiClient = new ApiClient(config);
|
|
20
34
|
const server = new Server({
|
|
21
35
|
name: 'whiteboard-mcp',
|
|
22
|
-
version: '1.0
|
|
36
|
+
version: '2.1.0',
|
|
23
37
|
}, {
|
|
24
38
|
capabilities: {
|
|
25
39
|
tools: {},
|
|
@@ -28,6 +42,7 @@ const server = new Server({
|
|
|
28
42
|
});
|
|
29
43
|
// Tool definitions
|
|
30
44
|
const TOOLS = [
|
|
45
|
+
// ============ Note tools ============
|
|
31
46
|
{
|
|
32
47
|
name: 'list_notes',
|
|
33
48
|
description: 'List all notes accessible to you. Returns note slugs, IDs, and metadata.',
|
|
@@ -251,6 +266,261 @@ Typical workflow:
|
|
|
251
266
|
required: ['slug', 'version'],
|
|
252
267
|
},
|
|
253
268
|
},
|
|
269
|
+
// ============ Paper tools ============
|
|
270
|
+
{
|
|
271
|
+
name: 'list_papers',
|
|
272
|
+
description: 'List all papers (LaTeX documents) accessible to you. Returns paper slugs, IDs, and metadata.',
|
|
273
|
+
inputSchema: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
properties: {
|
|
276
|
+
workspaceId: {
|
|
277
|
+
type: 'string',
|
|
278
|
+
description: 'Filter by workspace ID (optional)',
|
|
279
|
+
},
|
|
280
|
+
page: {
|
|
281
|
+
type: 'number',
|
|
282
|
+
description: 'Page number (default: 1)',
|
|
283
|
+
},
|
|
284
|
+
limit: {
|
|
285
|
+
type: 'number',
|
|
286
|
+
description: 'Items per page (default: 15, max: 100)',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'read_paper',
|
|
293
|
+
description: 'Read the full LaTeX content of a paper by its slug.',
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: 'object',
|
|
296
|
+
properties: {
|
|
297
|
+
slug: {
|
|
298
|
+
type: 'string',
|
|
299
|
+
description: 'The slug (URL-friendly name) of the paper to read',
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
required: ['slug'],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'create_paper',
|
|
307
|
+
description: 'Create a new paper (LaTeX document) with a unique slug.',
|
|
308
|
+
inputSchema: {
|
|
309
|
+
type: 'object',
|
|
310
|
+
properties: {
|
|
311
|
+
slug: {
|
|
312
|
+
type: 'string',
|
|
313
|
+
description: 'URL-friendly slug (lowercase, hyphens allowed, e.g., "my-paper")',
|
|
314
|
+
},
|
|
315
|
+
content: {
|
|
316
|
+
type: 'string',
|
|
317
|
+
description: 'Initial LaTeX content for the paper (optional)',
|
|
318
|
+
},
|
|
319
|
+
workspaceId: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
description: 'Workspace ID to create the paper in (optional)',
|
|
322
|
+
},
|
|
323
|
+
sharingMode: {
|
|
324
|
+
type: 'string',
|
|
325
|
+
enum: ['private', 'protected', 'limited', 'editable', 'public', 'open-bar'],
|
|
326
|
+
description: 'Sharing mode for the paper (default: private)',
|
|
327
|
+
},
|
|
328
|
+
engine: {
|
|
329
|
+
type: 'string',
|
|
330
|
+
enum: ['pdflatex', 'xelatex'],
|
|
331
|
+
description: 'LaTeX engine (default: pdflatex)',
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
required: ['slug'],
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'update_paper',
|
|
339
|
+
description: `Update the content of an existing paper. Requires write permission.
|
|
340
|
+
|
|
341
|
+
IMPORTANT RULES:
|
|
342
|
+
- ALWAYS use read_paper BEFORE updating to get the latest content (the user may have modified it)
|
|
343
|
+
- After updating, resolve all comment threads that were addressed in your changes using bulk_resolve_paper_threads`,
|
|
344
|
+
inputSchema: {
|
|
345
|
+
type: 'object',
|
|
346
|
+
properties: {
|
|
347
|
+
slug: {
|
|
348
|
+
type: 'string',
|
|
349
|
+
description: 'The slug of the paper to update',
|
|
350
|
+
},
|
|
351
|
+
content: {
|
|
352
|
+
type: 'string',
|
|
353
|
+
description: 'The new LaTeX content for the paper',
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
required: ['slug', 'content'],
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'delete_paper',
|
|
361
|
+
description: 'Delete a paper. Requires write permission. This action is irreversible.',
|
|
362
|
+
inputSchema: {
|
|
363
|
+
type: 'object',
|
|
364
|
+
properties: {
|
|
365
|
+
slug: {
|
|
366
|
+
type: 'string',
|
|
367
|
+
description: 'The slug of the paper to delete',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
required: ['slug'],
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: 'get_paper_comments',
|
|
375
|
+
description: `Get all comment threads on a paper, with their replies.
|
|
376
|
+
|
|
377
|
+
WORKFLOW: After retrieving comments and updating the paper to address them, use bulk_resolve_paper_threads to mark all addressed threads as resolved.`,
|
|
378
|
+
inputSchema: {
|
|
379
|
+
type: 'object',
|
|
380
|
+
properties: {
|
|
381
|
+
slug: {
|
|
382
|
+
type: 'string',
|
|
383
|
+
description: 'The slug of the paper to get comments from',
|
|
384
|
+
},
|
|
385
|
+
includeResolved: {
|
|
386
|
+
type: 'boolean',
|
|
387
|
+
description: 'Include resolved comment threads (default: true)',
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
required: ['slug'],
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: 'resolve_paper_thread',
|
|
395
|
+
description: 'Mark a comment thread on a paper as resolved or reopen it.',
|
|
396
|
+
inputSchema: {
|
|
397
|
+
type: 'object',
|
|
398
|
+
properties: {
|
|
399
|
+
slug: {
|
|
400
|
+
type: 'string',
|
|
401
|
+
description: 'The slug of the paper containing the thread',
|
|
402
|
+
},
|
|
403
|
+
threadId: {
|
|
404
|
+
type: 'string',
|
|
405
|
+
description: 'The ID of the comment thread to resolve/unresolve',
|
|
406
|
+
},
|
|
407
|
+
resolved: {
|
|
408
|
+
type: 'boolean',
|
|
409
|
+
description: 'Set to true to resolve, false to unresolve (default: true)',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
required: ['slug', 'threadId'],
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: 'bulk_resolve_paper_threads',
|
|
417
|
+
description: `Resolve multiple comment threads on a paper at once. Use this after updating a paper to mark all addressed comments as resolved.
|
|
418
|
+
|
|
419
|
+
Typical workflow:
|
|
420
|
+
1. get_paper_comments - Retrieve comments
|
|
421
|
+
2. read_paper - Get latest content
|
|
422
|
+
3. update_paper - Apply changes addressing the comments
|
|
423
|
+
4. bulk_resolve_paper_threads - Resolve all addressed threads`,
|
|
424
|
+
inputSchema: {
|
|
425
|
+
type: 'object',
|
|
426
|
+
properties: {
|
|
427
|
+
slug: {
|
|
428
|
+
type: 'string',
|
|
429
|
+
description: 'The slug of the paper',
|
|
430
|
+
},
|
|
431
|
+
threadIds: {
|
|
432
|
+
type: 'array',
|
|
433
|
+
items: { type: 'string' },
|
|
434
|
+
description: 'Array of thread IDs to resolve',
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
required: ['slug', 'threadIds'],
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'list_paper_versions',
|
|
442
|
+
description: 'List the version history of a paper. Shows version numbers, dates, authors, and change summaries.',
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: 'object',
|
|
445
|
+
properties: {
|
|
446
|
+
slug: {
|
|
447
|
+
type: 'string',
|
|
448
|
+
description: 'The slug of the paper to list versions for',
|
|
449
|
+
},
|
|
450
|
+
page: {
|
|
451
|
+
type: 'number',
|
|
452
|
+
description: 'Page number (default: 1)',
|
|
453
|
+
},
|
|
454
|
+
limit: {
|
|
455
|
+
type: 'number',
|
|
456
|
+
description: 'Items per page (default: 20, max: 50)',
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
required: ['slug'],
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
name: 'read_paper_version',
|
|
464
|
+
description: 'Read the full content of a specific version of a paper. Use list_paper_versions first to see available versions.',
|
|
465
|
+
inputSchema: {
|
|
466
|
+
type: 'object',
|
|
467
|
+
properties: {
|
|
468
|
+
slug: {
|
|
469
|
+
type: 'string',
|
|
470
|
+
description: 'The slug of the paper',
|
|
471
|
+
},
|
|
472
|
+
version: {
|
|
473
|
+
type: 'string',
|
|
474
|
+
description: 'Version number (e.g. "3" or "v3") or version UUID',
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
required: ['slug', 'version'],
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: 'restore_paper_version',
|
|
482
|
+
description: 'Restore a paper to a previous version. A backup of the current content is automatically saved before restoring. Requires write permission.',
|
|
483
|
+
inputSchema: {
|
|
484
|
+
type: 'object',
|
|
485
|
+
properties: {
|
|
486
|
+
slug: {
|
|
487
|
+
type: 'string',
|
|
488
|
+
description: 'The slug of the paper',
|
|
489
|
+
},
|
|
490
|
+
version: {
|
|
491
|
+
type: 'string',
|
|
492
|
+
description: 'Version number (e.g. "3" or "v3") or version UUID',
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
required: ['slug', 'version'],
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: 'compile_paper',
|
|
500
|
+
description: `Compile a paper's LaTeX source using the server-side TeX Live engine and return the compilation log.
|
|
501
|
+
|
|
502
|
+
Use this to:
|
|
503
|
+
- Check if a paper compiles successfully after making changes
|
|
504
|
+
- Debug LaTeX errors by reading the compilation log
|
|
505
|
+
- Verify that packages like amsmath work correctly
|
|
506
|
+
|
|
507
|
+
Returns the exit code (0 = success), the full compilation log, and the PDF size if successful.`,
|
|
508
|
+
inputSchema: {
|
|
509
|
+
type: 'object',
|
|
510
|
+
properties: {
|
|
511
|
+
slug: {
|
|
512
|
+
type: 'string',
|
|
513
|
+
description: 'The slug of the paper to compile',
|
|
514
|
+
},
|
|
515
|
+
engine: {
|
|
516
|
+
type: 'string',
|
|
517
|
+
enum: ['pdflatex', 'xelatex'],
|
|
518
|
+
description: 'LaTeX engine to use (default: uses the paper\'s configured engine)',
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
required: ['slug'],
|
|
522
|
+
},
|
|
523
|
+
},
|
|
254
524
|
];
|
|
255
525
|
// Handle tool list requests
|
|
256
526
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
@@ -262,6 +532,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
262
532
|
try {
|
|
263
533
|
let result;
|
|
264
534
|
switch (name) {
|
|
535
|
+
// Note tools
|
|
265
536
|
case 'list_notes':
|
|
266
537
|
result = await listNotes(apiClient, listNotesSchema.parse(args || {}));
|
|
267
538
|
break;
|
|
@@ -295,6 +566,43 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
295
566
|
case 'restore_note_version':
|
|
296
567
|
result = await restoreVersion(apiClient, restoreVersionSchema.parse(args));
|
|
297
568
|
break;
|
|
569
|
+
// Paper tools
|
|
570
|
+
case 'list_papers':
|
|
571
|
+
result = await listPapers(apiClient, listPapersSchema.parse(args || {}));
|
|
572
|
+
break;
|
|
573
|
+
case 'read_paper':
|
|
574
|
+
result = await readPaper(apiClient, readPaperSchema.parse(args));
|
|
575
|
+
break;
|
|
576
|
+
case 'create_paper':
|
|
577
|
+
result = await createPaper(apiClient, createPaperSchema.parse(args), config.frontendUrl);
|
|
578
|
+
break;
|
|
579
|
+
case 'update_paper':
|
|
580
|
+
result = await updatePaper(apiClient, updatePaperSchema.parse(args));
|
|
581
|
+
break;
|
|
582
|
+
case 'delete_paper':
|
|
583
|
+
result = await deletePaper(apiClient, deletePaperSchema.parse(args));
|
|
584
|
+
break;
|
|
585
|
+
case 'get_paper_comments':
|
|
586
|
+
result = await getPaperComments(apiClient, getPaperCommentsSchema.parse(args));
|
|
587
|
+
break;
|
|
588
|
+
case 'resolve_paper_thread':
|
|
589
|
+
result = await resolvePaperThread(apiClient, resolvePaperThreadSchema.parse(args));
|
|
590
|
+
break;
|
|
591
|
+
case 'bulk_resolve_paper_threads':
|
|
592
|
+
result = await bulkResolvePaper(apiClient, bulkResolvePaperSchema.parse(args));
|
|
593
|
+
break;
|
|
594
|
+
case 'list_paper_versions':
|
|
595
|
+
result = await listPaperVersions(apiClient, listPaperVersionsSchema.parse(args));
|
|
596
|
+
break;
|
|
597
|
+
case 'read_paper_version':
|
|
598
|
+
result = await readPaperVersion(apiClient, readPaperVersionSchema.parse(args));
|
|
599
|
+
break;
|
|
600
|
+
case 'restore_paper_version':
|
|
601
|
+
result = await restorePaperVersion(apiClient, restorePaperVersionSchema.parse(args));
|
|
602
|
+
break;
|
|
603
|
+
case 'compile_paper':
|
|
604
|
+
result = await compilePaper(apiClient, compilePaperSchema.parse(args));
|
|
605
|
+
break;
|
|
298
606
|
default:
|
|
299
607
|
throw new Error(`Unknown tool: ${name}`);
|
|
300
608
|
}
|
|
@@ -310,17 +618,27 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
310
618
|
};
|
|
311
619
|
}
|
|
312
620
|
});
|
|
313
|
-
// Handle resource list requests (notes as resources)
|
|
621
|
+
// Handle resource list requests (notes + papers as resources)
|
|
314
622
|
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
315
623
|
try {
|
|
316
|
-
const
|
|
624
|
+
const [notesResponse, papersResponse] = await Promise.all([
|
|
625
|
+
apiClient.listNotes({ limit: 100 }),
|
|
626
|
+
apiClient.listPapers({ limit: 100 }),
|
|
627
|
+
]);
|
|
628
|
+
const noteResources = notesResponse.items.map((note) => ({
|
|
629
|
+
uri: `note://${note.slug}`,
|
|
630
|
+
name: note.slug,
|
|
631
|
+
description: `Note: ${note.slug} (${note.sharingMode})`,
|
|
632
|
+
mimeType: 'text/markdown',
|
|
633
|
+
}));
|
|
634
|
+
const paperResources = papersResponse.items.map((paper) => ({
|
|
635
|
+
uri: `paper://${paper.slug}`,
|
|
636
|
+
name: paper.slug,
|
|
637
|
+
description: `Paper: ${paper.slug} (${paper.sharingMode}, ${paper.metadata?.engine || 'pdflatex'})`,
|
|
638
|
+
mimeType: 'text/x-latex',
|
|
639
|
+
}));
|
|
317
640
|
return {
|
|
318
|
-
resources:
|
|
319
|
-
uri: `note://${note.slug}`,
|
|
320
|
-
name: note.slug,
|
|
321
|
-
description: `Note: ${note.slug} (${note.sharingMode})`,
|
|
322
|
-
mimeType: 'text/markdown',
|
|
323
|
-
})),
|
|
641
|
+
resources: [...noteResources, ...paperResources],
|
|
324
642
|
};
|
|
325
643
|
}
|
|
326
644
|
catch (error) {
|
|
@@ -330,20 +648,33 @@ server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
|
330
648
|
// Handle resource read requests
|
|
331
649
|
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
332
650
|
const { uri } = request.params;
|
|
333
|
-
if (
|
|
334
|
-
|
|
651
|
+
if (uri.startsWith('note://')) {
|
|
652
|
+
const slug = uri.replace('note://', '');
|
|
653
|
+
const note = await apiClient.getNoteBySlug(slug);
|
|
654
|
+
return {
|
|
655
|
+
contents: [
|
|
656
|
+
{
|
|
657
|
+
uri,
|
|
658
|
+
mimeType: 'text/markdown',
|
|
659
|
+
text: note.content || '',
|
|
660
|
+
},
|
|
661
|
+
],
|
|
662
|
+
};
|
|
335
663
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
664
|
+
if (uri.startsWith('paper://')) {
|
|
665
|
+
const slug = uri.replace('paper://', '');
|
|
666
|
+
const paper = await apiClient.getPaperBySlug(slug);
|
|
667
|
+
return {
|
|
668
|
+
contents: [
|
|
669
|
+
{
|
|
670
|
+
uri,
|
|
671
|
+
mimeType: 'text/x-latex',
|
|
672
|
+
text: paper.content || '',
|
|
673
|
+
},
|
|
674
|
+
],
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
throw new Error(`Unknown resource URI scheme: ${uri}`);
|
|
347
678
|
});
|
|
348
679
|
// Start the server
|
|
349
680
|
async function main() {
|