outline-mcp-server 4.2.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.
Files changed (54) hide show
  1. package/README.md +80 -0
  2. package/build/client.d.ts +8 -0
  3. package/build/client.d.ts.map +1 -0
  4. package/build/client.js +21 -0
  5. package/build/client.js.map +1 -0
  6. package/build/index.d.ts +11 -0
  7. package/build/index.d.ts.map +1 -0
  8. package/build/index.js +70 -0
  9. package/build/index.js.map +1 -0
  10. package/build/tools/createDocument.d.ts +2 -0
  11. package/build/tools/createDocument.d.ts.map +1 -0
  12. package/build/tools/createDocument.js +62 -0
  13. package/build/tools/createDocument.js.map +1 -0
  14. package/build/tools/deleteDocument.d.ts +2 -0
  15. package/build/tools/deleteDocument.d.ts.map +1 -0
  16. package/build/tools/deleteDocument.js +30 -0
  17. package/build/tools/deleteDocument.js.map +1 -0
  18. package/build/tools/getCollection.d.ts +2 -0
  19. package/build/tools/getCollection.d.ts.map +1 -0
  20. package/build/tools/getCollection.js +28 -0
  21. package/build/tools/getCollection.js.map +1 -0
  22. package/build/tools/getDocument.d.ts +2 -0
  23. package/build/tools/getDocument.d.ts.map +1 -0
  24. package/build/tools/getDocument.js +28 -0
  25. package/build/tools/getDocument.js.map +1 -0
  26. package/build/tools/listCollections.d.ts +2 -0
  27. package/build/tools/listCollections.d.ts.map +1 -0
  28. package/build/tools/listCollections.js +31 -0
  29. package/build/tools/listCollections.js.map +1 -0
  30. package/build/tools/listDocuments.d.ts +2 -0
  31. package/build/tools/listDocuments.d.ts.map +1 -0
  32. package/build/tools/listDocuments.js +45 -0
  33. package/build/tools/listDocuments.js.map +1 -0
  34. package/build/tools/listTeams.d.ts +2 -0
  35. package/build/tools/listTeams.d.ts.map +1 -0
  36. package/build/tools/listTeams.js +35 -0
  37. package/build/tools/listTeams.js.map +1 -0
  38. package/build/tools/searchDocuments.d.ts +2 -0
  39. package/build/tools/searchDocuments.d.ts.map +1 -0
  40. package/build/tools/searchDocuments.js +38 -0
  41. package/build/tools/searchDocuments.js.map +1 -0
  42. package/build/tools/updateDocument.d.ts +2 -0
  43. package/build/tools/updateDocument.d.ts.map +1 -0
  44. package/build/tools/updateDocument.js +59 -0
  45. package/build/tools/updateDocument.js.map +1 -0
  46. package/build/types.d.ts +64 -0
  47. package/build/types.d.ts.map +1 -0
  48. package/build/types.js +2 -0
  49. package/build/types.js.map +1 -0
  50. package/build/utils/listTools.d.ts +17 -0
  51. package/build/utils/listTools.d.ts.map +1 -0
  52. package/build/utils/listTools.js +21 -0
  53. package/build/utils/listTools.js.map +1 -0
  54. package/package.json +40 -0
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # Outline MCP Server
2
+
3
+ A Model Context Protocol (MCP) server that provides tools for interacting with Outline's API, enabling AI agents to manage documents, collections, and other entities programmatically through the Outline knowledge base platform.
4
+
5
+ ## Features
6
+
7
+ - **Document Management**
8
+ - Create new documents with customizable properties
9
+ - Get document details
10
+ - Update existing documents
11
+ - Delete documents
12
+ - List documents
13
+
14
+ - **Collection Management**
15
+ - Get collection details
16
+ - List collections
17
+ - Create and update collections
18
+
19
+ - **Team Management**
20
+ - List teams/groups
21
+ - Get team/group details
22
+
23
+ ## Prerequisites
24
+
25
+ - Node.js (v18 or higher)
26
+ - An Outline account with API access
27
+ - Outline API key with appropriate permissions
28
+
29
+ ## Quick Start
30
+
31
+ ### Installation
32
+
33
+ ```bash
34
+ # Install from npm
35
+ npm install -g outline-mcp
36
+
37
+ # Or run directly with npx
38
+ npx outline-mcp
39
+ ```
40
+
41
+ ### Setup
42
+
43
+ 1. Create a `.env` file with your Outline API key:
44
+
45
+ ```
46
+ OUTLINE_API_KEY=your_outline_api_key_here
47
+ OUTLINE_BASE_URL=https://your-outline-instance.com/api # Optional, defaults to https://app.getoutline.com/api
48
+ ```
49
+
50
+ ### Usage
51
+
52
+ Once installed, you can use the MCP server with AI assistants that support the Model Context Protocol, such as Claude via Cursor.
53
+
54
+ Example queries your AI assistant can now handle:
55
+
56
+ - "List all the documents in my Outline workspace"
57
+ - "Create a new document in the 'Product' collection"
58
+ - "Find all documents related to a specific topic"
59
+ - "Update the content of a document"
60
+
61
+ ## Development
62
+
63
+ ```bash
64
+ # Clone this repository
65
+ git clone https://github.com/mmmeff/outline-mcp.git
66
+ cd outline-mcp
67
+
68
+ # Install dependencies
69
+ npm install
70
+
71
+ # Run the project as an SSE server endpoint
72
+ npm run start
73
+
74
+ # Run the project as an stdio process
75
+ npm run start:stdio
76
+ ```
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,8 @@
1
+ export declare const outlineClient: import("axios").AxiosInstance;
2
+ export type OutlineUser = {
3
+ id: string;
4
+ name: string;
5
+ email: string;
6
+ avatarUrl?: string;
7
+ };
8
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,aAAa,+BAOxB,CAAC;AAGH,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import axios from "axios";
2
+ import { config } from "dotenv";
3
+ import { dirname, join } from "path";
4
+ import { fileURLToPath } from "url";
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ config({ path: join(__dirname, "..", ".env") });
7
+ const API_KEY = process.env.OUTLINE_API_KEY;
8
+ const API_URL = process.env.OUTLINE_API_URL || "https://app.getoutline.com/api";
9
+ if (!API_KEY) {
10
+ throw new Error("OUTLINE_API_KEY environment variable is required");
11
+ }
12
+ // Create axios client with authentication
13
+ export const outlineClient = axios.create({
14
+ baseURL: API_URL,
15
+ headers: {
16
+ Authorization: `Bearer ${API_KEY}`,
17
+ "Content-Type": "application/json",
18
+ Accept: "application/json",
19
+ },
20
+ });
21
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAEhD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,gCAAgC,CAAC;AAEhF,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC;AAED,0CAA0C;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,aAAa,EAAE,UAAU,OAAO,EAAE;QAClC,cAAc,EAAE,kBAAkB;QAClC,MAAM,EAAE,kBAAkB;KAC3B;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import "./tools/createDocument.js";
3
+ import "./tools/deleteDocument.js";
4
+ import "./tools/getCollection.js";
5
+ import "./tools/getDocument.js";
6
+ import "./tools/listCollections.js";
7
+ import "./tools/listDocuments.js";
8
+ import "./tools/listTeams.js";
9
+ import "./tools/searchDocuments.js";
10
+ import "./tools/updateDocument.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAeA,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,4BAA4B,CAAC;AACpC,OAAO,2BAA2B,CAAC"}
package/build/index.js ADDED
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
5
+ // Import tool definitions utility
6
+ import { getToolDefinitions, getToolHandlers } from "./utils/listTools.js";
7
+ // Import all handlers to ensure tool definitions are registered
8
+ import "./tools/createDocument.js";
9
+ import "./tools/deleteDocument.js";
10
+ import "./tools/getCollection.js";
11
+ import "./tools/getDocument.js";
12
+ import "./tools/listCollections.js";
13
+ import "./tools/listDocuments.js";
14
+ import "./tools/listTeams.js";
15
+ import "./tools/searchDocuments.js";
16
+ import "./tools/updateDocument.js";
17
+ // Build the capabilities object dynamically from registered tools
18
+ const toolsCapabilities = {};
19
+ getToolDefinitions().forEach(tool => {
20
+ toolsCapabilities[tool.name] = true;
21
+ });
22
+ // Get the tool handlers
23
+ const toolHandlers = getToolHandlers();
24
+ const server = new Server({
25
+ name: "outline-mcp",
26
+ version: "1.0.0",
27
+ }, {
28
+ capabilities: {
29
+ tools: toolsCapabilities,
30
+ },
31
+ });
32
+ // Register request handlers
33
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
34
+ tools: getToolDefinitions()
35
+ }));
36
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
37
+ const { params } = request;
38
+ const tool = params.name;
39
+ const parameters = params.arguments || {};
40
+ try {
41
+ // Check if the tool is supported in our capabilities
42
+ if (!toolsCapabilities[tool]) {
43
+ return { error: { code: ErrorCode.InvalidRequest, message: `Tool ${tool} not supported` } };
44
+ }
45
+ // Get the handler for this tool
46
+ const handler = toolHandlers[tool];
47
+ if (!handler) {
48
+ return { error: { code: ErrorCode.InvalidRequest, message: `No handler found for tool ${tool}` } };
49
+ }
50
+ // Call the handler with the provided parameters
51
+ const result = await handler(parameters);
52
+ return { result };
53
+ }
54
+ catch (error) {
55
+ if (error instanceof McpError) {
56
+ return { error: { code: error.code, message: error.message } };
57
+ }
58
+ return { error: { code: ErrorCode.InternalError, message: error.message } };
59
+ }
60
+ });
61
+ async function main() {
62
+ const transport = new StdioServerTransport();
63
+ await server.connect(transport);
64
+ console.error("Outline MCP server running on stdio");
65
+ }
66
+ main().catch((error) => {
67
+ console.error("Server error:", error);
68
+ process.exit(1);
69
+ });
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAE5C,kCAAkC;AAClC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE3E,gEAAgE;AAChE,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,4BAA4B,CAAC;AACpC,OAAO,2BAA2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BAA6B,IAAI,EAAE,EAAE,EAAE,CAAC;QACrG,CAAC;QAED,gDAAgD;QAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;QACzC,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACjE,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,aAAa,EAAE,OAAO,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,CAAC;IACzF,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AACvD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDocument.d.ts","sourceRoot":"","sources":["../../src/tools/createDocument.ts"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "create_document",
7
+ description: "Create a new document",
8
+ inputSchema: {
9
+ properties: {
10
+ title: {
11
+ type: "string",
12
+ description: "Title of the document"
13
+ },
14
+ text: {
15
+ type: "string",
16
+ description: "Content of the document in markdown format"
17
+ },
18
+ collectionId: {
19
+ type: "string",
20
+ description: "ID of the collection to add the document to"
21
+ },
22
+ parentDocumentId: {
23
+ type: "string",
24
+ description: "ID of the parent document (if creating a nested document)"
25
+ },
26
+ publish: {
27
+ type: "boolean",
28
+ description: "Whether to publish the document immediately"
29
+ },
30
+ template: {
31
+ type: "boolean",
32
+ description: "Whether this document is a template"
33
+ },
34
+ },
35
+ required: ["title", "text", "collectionId"],
36
+ type: "object",
37
+ },
38
+ }, async function handleCreateDocument(args) {
39
+ try {
40
+ const payload = {
41
+ title: args.title,
42
+ text: args.text,
43
+ collectionId: args.collectionId,
44
+ };
45
+ if (args.parentDocumentId) {
46
+ payload.parentDocumentId = args.parentDocumentId;
47
+ }
48
+ if (args.publish !== undefined) {
49
+ payload.publish = args.publish;
50
+ }
51
+ if (args.template !== undefined) {
52
+ payload.template = args.template;
53
+ }
54
+ const response = await outlineClient.post('/documents', payload);
55
+ return response.data.data;
56
+ }
57
+ catch (error) {
58
+ console.error('Error creating document:', error.message);
59
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
60
+ }
61
+ });
62
+ //# sourceMappingURL=createDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDocument.js","sourceRoot":"","sources":["../../src/tools/createDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE;QACX,UAAU,EAAE;YACV,KAAK,EAA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CAAC;IAC5B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=deleteDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteDocument.d.ts","sourceRoot":"","sources":["../../src/tools/deleteDocument.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "delete_document",
7
+ description: "Delete a document",
8
+ inputSchema: {
9
+ properties: {
10
+ documentId: {
11
+ type: "string",
12
+ description: "ID of the document to delete"
13
+ },
14
+ },
15
+ required: ["documentId"],
16
+ type: "object",
17
+ },
18
+ }, async function handleDeleteDocument(args) {
19
+ try {
20
+ const response = await outlineClient.post(`/documents.delete`, {
21
+ id: args.documentId
22
+ });
23
+ return { success: response.status === 200 };
24
+ }
25
+ catch (error) {
26
+ console.error('Error deleting document:', error.message);
27
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
28
+ }
29
+ });
30
+ //# sourceMappingURL=deleteDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteDocument.js","sourceRoot":"","sources":["../../src/tools/deleteDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE;QACX,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;aAC5C;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,oBAAoB,CAAC,IAAwB;IAC7D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC7D,EAAE,EAAE,IAAI,CAAC,UAAU;SACpB,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCollection.d.ts","sourceRoot":"","sources":["../../src/tools/getCollection.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "get_collection",
7
+ description: "Get details about a specific collection",
8
+ inputSchema: {
9
+ properties: {
10
+ collectionId: {
11
+ type: "string",
12
+ description: "ID of the collection to retrieve"
13
+ },
14
+ },
15
+ required: ["collectionId"],
16
+ type: "object",
17
+ },
18
+ }, async function handleGetCollection(args) {
19
+ try {
20
+ const response = await outlineClient.get(`/collections/${args.collectionId}`);
21
+ return response.data.data;
22
+ }
23
+ catch (error) {
24
+ console.error('Error getting collection:', error.message);
25
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
26
+ }
27
+ });
28
+ //# sourceMappingURL=getCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCollection.js","sourceRoot":"","sources":["../../src/tools/getCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,yCAAyC;IACtD,WAAW,EAAE;QACX,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kCAAkC;aAChD;SACF;QACD,QAAQ,EAAE,CAAC,cAAc,CAAC;QAC1B,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,mBAAmB,CAAC,IAAuB;IAC3D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAC9E,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDocument.d.ts","sourceRoot":"","sources":["../../src/tools/getDocument.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "get_document",
7
+ description: "Get details about a specific document",
8
+ inputSchema: {
9
+ properties: {
10
+ documentId: {
11
+ type: "string",
12
+ description: "ID of the document to retrieve"
13
+ },
14
+ },
15
+ required: ["documentId"],
16
+ type: "object",
17
+ },
18
+ }, async function handleGetDocument(args) {
19
+ try {
20
+ const response = await outlineClient.get(`/documents/${args.documentId}`);
21
+ return response.data.data;
22
+ }
23
+ catch (error) {
24
+ console.error('Error getting document:', error.message);
25
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
26
+ }
27
+ });
28
+ //# sourceMappingURL=getDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDocument.js","sourceRoot":"","sources":["../../src/tools/getDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE;QACX,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,iBAAiB,CAAC,IAAqB;IACvD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listCollections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listCollections.d.ts","sourceRoot":"","sources":["../../src/tools/listCollections.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "list_collections",
7
+ description: "List all collections in the Outline workspace",
8
+ inputSchema: {
9
+ properties: {
10
+ limit: {
11
+ type: "number",
12
+ description: "Maximum number of collections to return (optional)"
13
+ },
14
+ },
15
+ type: "object",
16
+ },
17
+ }, async function handleListCollections(args) {
18
+ try {
19
+ const params = {};
20
+ if (args.limit) {
21
+ params.limit = args.limit;
22
+ }
23
+ const response = await outlineClient.get('/collections.list', { params });
24
+ return response.data.data || [];
25
+ }
26
+ catch (error) {
27
+ console.error('Error listing collections:', error.message);
28
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
29
+ }
30
+ });
31
+ //# sourceMappingURL=listCollections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listCollections.js","sourceRoot":"","sources":["../../src/tools/listCollections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,+CAA+C;IAC5D,WAAW,EAAE;QACX,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;aAClE;SACF;QACD,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,qBAAqB,CAAC,IAAyB;IAC/D,IAAI,CAAC;QACH,MAAM,MAAM,GAAwB,EAAE,CAAC;QAEvC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAClC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listDocuments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listDocuments.d.ts","sourceRoot":"","sources":["../../src/tools/listDocuments.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "list_documents",
7
+ description: "List documents in the Outline workspace with optional filters",
8
+ inputSchema: {
9
+ properties: {
10
+ collectionId: {
11
+ type: "string",
12
+ description: "Filter by collection ID (optional)"
13
+ },
14
+ query: {
15
+ type: "string",
16
+ description: "Search query to filter documents (optional)"
17
+ },
18
+ limit: {
19
+ type: "number",
20
+ description: "Maximum number of documents to return (optional)"
21
+ },
22
+ },
23
+ type: "object",
24
+ },
25
+ }, async function handleListDocuments(args) {
26
+ try {
27
+ const params = {};
28
+ if (args.collectionId) {
29
+ params.collectionId = args.collectionId;
30
+ }
31
+ if (args.query) {
32
+ params.query = args.query;
33
+ }
34
+ if (args.limit) {
35
+ params.limit = args.limit;
36
+ }
37
+ const response = await outlineClient.get('/documents', { params });
38
+ return response.data.data || [];
39
+ }
40
+ catch (error) {
41
+ console.error('Error listing documents:', error.message);
42
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
43
+ }
44
+ });
45
+ //# sourceMappingURL=listDocuments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listDocuments.js","sourceRoot":"","sources":["../../src/tools/listDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,+DAA+D;IAC5E,WAAW,EAAE;QACX,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oCAAoC;aAClD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;SACF;QACD,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,mBAAmB,CAAC,IAAuB;IAC3D,IAAI,CAAC;QACH,MAAM,MAAM,GAAwB,EAAE,CAAC;QAEvC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACnE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAClC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=listTeams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTeams.d.ts","sourceRoot":"","sources":["../../src/tools/listTeams.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "list_teams",
7
+ description: "List all teams in the workspace",
8
+ inputSchema: {
9
+ properties: {
10
+ random_string: {
11
+ type: "string",
12
+ description: "Dummy parameter for no-parameter tools"
13
+ },
14
+ },
15
+ required: ["random_string"],
16
+ type: "object",
17
+ },
18
+ }, async function handleListTeams(args) {
19
+ try {
20
+ const response = await outlineClient.get('/collections.list');
21
+ // Outline doesn't have teams, but we'll use collections as a proxy
22
+ // Transform the data to match a teams-like schema
23
+ const collections = response.data.data || [];
24
+ return collections.map((collection) => ({
25
+ id: collection.id,
26
+ name: collection.name,
27
+ description: collection.description,
28
+ }));
29
+ }
30
+ catch (error) {
31
+ console.error('Error listing teams:', error.message);
32
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
33
+ }
34
+ });
35
+ //# sourceMappingURL=listTeams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTeams.js","sourceRoot":"","sources":["../../src/tools/listTeams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAqB;AACrB,YAAY,CAAC;IACX,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,iCAAiC;IAC9C,WAAW,EAAE;QACX,UAAU,EAAE;YACV,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wCAAwC;aACtD;SACF;QACD,QAAQ,EAAE,CAAC,eAAe,CAAC;QAC3B,IAAI,EAAE,QAAQ;KACf;CACF,EAAE,KAAK,UAAU,eAAe,CAAC,IAAmB;IACnD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAE9D,mEAAmE;QACnE,kDAAkD;QAClD,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC7C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,UAAe,EAAE,EAAE,CAAC,CAAC;YAC3C,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,WAAW,EAAE,UAAU,CAAC,WAAW;SACpC,CAAC,CAAC,CAAC;IACN,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACrD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=searchDocuments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchDocuments.d.ts","sourceRoot":"","sources":["../../src/tools/searchDocuments.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "search_documents",
7
+ description: "Search for documents in the Outline workspace",
8
+ inputSchema: {
9
+ properties: {
10
+ query: {
11
+ type: "string",
12
+ description: "Search query to filter documents"
13
+ },
14
+ limit: {
15
+ type: "number",
16
+ description: "Maximum number of documents to return (optional)"
17
+ },
18
+ },
19
+ required: ["query"],
20
+ type: "object",
21
+ },
22
+ }, async function handleSearchDocuments(args) {
23
+ try {
24
+ const params = {
25
+ query: args.query
26
+ };
27
+ if (args.limit) {
28
+ params.limit = args.limit;
29
+ }
30
+ const response = await outlineClient.get('/documents.search', { params });
31
+ return response.data.data || [];
32
+ }
33
+ catch (error) {
34
+ console.error('Error searching documents:', error.message);
35
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
36
+ }
37
+ });
38
+ //# sourceMappingURL=searchDocuments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchDocuments.js","sourceRoot":"","s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ingURL=updateDocument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateDocument.d.ts","sourceRoot":"","sources":["../../src/tools/updateDocument.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
2
+ import { outlineClient } from "../client.js";
3
+ import { registerTool } from "../utils/listTools.js";
4
+ // Register this tool
5
+ registerTool({
6
+ name: "update_document",
7
+ description: "Update an existing document",
8
+ inputSchema: {
9
+ properties: {
10
+ documentId: {
11
+ type: "string",
12
+ description: "ID of the document to update"
13
+ },
14
+ title: {
15
+ type: "string",
16
+ description: "New title for the document"
17
+ },
18
+ text: {
19
+ type: "string",
20
+ description: "New content for the document in markdown format"
21
+ },
22
+ publish: {
23
+ type: "boolean",
24
+ description: "Whether to publish the document"
25
+ },
26
+ done: {
27
+ type: "boolean",
28
+ description: "Whether the document is marked as done"
29
+ },
30
+ },
31
+ required: ["documentId"],
32
+ type: "object",
33
+ },
34
+ }, async function handleUpdateDocument(args) {
35
+ try {
36
+ const payload = {
37
+ id: args.documentId
38
+ };
39
+ if (args.title !== undefined) {
40
+ payload.title = args.title;
41
+ }
42
+ if (args.text !== undefined) {
43
+ payload.text = args.text;
44
+ }
45
+ if (args.publish !== undefined) {
46
+ payload.publish = args.publish;
47
+ }
48
+ if (args.done !== undefined) {
49
+ payload.done = args.done;
50
+ }
51
+ const response = await outlineClient.post('/documents.update', payload);
52
+ return response.data.data;
53
+ }
54
+ catch (error) {
55
+ console.error('Error updating document:', error.message);
56
+ throw new McpError(ErrorCode.InvalidRequest, error.message);
57
+ }
58
+ });
59
+ //# sourceMappingURL=updateDocument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateDocument.js","sourceRoot":"","sources":["../../src/tools/updateDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAA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IAAI,CAAC;QAC3B,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ export type Collection = {
2
+ id: string;
3
+ name: string;
4
+ description?: string;
5
+ icon?: string;
6
+ };
7
+ export type Document = {
8
+ id: string;
9
+ title: string;
10
+ text: string;
11
+ emoji?: string;
12
+ collectionId: string;
13
+ parentDocumentId?: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ publishedAt?: string;
17
+ url: string;
18
+ };
19
+ export type Team = {
20
+ id: string;
21
+ name: string;
22
+ avatarUrl?: string;
23
+ };
24
+ export type ListDocumentsArgs = {
25
+ collectionId?: string;
26
+ query?: string;
27
+ limit?: number;
28
+ };
29
+ export type GetDocumentArgs = {
30
+ documentId: string;
31
+ };
32
+ export type CreateDocumentArgs = {
33
+ title: string;
34
+ text: string;
35
+ collectionId: string;
36
+ parentDocumentId?: string;
37
+ publish?: boolean;
38
+ template?: boolean;
39
+ };
40
+ export type UpdateDocumentArgs = {
41
+ documentId: string;
42
+ title?: string;
43
+ text?: string;
44
+ publish?: boolean;
45
+ done?: boolean;
46
+ };
47
+ export type DeleteDocumentArgs = {
48
+ documentId: string;
49
+ };
50
+ export type ListCollectionsArgs = {
51
+ limit?: number;
52
+ };
53
+ export type GetCollectionArgs = {
54
+ collectionId: string;
55
+ };
56
+ export type ListTeamsArgs = {
57
+ limit?: number;
58
+ };
59
+ export type SearchDocumentsArgs = {
60
+ query: string;
61
+ collectionId?: string;
62
+ limit?: number;
63
+ };
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Utility to collect tool definitions from handler modules
3
+ */
4
+ export interface ToolDefinition {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ properties: Record<string, any>;
9
+ required?: string[];
10
+ type: string;
11
+ };
12
+ }
13
+ export type ToolHandler = (args: any) => Promise<any>;
14
+ export declare function registerTool(definition: ToolDefinition, handler: ToolHandler): void;
15
+ export declare function getToolDefinitions(): ToolDefinition[];
16
+ export declare function getToolHandlers(): Record<string, ToolHandler>;
17
+ //# sourceMappingURL=listTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTools.d.ts","sourceRoot":"","sources":["../../src/utils/listTools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAGD,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAStD,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAGnF;AAGD,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAErD;AAGD,wBAAgB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAE7D"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Utility to collect tool definitions from handler modules
3
+ */
4
+ // We'll collect all tool definitions here
5
+ const toolDefinitions = [];
6
+ // Map of tool names to handler functions
7
+ const toolHandlers = {};
8
+ // Function to register a tool definition
9
+ export function registerTool(definition, handler) {
10
+ toolDefinitions.push(definition);
11
+ toolHandlers[definition.name] = handler;
12
+ }
13
+ // Function to get all registered tool definitions
14
+ export function getToolDefinitions() {
15
+ return toolDefinitions;
16
+ }
17
+ // Function to get all registered tool handlers
18
+ export function getToolHandlers() {
19
+ return toolHandlers;
20
+ }
21
+ //# sourceMappingURL=listTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTools.js","sourceRoot":"","sources":["../../src/utils/listTools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,0CAA0C;AAC1C,MAAM,eAAe,GAAqB,EAAE,CAAC;AAE7C,yCAAyC;AACzC,MAAM,YAAY,GAAgC,EAAE,CAAC;AAErD,yCAAyC;AACzC,MAAM,UAAU,YAAY,CAAC,UAA0B,EAAE,OAAoB;IAC3E,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;AAC1C,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,kBAAkB;IAChC,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,eAAe;IAC7B,OAAO,YAAY,CAAC;AACtB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "outline-mcp-server",
3
+ "version": "4.2.0",
4
+ "description": "An MCP server for interacting with Outline's API",
5
+ "type": "module",
6
+ "bin": {
7
+ "outline-mcp-server": "npm run start"
8
+ },
9
+ "files": [
10
+ "build"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc && chmod +x build/index.js",
14
+ "prepare": "npm run build",
15
+ "watch": "tsc --watch",
16
+ "inspector": "npx @modelcontextprotocol/inspector build/index.js",
17
+ "dev": "npm run build && npm run start",
18
+ "start:stdio": "npm run build && echo 'build done. running...\n' &&node build/index.js",
19
+ "start": "npx -y supergateway --port 6060 --stdio \"npm run start:stdio\""
20
+ },
21
+ "dependencies": {
22
+ "@modelcontextprotocol/sdk": "0.6.0",
23
+ "axios": "^1.6.0",
24
+ "dotenv": "16.4.7"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "^20.11.24",
28
+ "typescript": "^5.3.3"
29
+ },
30
+ "keywords": [
31
+ "outline",
32
+ "mcp",
33
+ "getoutline.com",
34
+ "model-context-protocol"
35
+ ],
36
+ "license": "MIT",
37
+ "engines": {
38
+ "node": ">=18"
39
+ }
40
+ }