Skip to content

gallis-local/mcp-outline

Repository files navigation

MCP Outline Server

A Model Context Protocol (MCP) server enabling AI assistants to interact with Outline (https://www.getoutline.com)

Overview

This project implements a Model Context Protocol (MCP) server that allows AI assistants (like Claude) to interact with Outline document services, providing a bridge between natural language interactions and Outline's document management capabilities.

Features

Currently implemented:

Document Management

  • Document Search: Search for documents by keywords across content and titles
  • Document Reading: Read document content and export as markdown
  • Document Creation: Create new documents in collections
  • Document Editing: Update document content and move documents
  • Document Import: Import external content (markdown, text, HTML) as new documents

Document History & Versioning

  • Revision Tracking: List and retrieve specific document revisions
  • Revision Comparison: Compare document versions with detailed change analysis
  • Revision Analytics: Analyze revision history patterns and contributor activity
  • Metadata Enrichment: Enhanced revision information with statistics and timestamps

Collection Management

  • Collection Operations: List collections, view document structure, create/update/delete collections
  • Collection Export: Export collections in multiple formats (markdown, JSON, HTML)

User Activity & Drafts

  • Draft Management: List and manage draft documents
  • Activity Tracking: View recently viewed documents
  • Collaboration Features: View and add comments, manage document backlinks

AI Integration

  • Natural Language Q&A: Ask questions about document content with AI-powered responses

Add to Cursor with Docker

We recommend running this python MCP server using Docker to avoid having to install dependencies on your machine.

  1. Install and run Docker (or Docker Desktop)
  2. Build the Docker image docker buildx build -t mcp-outline .
  3. In Cursor, go to the "MCP Servers" tab and click "Add Server"
    {
      "mcpServers": {
        "mcp-outline": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "--init",
            "-e",
            "DOCKER_CONTAINER=true",
            "-e",
            "OUTLINE_API_KEY",
            "-e",
            "OUTLINE_API_URL",
            "mcp-outline"
          ],
          "env": {
            "OUTLINE_API_KEY": "<YOUR_OUTLINE_API_KEY>",
            "OUTLINE_API_URL": "<YOUR_OUTLINE_API_URL>",
            "MCP_TRANSPORT": "stdio"
          }
        }
      }
    }

    OUTLINE_API_URL is optional, defaulting to https://app.getoutline.com/api

  4. Debug the docker image by using MCP inspector and passing the docker image to it:
    npx @modelcontextprotocol/inspector docker run -i --rm --init -e DOCKER_CONTAINER=true --env-file .env mcp-outline

Development

Prerequisites

  • Python 3.10+
  • Outline account with API access
  • Outline API key (get this from your Outline account settings)

Installation

# Clone the repository
git clone https://github.com/Vortiago/mcp-outline.git
cd mcp-outline

# Install in development mode
uv pip install -e ".[dev]"

Configuration

Create a .env file in the project root with the following variables:

# Outline API Configuration
OUTLINE_API_KEY=your_outline_api_key_here

# For cloud-hosted Outline (default)
# OUTLINE_API_URL=https://app.getoutline.com/api

# For self-hosted Outline
# OUTLINE_API_URL=https://your-outline-instance.example.com/api

Running the Server

# Development mode with the MCP Inspector
mcp dev src/mcp_outline/server.py

# Or use the provided script
./start_server.sh

# Install in Claude Desktop (if available)
mcp install src/mcp_outline/server.py --name "Document Outline Assistant"

Transport Mode Configuration

The MCP Outline server supports two transport modes:

  • stdio (default): Standard input/output for direct process communication
  • sse: HTTP Server-Sent Events for web-based communication

Configuring Transport Mode

Set the MCP_TRANSPORT environment variable to choose your transport mode:

# For stdio mode (default - backward compatible)
export MCP_TRANSPORT=stdio
mcp-outline

# For HTTP/SSE mode (useful for Docker deployments)
export MCP_TRANSPORT=sse
mcp-outline

Docker HTTP Transport

For Docker deployments, use SSE transport to enable HTTP endpoints:

environment:
  - MCP_TRANSPORT=sse  # Enables HTTP transport on port 3001
  - OUTLINE_API_KEY=your_api_key
  - OUTLINE_API_URL=https://your-outline-instance.com/api

When using MCP_TRANSPORT=sse, the server will start on port 3001 with the following endpoints:

  • /sse - Server-Sent Events endpoint for MCP communication
  • /messages/ - HTTP message endpoint (requires session_id parameter)

When running the MCP Inspector, go to Tools > Click on a tool > it appears on the right side so that you can query it. MCP Inspector

Available Tools

Document Search & Discovery

  • search_documents: Search for documents by keywords across content and titles
  • list_collections: List all available collections in the workspace
  • get_collection_structure: View hierarchical document structure within a collection
  • get_document_id_from_title: Find document ID by searching for its title

Document Content Management

  • read_document: Retrieve and display full document content
  • export_document: Export document content as plain markdown
  • create_document: Create new documents in specified collections
  • update_document: Modify existing document content
  • move_document: Move documents between collections

Document History & Versioning

  • get_document_revision: Retrieve specific document revision by ID (with caching)
  • get_document_revision_with_metadata: Get revision with enriched statistics
  • list_document_revisions: List all revisions for a document (supports pagination)
  • compare_document_revisions: Compare two revisions with detailed change analysis
  • get_revision_history_summary: Analyze revision patterns and contributor activity

Document Import & Activity

  • import_document: Import external content (markdown, text, HTML) as new documents
  • import_document_from_file_content: Auto-detect format and import from file content
  • list_draft_documents: List draft documents for the current user
  • get_recently_viewed_documents: Get recently viewed documents

Collection Management

  • create_collection: Create new collections for organizing documents
  • update_collection: Modify collection properties (name, description, color)
  • delete_collection: Remove collections and all contained documents
  • export_collection: Export entire collections to downloadable files
  • export_all_collections: Export all workspace content

Document Lifecycle

  • archive_document: Archive documents without deleting
  • unarchive_document: Restore archived documents
  • list_trash: View documents in trash
  • restore_document: Restore documents from trash
  • permanently_delete_document: Permanently remove documents

Collaboration Features

  • list_document_comments: View all comments on a document
  • get_comment: Retrieve specific comment details
  • add_comment: Add comments to documents
  • get_document_backlinks: Find documents that link to a specific document

AI-Powered Features

  • ask_ai_about_documents: Ask natural language questions about document content with AI-powered responses

Advanced Features

  • Caching: Frequently accessed revisions are cached for improved performance
  • Pagination: Large result sets support offset/limit pagination
  • Format Validation: Import tools validate file formats and content
  • Error Handling: Comprehensive error messages for troubleshooting
  • Performance: Optimized for large document repositories and revision histories

Usage Examples

Search for Documents

Search for documents containing "project planning"

List Collections

Show me all available collections

Read a Document

Get the content of document with ID "docId123"

Create a New Document

Create a new document titled "Research Report" in collection "colId456" with content "# Introduction\n\nThis is a research report..."

Document Revision Management

List all revisions for document "docId123"
Compare revisions "rev001" and "rev002" and show me the differences
Get a summary of revision history for document "docId123"

Import External Content

Import this markdown content as a new document titled "Imported Guide" in collection "colId456"
Import the content from file "README.md" as a new document

Draft and Activity Management

Show me my draft documents
List the documents I've recently viewed

Add a Comment

Add a comment to document "docId123" saying "This looks great, but we should add more details to the methodology section."

Move a Document

Move document "docId123" to collection "colId789"

Collection Export

Export collection "colId456" as markdown format

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Automated versioning and releases

This project uses semantic versioning with conventional commits for automatic version management and Docker image tagging, supporting both stable releases and release candidates.

How it works

  • Conventional Commits: All commits must follow the Conventional Commits specification
  • Dual Branch Strategy: Automatic versioning works on both main (stable) and rc (release candidate) branches:
    • Main branch: Creates stable releases (e.g., v1.2.3) and tags Docker images with latest + version
    • RC branch: Creates pre-releases (e.g., v1.2.3-rc.1) and tags Docker images with rc + version
  • Version Bump Rules: Semantic-release analyzes commits and determines version bumps:
    • Major: commits with BREAKING CHANGE in body or ! suffix (e.g., feat!: ...)
    • Minor: commits starting with feat:
    • Patch: commits starting with fix:
    • No bump: commits starting with docs:, chore:, style:, test:, etc.
  • Automatic Updates: The pyproject.toml version is automatically updated on releases

Commit Message Examples

# Stable releases (main branch)
feat: add new document export feature          # Minor bump (0.3.0 → 0.4.0)
fix: resolve authentication issue              # Patch bump (0.3.0 → 0.3.1)  
feat!: remove deprecated API endpoints         # Major bump (0.3.0 → 1.0.0)
docs: update README with new examples          # No version bump

# Release candidates (rc branch)  
feat: add experimental search filters          # Pre-release (0.3.0 → 0.4.0-rc.1)
fix: improve rc stability                      # Pre-release (0.4.0-rc.1 → 0.4.0-rc.2)

Docker Image Tags

  • Main branch releases: harbor.example.com/library/mcp-outline:latest + harbor.example.com/library/mcp-outline:v1.2.3
  • RC branch releases: harbor.example.com/library/mcp-outline:rc + harbor.example.com/library/mcp-outline:v1.2.3-rc.1

This ensures RC versions never override the production latest tag while providing proper versioned releases for testing.

See docs/semantic-versioning.md for detailed information.

Development

# Run tests
uv run pytest tests/

# Format code
uv run ruff format .

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A Model Context Protocol (MCP) server enabling AI assistants to interact with Outline documentation services.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages