outline-mcp-server 5.0.0 → 5.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/README.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  A Model Context Protocol (MCP) server that provides tools for interacting with [Outline](https://www.getoutline.com/)'s API, enabling AI agents to manage documents, collections, and other entities programmatically through the Outline knowledge base platform.
4
4
 
5
- > **Upgrade Notice:**
6
-
7
- - v5 has introduced several breaking changes:
8
- - this server support for both `stdio` and `sse` transport interfaces. It now solely exposes a [Streamable HTTP endpoint](https://modelcontextprotocol.io/specification/draft/basic/transports#streamable-http) at the `/mcp` route. If you require sse/stdio, downgrade to v4
9
- - the `--port` CLI flag has been migrated to an environment variable, `OUTLINE_MCP_PORT`
5
+ ## 🚨 \***\*Upgrade Notice:\*\*** v5 has introduced several breaking changes: 🚨
6
+
7
+ - support has been dropped for the `stdio` transport interfaces.
8
+ - This server now exposes:
9
+ - a [Streamable-HTTP endpoint](https://modelcontextprotocol.io/specification/draft/basic/transports#streamable-http) at the `/mcp` route.
10
+ - an SSE endpoint at `/sse`
11
+ - If you require stdio, downgrade to v4
12
+ - the `--port` CLI flag has been migrated to an environment variable, `OUTLINE_MCP_PORT`
13
+ - Minimum node version has been bumped to 20
10
14
 
11
15
  ## Features
12
16
 
package/build/index.js CHANGED
@@ -1,11 +1,13 @@
1
+ #!/usr/bin/env bun
1
2
  import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
3
+ import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
2
4
  import fastify from 'fastify';
3
5
  import { getMcpServer } from './utils/getMcpServer.js';
4
- const server = fastify();
6
+ const app = fastify();
7
+ const mcpServer = await getMcpServer();
5
8
  // Stateless mode (default, recommended for most deployments)
6
- server.post('/mcp', async (request, reply) => {
9
+ app.post('/mcp', async (request, reply) => {
7
10
  try {
8
- const mcpServer = await getMcpServer();
9
11
  const httpTransport = new StreamableHTTPServerTransport({
10
12
  sessionIdGenerator: undefined,
11
13
  });
@@ -29,7 +31,7 @@ server.post('/mcp', async (request, reply) => {
29
31
  }
30
32
  }
31
33
  });
32
- server.get('/mcp', async (request, reply) => {
34
+ app.get('/mcp', async (request, reply) => {
33
35
  reply.code(405).send({
34
36
  jsonrpc: '2.0',
35
37
  error: {
@@ -39,7 +41,7 @@ server.get('/mcp', async (request, reply) => {
39
41
  id: null,
40
42
  });
41
43
  });
42
- server.delete('/mcp', async (request, reply) => {
44
+ app.delete('/mcp', async (request, reply) => {
43
45
  reply.code(405).send({
44
46
  jsonrpc: '2.0',
45
47
  error: {
@@ -49,8 +51,40 @@ server.delete('/mcp', async (request, reply) => {
49
51
  id: null,
50
52
  });
51
53
  });
54
+ // Legacy SSE endpoint for older clients
55
+ let sseTransport = null;
56
+ app.get('/sse', async (request, reply) => {
57
+ try {
58
+ // Create SSE transport for legacy clients
59
+ if (!sseTransport) {
60
+ sseTransport = new SSEServerTransport('/messages', reply.raw);
61
+ await mcpServer.connect(sseTransport);
62
+ }
63
+ }
64
+ catch (error) {
65
+ console.error(error);
66
+ if (!reply.sent) {
67
+ reply.code(500).send({
68
+ jsonrpc: '2.0',
69
+ error: {
70
+ code: -32603,
71
+ message: 'Internal server error',
72
+ },
73
+ id: null,
74
+ });
75
+ }
76
+ }
77
+ });
78
+ // Legacy message endpoint for older clients
79
+ app.post('/messages', async (req, res) => {
80
+ if (!sseTransport) {
81
+ res.status(400).send('No transport found');
82
+ return;
83
+ }
84
+ await sseTransport.handlePostMessage(req.raw, res.raw, req.body);
85
+ });
52
86
  const PORT = process.env.OUTLINE_MCP_PORT ? parseInt(process.env.OUTLINE_MCP_PORT, 10) : 6060;
53
- server.listen({ port: PORT }, (err, address) => {
87
+ app.listen({ port: PORT }, (err, address) => {
54
88
  if (err) {
55
89
  console.error(err);
56
90
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "outline-mcp-server",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "An MCP server for interacting with Outline's API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "prepare": "npm run build",
24
24
  "watch": "bun --watch src/index.ts",
25
25
  "dev": "concurrently -n 'build,inspector' -c 'blue.bold,green.bold' 'npm run watch' 'npm run inspector'",
26
- "inspector": "npx @modelcontextprotocol/inspector@latest -y",
26
+ "inspector": "npx @modelcontextprotocol/inspector@latest",
27
27
  "start": "bun build/index.js",
28
28
  "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"",
29
29
  "semantic-release": "semantic-release"