pawankumar94_confluence_mcp_server

pawankumar94_confluence_mcp_server

by pawankumar94
A Model Context Protocol (MCP) server for integrating AI agents with Atlassian Confluence, enabling page management, space handling, and content search.

Confluence MCP Server for AI Integration

Overview

The Confluence MCP Server is a Model Context Protocol (MCP) implementation designed to facilitate seamless interaction between AI agents and Atlassian Confluence. Built with Flask, it provides a robust set of tools for managing Confluence pages, spaces, and content, enabling AI-driven workflows with built-in rate limiting and error handling.

Features

  • Search Pages and Spaces: Use Confluence Query Language (CQL) to search for content.
  • Space Management: List all available Confluence spaces.
  • Page Operations: Create, read, update, and delete Confluence pages.
  • Rich Metadata Support: Enhanced metadata for Confluence resources.
  • Flask-Based Server: Easy deployment to Cloud Run.
  • MCP Tools: Tools specifically designed for AI agent integration.

Installation

  1. Clone the repository:
    shell git clone https://github.com/pawankumar94/confluence-mcp-server.git
  2. Install dependencies:
    shell pip install -r requirements.txt

Configuration

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

CONFLUENCE_URL=https://your-instance.atlassian.net/wiki
CONFLUENCE_ACCESS_TOKEN=your_access_token
PORT=8080  # Optional, defaults to 8080

To obtain an access token:
1. Log in to your Atlassian account.
2. Navigate to Account Settings > Security > Create and manage API tokens.
3. Generate a new API token and copy it.

Available Tools

1. Search Content

@tool("search_confluence")
def search(query: str) -> Dict[str, Any]

2. Get Spaces

@tool("get_spaces")
def get_spaces() -> Dict[str, Any]

3. Get Page Content

@tool("get_page_content")
def get_page_content(space_key: str, page_id: str) -> Dict[str, Any]

4. Create Page

@tool("create_page")
def create_page(space_key: str, title: str, content: str) -> Dict[str, Any]

5. Update Page

@tool("update_page")
def update_page(space_key: str, page_id: str, content: str) -> Dict[str, Any]

6. Delete Page

@tool("delete_page")
def delete_page(space_key: str, page_id: str) -> Dict[str, Any]

Running Locally

Start the server locally:

python example.py

The server will be accessible at http://localhost:8080.

Cloud Run Deployment

  1. Build the Docker image:
    shell docker build -t confluence-mcp .
  2. Tag and push to Google Container Registry:
    shell docker tag confluence-mcp gcr.io/[PROJECT-ID]/confluence-mcp docker push gcr.io/[PROJECT-ID]/confluence-mcp
  3. Deploy to Cloud Run:
    shell gcloud run deploy confluence-mcp \ --image gcr.io/[PROJECT-ID]/confluence-mcp \ --platform managed \ --allow-unauthenticated \ --set-env-vars="CONFLUENCE_URL=[YOUR_URL],CONFLUENCE_ACCESS_TOKEN=[YOUR_TOKEN]"

Error Handling

All tools include comprehensive error handling. Responses are structured as follows:
- Success: Relevant data in the specified format.
- Error: {"error": "error message"}.

Security Considerations

  1. Use environment variables for sensitive data.
  2. Leverage Cloud Run's secret management.
  3. Implement proper authentication for endpoints.
  4. Securely store your Confluence access token.

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

License

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

About

The Confluence MCP Server provides API tools for Atlassian Confluence operations, enabling AI-driven workflows with built-in rate limiting and error handling. For more details, check out the case study.

Features & Capabilities

Categories
mcp_server model_context_protocol python flask confluence api_integration docker cloud_run ai_integration

Implementation Details

Stats

0 Views
2 GitHub Stars

Repository Info

pawankumar94 Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300