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.
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 .
The server requires several environment variables to be set:
CONFLUENCE_URL
: The base URL of your Confluence instanceCONFLUENCE_USERNAME
: Your Confluence usernameCONFLUENCE_API_TOKEN
: Your Confluence API tokenMCP_SERVICE_URL
: The URL where this MCP service will be deployedYou 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
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
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
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
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 pageYou 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
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.
If you encounter problems, check the following:
For detailed logs, run the server with the debug flag:
confluence-mcp-server --debug
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.
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"
]
}
}
}
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.
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.