Skip to content

ant-1/confluence-mcp-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Confluence MCP Test

A proof-of-concept project demonstrating integration between Confluence and MCP (Model Context Protocol) compatible AI agents. This project provides a Docker-based setup with a Confluence instance and an MCP adapter service for AI-driven document discovery and interaction.

🚀 Features

  • Confluence Server: Full Atlassian Confluence instance with PostgreSQL backend
  • MCP Adapter: REST API adapter for MCP-compatible AI agents
  • Data Seeding: Automated population of sample spaces, pages, comments, and attachments
  • Docker Compose: Complete containerized environment for easy setup

🏗️ Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   AI Agent      │    │   MCP Adapter   │    │   Confluence    │
│                 │◄──►│                 │◄──►│                 │
│                 │    │   (Port 4000)   │    │   (Port 8090)   │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                │                        │
                                │                        ▼
                                │              ┌─────────────────┐
                                │              │   PostgreSQL    │
                                │              │                 │
                                │              └─────────────────┘
                                ▼
                       ┌─────────────────┐
                       │   Seed Script   │
                       │                 │
                       └─────────────────┘

📋 Prerequisites

  • Docker and Docker Compose
  • At least 4GB RAM available for containers
  • Ports 4000, 8090, and 8091 available on your system

🛠️ Setup and Installation

1. Clone the Repository

git clone <repository-url>
cd confluence-mcp-test

2. Configure Environment Variables

Copy the example environment file and update with your credentials:

cp .env.example .env

Edit .env file:

CONFLUENCE_BASE_URL=http://localhost:8090
CONFLUENCE_USER=admin
CONFLUENCE_PASS=your_secure_password

3. Start the Services

docker-compose up -d

This will start:

  • PostgreSQL database
  • Confluence Server
  • MCP Adapter service

4. Initial Confluence Setup

  1. Wait for Confluence to start (this may take 5-10 minutes)
  2. Visit http://localhost:8090
  3. Complete the Confluence setup wizard:
    • Choose "Production Installation"
    • Select "My own database" and configure PostgreSQL:
      • Database type: PostgreSQL
      • Hostname: confluence-db
      • Port: 5432
      • Database name: confluence
      • Username: confluence
      • Password: confluence
    • Create an admin user with the credentials from your .env file
    • Complete the setup

5. Seed Sample Data

Once Confluence is fully configured, seed it with sample data:

docker exec -it mcp-adapter node seed.js

🔧 API Endpoints

The MCP Adapter provides the following REST endpoints:

Get All Spaces

GET http://localhost:4000/spaces

Get All Pages

GET http://localhost:4000/pages

Search Content

GET http://localhost:4000/search?q=your_search_term

📁 Project Structure

confluence-mcp-test/
├── docker-compose.yml          # Docker services configuration
├── .env.example               # Environment variables template
├── .gitignore                # Git ignore rules
├── README.md                 # This file
└── mcp-adapter/              # MCP Adapter service
    ├── Dockerfile            # Docker build instructions
    ├── package.json          # Node.js dependencies
    ├── index.js             # Main MCP adapter server
    └── seed.js              # Data seeding script

🧪 Sample Data

The seed script creates:

  • AI Research and Projects space
  • Sample pages:
    • MCP Protocol Overview
    • Project Atlas
    • Integration Guide
  • Comments on each page
  • Text file attachments

🔍 Troubleshooting

Confluence Takes Too Long to Start

  • Confluence requires significant resources. Ensure Docker has at least 4GB RAM allocated
  • Initial startup can take 10-15 minutes

Authentication Issues

  • Verify credentials in .env file match your Confluence admin user
  • Ensure Confluence setup is complete before running seed script

Port Conflicts

  • If ports 4000, 8090, or 8091 are in use, update the port mappings in docker-compose.yml

Database Connection Issues

  • Ensure PostgreSQL container is running: docker-compose ps
  • Check logs: docker-compose logs confluence-db

🧹 Cleanup

To stop and remove all containers:

docker-compose down

To also remove volumes (⚠️ this will delete all Confluence data):

docker-compose down -v

🤝 Contributing

This is a proof-of-concept project. Feel free to fork and modify for your needs.

📝 License

This project is for demonstration purposes. Please check Atlassian's licensing terms for Confluence usage.

⚠️ Security Notice

  • This setup uses default credentials and is intended for development/testing only
  • For production use, implement proper security measures:
    • Strong passwords
    • HTTPS/TLS encryption
    • Network security
    • Regular updates

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published