confluence-mcp-server

confluence-mcp-server

Integrates Confluence with Claude Desktop, enabling natural language search, content retrieval, and space navigation for Confluence documentation.

Category
Visit Server

README

Confluence MCP Server

A Model Context Protocol (MCP) server that integrates Confluence with Claude Desktop and other AI assistants, enabling natural language interactions with your Confluence documentation.

πŸš€ Features

  • Search Pages: Find documentation using natural language or CQL queries
  • Content Retrieval: Get full page content with formatting preserved
  • Space Exploration: List and navigate through your Confluence space
  • Page Hierarchy: Explore parent-child relationships between pages
  • Title-based Search: Find pages by exact title matches
  • Real-time Integration: Direct integration with Claude Desktop for seamless AI assistance

πŸ“‹ Prerequisites

  • Node.js (v18.0.0 or higher)
  • npm (v8.0.0 or higher)
  • Confluence Cloud account with API access
  • Claude Desktop (for AI integration)

πŸ”§ Installation

Option 1: Global Installation (Recommended)

# Clone the repository
git clone https://github.com/alirezarezvani/confluence-mcp-server.git
cd confluence-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Install globally for easy access
npm run install-global

Option 2: Local Installation

# Clone the repository
git clone https://github.com/alirezarezvani/confluence-mcp-server.git
cd confluence-mcp-server

# Install dependencies and build
npm install
npm run build

βš™οΈ Configuration

1. Get Confluence API Credentials

  1. API Token:

  2. Space Key:

    • Navigate to your Confluence space
    • Check the URL: https://your-org.atlassian.net/wiki/spaces/SPACEKEY/
    • The SPACEKEY is what you need
  3. Base URL:

    • Usually https://your-org.atlassian.net (without /wiki)

2. Environment Setup

Create a .env file in the project root:

CONFLUENCE_BASE_URL=https://your-org.atlassian.net
CONFLUENCE_EMAIL=your-email@company.com
CONFLUENCE_API_TOKEN=your-api-token-here
CONFLUENCE_SPACE_KEY=YOUR_SPACE_KEY

3. Validate Configuration

# Test your environment variables
npm run validate-env

# Test the server connection
npm start

πŸ€– Claude Desktop Integration

Configuration File Location

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

Configuration Options

Option 1: Global Installation

{
  "mcpServers": {
    "confluence": {
      "command": "confluence-mcp",
      "env": {
        "CONFLUENCE_BASE_URL": "https://your-org.atlassian.net",
        "CONFLUENCE_EMAIL": "your-email@company.com",
        "CONFLUENCE_API_TOKEN": "your-api-token",
        "CONFLUENCE_SPACE_KEY": "YOUR_SPACE_KEY"
      }
    }
  }
}

Option 2: Local Installation

{
  "mcpServers": {
    "confluence": {
      "command": "node",
      "args": ["/full/path/to/confluence-mcp-server/dist/confluence-mcp-server.js"],
      "env": {
        "CONFLUENCE_BASE_URL": "https://your-org.atlassian.net",
        "CONFLUENCE_EMAIL": "your-email@company.com",
        "CONFLUENCE_API_TOKEN": "your-api-token",
        "CONFLUENCE_SPACE_KEY": "YOUR_SPACE_KEY"
      }
    }
  }
}

Activation

  1. Save the configuration file
  2. Restart Claude Desktop completely (Cmd+Q then reopen)
  3. Look for MCP tools in the Claude Desktop interface

πŸ› οΈ Available Tools

1. search_confluence_pages

Search for pages using text queries or CQL.

Usage Examples:

  • "Search for 'API documentation' in Confluence"
  • "Find pages about React development"
  • "Look for troubleshooting guides"

2. get_page_content

Retrieve full content of a specific page.

Usage Examples:

  • "Get the content of page ID 12345"
  • "Show me what's in the 'Setup Guide' page"

3. list_space_pages

List all pages in your Confluence space.

Usage Examples:

  • "List all pages in our Confluence space"
  • "Show me the 25 most recent pages"

4. get_page_hierarchy

Explore parent-child page relationships.

Usage Examples:

  • "Show me all child pages under 'Documentation'"
  • "What are the sub-pages of the architecture section?"

5. get_page_by_title

Find pages by exact title match.

Usage Examples:

  • "Find the page titled 'Development Workflow'"
  • "Get the 'Onboarding Checklist' page"

πŸ’¬ Usage Examples

Team Collaboration

"Help me find our deployment process documentation"
"What's the latest information about our API endpoints?"
"Show me all pages related to the mobile app project"
"Get me the content from our coding standards page"

Project Management

"Find all documentation related to the new feature"
"What's our current architecture documentation saying about microservices?"
"Show me the troubleshooting guides for production issues"
"List all pages updated in the last month"

Development Workflow

"Search for Docker configuration examples"
"Find our Git workflow documentation"
"What's in our testing guidelines page?"
"Show me the API integration examples"

πŸ”§ Development

Scripts

# Development with auto-reload
npm run dev

# Build TypeScript to JavaScript
npm run build

# Run the built server
npm start

# Watch for changes and auto-restart
npm run watch

# Clean build directory
npm run clean

# Validate environment variables
npm run validate-env

# Run tests
npm test

# Run specific test file
npm test -- tests/path/to/test.ts

Project Structure

confluence-mcp-server/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ confluence-mcp-server.ts  # Main server implementation
β”‚   β”œβ”€β”€ cache/                    # Caching implementation
β”‚   β”‚   β”œβ”€β”€ CacheManager.ts       # Generic cache management
β”‚   β”‚   └── ConfluenceCache.ts    # Confluence-specific caching
β”‚   └── monitoring/               # Performance monitoring
β”‚       └── PerformanceMonitor.ts # Performance tracking and metrics
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ confluence-mcp-server.test.ts  # Main server tests
β”‚   β”œβ”€β”€ integration/              # Integration tests
β”‚   β”‚   └── mcp-tools.test.ts     # MCP tools integration tests
β”‚   β”œβ”€β”€ cache/                    # Cache tests
β”‚   β”‚   └── CacheManager.test.ts  # Cache manager tests
β”‚   β”œβ”€β”€ monitoring/               # Monitoring tests
β”‚   β”‚   └── PerformanceMonitor.test.ts # Performance monitor tests
β”‚   └── utils/                    # Test utilities
β”‚       └── test-utils.ts         # Mock implementations and helpers
β”œβ”€β”€ dist/                         # Compiled JavaScript (after build)
β”œβ”€β”€ package.json                  # Project dependencies and scripts
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
β”œβ”€β”€ jest.config.js                # Jest test configuration
β”œβ”€β”€ .env                          # Environment variables (create this)
β”œβ”€β”€ .env.test                     # Test environment variables
β”œβ”€β”€ .gitignore                    # Git ignore rules
└── README.md                     # This file

πŸ§ͺ Testing

The project includes a comprehensive test suite using Jest. Tests cover both unit and integration testing of the MCP server functionality.

Running Tests

# Run all tests
npm test

# Run specific test file
npm test -- tests/cache/CacheManager.test.ts

# Run tests with coverage report
npm test -- --coverage

Test Structure

  • Unit Tests: Test individual components in isolation
  • Integration Tests: Test the MCP tools and their interaction with the Confluence API
  • Mock Tests: Use mock implementations to simulate Confluence API responses

Test Environment

Tests use a separate .env.test file for environment variables. The test environment is automatically set up when running tests.

Recent Improvements

  • Fixed path issues in test imports
  • Improved CacheManager implementation with better edge case handling
  • Enhanced PerformanceMonitor with more accurate metrics
  • Added proper test data preparation for consistent test results
  • Updated Jest configuration for ES modules support

🚨 Troubleshooting

Common Issues

"Permission denied" error

chmod +x dist/confluence-mcp-server.js

"Missing environment variables"

npm run validate-env

"Cannot connect to Confluence"

  1. Verify your API token has proper permissions
  2. Check your base URL format (no trailing slash)
  3. Ensure your email and space key are correct

"Claude Desktop not recognizing MCP server"

  1. Check the configuration file path
  2. Verify JSON syntax in the config file
  3. Restart Claude Desktop completely
  4. Check Claude Desktop logs for errors

Debug Mode

# Run with detailed logging
LOG_LEVEL=debug npm start

πŸ”’ Security Considerations

  • API Token: Never commit your API token to version control
  • Environment Variables: Use .env files and keep them secure
  • Permissions: Ensure your API token has minimal required permissions
  • Network: Consider using VPN for sensitive corporate documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments

πŸ“ž Support

πŸ—ΊοΈ Roadmap Q2/Q3 2025

  • [ ] Support for multiple Confluence spaces
  • [ ] Page creation and editing capabilities
  • [ ] Comment and attachment handling
  • [ ] OAuth 2.0 authentication
  • [x] Caching for improved performance
  • [ ] Docker containerization
  • [ ] Confluence Server (on-premise) support
  • [x] Comprehensive test suite

Made with ❀️ by Alireza Rezvani

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured