confluence-developer-mcp

vasind/confluence-developer-mcp

3.1

If you are the rightful owner of confluence-developer-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server designed for fetching and parsing Confluence page content with authentication.

Tools
1
Resources
0
Prompts
0

Confluence Developer MCP Server

npm version

A Model Context Protocol (MCP) server for fetching Confluence page content with authentication.

Features

  • Confluence Integration: Fetch and parse Confluence pages with authentication
  • Content Extraction: Smart content extraction and formatting from Confluence pages
  • Error Handling: Comprehensive error handling with detailed error messages
  • Simple Setup: Easy configuration with environment variables

Installation

Global Installation (Recommended)

npm install -g confluence-developer-mcp

Local Installation

npm install confluence-developer-mcp

Configuration

Set the required environment variable for Confluence access:

# For Confluence access
export CONFLUENCE_API_KEY="your-confluence-pat-here"

Getting Confluence PAT

  1. Go to your Confluence profile settings
  2. Navigate to Personal Access Tokens
  3. Create a new token with appropriate permissions (read access to the pages you want to access)

IDE Configuration

Cursor IDE

Cursor has built-in MCP support. To configure the Confluence MCP server:

  1. Open Cursor Settings

    • Press Cmd+, (macOS) or Ctrl+, (Windows/Linux)
    • Or go to Cursor > Preferences > Settings
  2. Navigate to MCP Settings

    • Search for "MCP" in the settings search bar
    • Or go to AI > MCP Servers
  3. Add MCP Server Configuration

    {
      "mcpServers": {
        "confluence": {
          "command": "npx",
          "args": ["-y", "confluence-developer-mcp"],
          "env": {
            "CONFLUENCE_API_KEY": "your-confluence-pat-here"
          }
        }
      }
    }
    
  4. Alternative: Using settings.json

    • Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
    • Type "Preferences: Open Settings (JSON)"
    • Add the configuration above to your settings.json
  5. Restart Cursor

    • Restart Cursor for the MCP server to be recognized

Visual Studio Code

VS Code requires the MCP extension to use MCP servers:

  1. Install MCP Extension

    • Open Extensions (Cmd+Shift+X / Ctrl+Shift+X)
    • Search for "Model Context Protocol" or "MCP"
    • Install the official MCP extension
  2. Configure MCP Server

    • Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
    • Type "MCP: Configure Server"
    • Select "Add New Server"
  3. Server Configuration

    {
      "name": "confluence",
      "command": "npx",
      "args": ["-y", "confluence-developer-mcp"],
      "env": {
        "CONFLUENCE_API_KEY": "your-confluence-pat-here"
      }
    }
    
  4. Using settings.json (Alternative)

    • Open Command Palette
    • Type "Preferences: Open Settings (JSON)"
    • Add to your settings.json:
    {
      "mcp.servers": [
        {
          "name": "confluence",
          "command": "npx",
          "args": ["-y", "confluence-developer-mcp"],
          "env": {
            "CONFLUENCE_API_KEY": "your-confluence-pat-here"
          }
        }
      ]
    }
    

Using the MCP Server in IDEs

Once configured, you can use the Confluence MCP server in your AI conversations:

Example Prompts:

  • "Fetch the documentation from our Confluence page about API setup"
  • "Get the latest project requirements from our Confluence space"
  • "Show me the troubleshooting guide from our Confluence documentation"

Available Tools:

  • fetch_confluence_content: Retrieves content from any Confluence page URL

Example Usage:

User: "Get the content from https://company.atlassian.net/wiki/spaces/PROJ/pages/123456789/API+Documentation"

AI: I'll fetch that Confluence page for you using the fetch_confluence_content tool.

Troubleshooting IDE Configuration

Common Issues:

  1. Server not found

    • Ensure confluence-developer-mcp is installed globally: npm install -g confluence-developer-mcp
    • Check if the command is available: confluence-developer-mcp --version
  2. Authentication errors

    • Verify your CONFLUENCE_API_KEY is correct
    • Check if the PAT has the necessary permissions
    • Ensure the PAT hasn't expired
  3. Server won't start

    • Check Node.js version (requires 18+)
    • Verify all environment variables are set correctly
    • Check the IDE's console for error messages
  4. Permission denied

    • On macOS/Linux, ensure the command is executable
    • Try running: chmod +x $(which confluence-developer-mcp)

Debug Mode: To run the server in debug mode for troubleshooting:

DEBUG=* confluence-developer-mcp

Usage

As a Global Command

# Set your PAT
export CONFLUENCE_API_KEY="your-pat-here"

# Start the server
confluence-developer-mcp

As an MCP Server

The server provides the following tool:

fetch_confluence_content

Fetches content from Confluence pages with authentication.

Parameters:

  • url (required): The Confluence URL to fetch content from

Example:

{
  "name": "fetch_confluence_content",
  "arguments": {
    "url": "https://confluence.company.com/display/PROJECT/Documentation"
  }
}

Programmatic Usage

import { MCPServer } from 'confluence-developer-mcp';

// Set environment variables
process.env.CONFLUENCE_API_KEY = "your-confluence-pat-here";

// Create and start server
const server = new MCPServer();
server.start();

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

# Clone the repository
git clone <repository-url>
cd confluence-developer-mcp

# Install dependencies
npm install

# Set your Confluence PAT
export CONFLUENCE_API_KEY="your-pat-here"

# Build the project
npm run build

# Start in development mode
npm run dev

# Start in production mode
npm start

Project Structure

src/
├── config/          # Configuration management
├── services/        # Confluence service
├── tools/           # MCP tool definitions
├── types/           # TypeScript type definitions
├── index.ts         # Main exports
└── server.ts        # MCP server implementation

Environment Variables

VariableDescriptionRequired
CONFLUENCE_API_KEYPersonal Access Token for ConfluenceYes
CONFLUENCE_BASE_URLBase URL for Confluence instanceNo

Error Handling

The server provides detailed error messages for various scenarios:

  • 401: Authentication failed - check your PAT
  • 403: Access forbidden - insufficient permissions
  • 404: Page not found - check the URL
  • Timeout: Request timed out - try again
  • Network: Connection issues - check network connectivity

Security Notes

  • Keep your PAT secure and don't commit it to version control
  • Use environment variables for sensitive configuration
  • The server handles tokens securely in memory
  • Consider using a secrets manager for production deployments

License

MIT License - see LICENSE file for details.