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.
shell
git clone https://github.com/pawankumar94/confluence-mcp-server.git
shell
pip install -r requirements.txt
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.
@tool("search_confluence")
def search(query: str) -> Dict[str, Any]
@tool("get_spaces")
def get_spaces() -> Dict[str, Any]
@tool("get_page_content")
def get_page_content(space_key: str, page_id: str) -> Dict[str, Any]
@tool("create_page")
def create_page(space_key: str, title: str, content: str) -> Dict[str, Any]
@tool("update_page")
def update_page(space_key: str, page_id: str, content: str) -> Dict[str, Any]
@tool("delete_page")
def delete_page(space_key: str, page_id: str) -> Dict[str, Any]
Start the server locally:
python example.py
The server will be accessible at http://localhost:8080.
shell
docker build -t confluence-mcp .
shell
docker tag confluence-mcp gcr.io/[PROJECT-ID]/confluence-mcp
docker push gcr.io/[PROJECT-ID]/confluence-mcp
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]"
All tools include comprehensive error handling. Responses are structured as follows:
- Success: Relevant data in the specified format.
- Error: {"error": "error message"}
.
Contributions are welcome! Feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
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.