outline-mcp-server 5.6.0 → 5.6.2
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.
|
@@ -7,7 +7,6 @@ toolRegistry.register('list_documents', {
|
|
|
7
7
|
name: 'list_documents',
|
|
8
8
|
description: 'List documents in the Outline workspace with optional filters',
|
|
9
9
|
inputSchema: {
|
|
10
|
-
query: z.string().describe('Search query to filter documents'),
|
|
11
10
|
collectionId: z.string().describe('Filter by collection ID (optional)').optional(),
|
|
12
11
|
limit: z.number().describe('Maximum number of documents to return (optional)').optional(),
|
|
13
12
|
offset: z.number().describe('Pagination offset (optional)').optional(),
|
|
@@ -35,18 +34,26 @@ toolRegistry.register('list_documents', {
|
|
|
35
34
|
limit: args.limit || 25,
|
|
36
35
|
sort: args.sort || 'updatedAt',
|
|
37
36
|
direction: args.direction || 'DESC',
|
|
38
|
-
collectionId: args.collectionId || '',
|
|
39
|
-
userId: args.userId || '',
|
|
40
|
-
backlinkDocumentId: args.backlinkDocumentId || '',
|
|
41
|
-
parentDocumentId: args.parentDocumentId || '',
|
|
42
37
|
};
|
|
43
38
|
// Only add template if it's explicitly defined
|
|
44
39
|
if (args.template !== undefined) {
|
|
45
40
|
payload.template = args.template;
|
|
46
41
|
}
|
|
47
|
-
// Only add
|
|
48
|
-
if (args.
|
|
49
|
-
payload.
|
|
42
|
+
// Only add collectionId if it's provided
|
|
43
|
+
if (args.collectionId) {
|
|
44
|
+
payload.collectionId = args.collectionId;
|
|
45
|
+
}
|
|
46
|
+
// Only add userId if it's provided
|
|
47
|
+
if (args.userId) {
|
|
48
|
+
payload.userId = args.userId;
|
|
49
|
+
}
|
|
50
|
+
// Only add backlinkDocumentId if it's provided
|
|
51
|
+
if (args.backlinkDocumentId) {
|
|
52
|
+
payload.backlinkDocumentId = args.backlinkDocumentId;
|
|
53
|
+
}
|
|
54
|
+
// Only add parentDocumentId if it's provided
|
|
55
|
+
if (args.parentDocumentId) {
|
|
56
|
+
payload.parentDocumentId = args.parentDocumentId;
|
|
50
57
|
}
|
|
51
58
|
// Make the POST request to the documents.list endpoint
|
|
52
59
|
const client = getOutlineClient();
|
|
@@ -7,10 +7,12 @@ export async function getMcpServer() {
|
|
|
7
7
|
version: process.env.npm_package_version || 'unknown',
|
|
8
8
|
description: 'Outline Model Context Protocol server',
|
|
9
9
|
});
|
|
10
|
-
await loadAllTools(tool =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
await loadAllTools((tool) => {
|
|
11
|
+
server.registerTool(tool.name, {
|
|
12
|
+
description: tool.description,
|
|
13
|
+
inputSchema: tool.inputSchema,
|
|
14
|
+
outputSchema: tool.outputSchema,
|
|
15
|
+
}, tool.callback);
|
|
16
|
+
});
|
|
15
17
|
return server;
|
|
16
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
4
|
import toolRegistry from './toolRegistry.js';
|
|
5
5
|
/**
|
|
6
6
|
* Dynamically imports all tool files from the tools directory
|
|
@@ -14,10 +14,12 @@ export async function loadAllTools(onToolLoaded) {
|
|
|
14
14
|
const toolFiles = fs
|
|
15
15
|
.readdirSync(toolsDir)
|
|
16
16
|
.filter(file => file.endsWith('.ts') || file.endsWith('.js'));
|
|
17
|
-
// Import all tool files, causing them to be
|
|
17
|
+
// Import all tool files, causing them to be registered via `registerTool`
|
|
18
18
|
for (const file of toolFiles) {
|
|
19
19
|
const resolved = path.resolve(toolsDir, file);
|
|
20
|
-
|
|
20
|
+
// Convert path to file:// URL for cross-platform ESM compatibility
|
|
21
|
+
const fileURL = pathToFileURL(resolved).href;
|
|
22
|
+
await import(fileURL);
|
|
21
23
|
}
|
|
22
24
|
// configure McpServer with all definitions
|
|
23
25
|
for (const tool of toolRegistry.tools) {
|