Confluence Chat MCP server

Lightweight Confluence content expansion server that generates enhanced page content through a JSON-RPC interface, simplifying documentation workflows with minimal configuration.
Back to servers
Provider
Kinsha Dev
Release date
Mar 09, 2025
Language
Python

This Model Context Protocol (MCP) server enables secure and controlled access to your Confluence content. It provides a bridge between your Confluence workspace and AI assistants, allowing carefully scoped access to your documentation while maintaining security boundaries.

Installation

You can install the Confluence MCP server using pip:

pip install confluence-chat-mcp-service

Alternatively, you can clone the repository and install it directly:

git clone https://github.com/your-username/confluence-chat-mcp-service.git
cd confluence-chat-mcp-service
pip install -e .

Configuration

Environment Variables

The server requires several environment variables to be set:

  • CONFLUENCE_URL: The base URL of your Confluence instance
  • CONFLUENCE_USERNAME: Your Confluence username
  • CONFLUENCE_API_TOKEN: Your Confluence API token
  • MCP_SERVICE_URL: The URL where this MCP service will be deployed

You can set these variables in your environment or use a .env file:

CONFLUENCE_URL=https://your-instance.atlassian.net
[email protected]
CONFLUENCE_API_TOKEN=your-api-token
MCP_SERVICE_URL=http://localhost:8080

Creating a Confluence API Token

  1. Log in to your Atlassian account
  2. Go to Account Settings > Security > Create and manage API tokens
  3. Click "Create API token"
  4. Give your token a name and click "Create"
  5. Copy the token and store it securely

Running the Server

Starting the Server

Start the server with the following command:

confluence-mcp-server

By default, the server runs on port 8080. You can specify a different port:

confluence-mcp-server --port 9000

Docker Deployment

You can also run the server using Docker:

docker run -p 8080:8080 \
  -e CONFLUENCE_URL=https://your-instance.atlassian.net \
  -e [email protected] \
  -e CONFLUENCE_API_TOKEN=your-api-token \
  -e MCP_SERVICE_URL=http://localhost:8080 \
  confluence-chat-mcp-service

Using the MCP Server

Connecting to an AI Assistant

To connect the MCP server to an AI assistant, you'll need to provide the MCP service URL:

MCP Service URL: http://your-server-address:8080

Available Endpoints

The MCP server provides several endpoints:

  • /spaces: Lists all accessible Confluence spaces
  • /search?query=your-query: Searches for content matching the query
  • /page/{id}: Retrieves the content of a specific page by ID
  • /page/{id}/children: Lists all child pages of a specific page

Example Queries

You can interact with the server using curl commands:

# List all spaces
curl http://localhost:8080/spaces

# Search for content
curl http://localhost:8080/search?query=project+documentation

# Get a specific page
curl http://localhost:8080/page/123456

Security Considerations

The MCP server only provides access to content that the configured Confluence user can see. Make sure to use a dedicated account with appropriate permissions for integration with AI assistants.

Troubleshooting

Common Issues

If you encounter problems, check the following:

  • Verify that all environment variables are correctly set
  • Ensure the Confluence API token has not expired
  • Check network connectivity to your Confluence instance

For detailed logs, run the server with the debug flag:

confluence-mcp-server --debug

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later