Confluence MCP is a Model Context Protocol server that enables AI assistants to interact with Confluence content through a standardized interface. It provides tools for authentication, content retrieval, page creation, commenting, and attachment management while handling API communication and data transformation tasks.
# Clone the repository
git clone https://github.com/cosmix/confluence-mcp.git
cd confluence-mcp
# Install dependencies
bun install
# Build the project
bun run build
To use this MCP server, you need to set the following environment variables:
CONFLUENCE_API_TOKEN=your_api_token
CONFLUENCE_BASE_URL=your_confluence_instance_url # e.g., https://your-domain.atlassian.net/wiki
CONFLUENCE_USER_EMAIL=your_email
Add this configuration to your settings file:
{
"mcpServers": {
"confluence": {
"command": "bun",
"args": ["/absolute/path/to/confluence-mcp/dist/index.js"],
"env": {
"CONFLUENCE_API_TOKEN": "your_api_token",
"CONFLUENCE_BASE_URL": "your_confluence_instance_url/wiki",
"CONFLUENCE_USER_EMAIL": "your_email"
}
}
}
}
The Confluence MCP server exposes the following tools:
Retrieve a Confluence page by ID. Format refers to the return format of the content and can be text
or markdown
. The includeMarkup
parameter allows retrieving the original Confluence Storage Format (XHTML) markup, which is useful for updating pages while preserving formatting.
{
"pageId": "123456",
"format": "text",
"includeMarkup": true
}
Search for Confluence pages using CQL (Confluence Query Language). Format refers to the return format of the content and can be text
or markdown
. The includeMarkup
parameter allows retrieving the original Confluence Storage Format (XHTML) markup for each page.
{
"query": "space = DEV and label = documentation",
"limit": 10,
"format": "text",
"includeMarkup": true
}
List all available Confluence spaces.
{
"limit": 50
}
Create a new Confluence page. The parentId
is optional and can be used to create a child page under an existing page.
{
"spaceKey": "DEV",
"title": "New Page Title",
"content": "<p>Page content in Confluence Storage Format (XHTML)</p>",
"parentId": "123456"
}
Update an existing Confluence page.
{
"pageId": "123456",
"title": "Updated Page Title",
"content": "<p>Updated content in Confluence Storage Format (XHTML)</p>",
"version": 1
}
Retrieve comments for a specific Confluence page. Format refers to the return format of the content and can be text
or markdown
.
{
"pageId": "123456",
"limit": 25,
"format": "text"
}
Add a comment to a Confluence page. The parentId
is optional for creating threaded replies.
{
"pageId": "123456",
"content": "<p>This is a new comment.</p>",
"parentId": "789012"
}
Retrieve attachments for a specific Confluence page.
{
"pageId": "123456",
"limit": 25
}
Add an attachment to a Confluence page. The fileContentBase64
should be the base64 encoded string of the file content.
{
"pageId": "123456",
"filename": "document.pdf",
"fileContentBase64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+P...",
"comment": "Uploaded new version of the document"
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "confluence" '{"command":"bun","args":["/absolute/path/to/confluence-mcp/dist/index.js"],"env":{"CONFLUENCE_API_TOKEN":"your_api_token","CONFLUENCE_BASE_URL":"your_confluence_instance_url/wiki","CONFLUENCE_USER_EMAIL":"your_email"}}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"confluence": {
"command": "bun",
"args": [
"/absolute/path/to/confluence-mcp/dist/index.js"
],
"env": {
"CONFLUENCE_API_TOKEN": "your_api_token",
"CONFLUENCE_BASE_URL": "your_confluence_instance_url/wiki",
"CONFLUENCE_USER_EMAIL": "your_email"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"confluence": {
"command": "bun",
"args": [
"/absolute/path/to/confluence-mcp/dist/index.js"
],
"env": {
"CONFLUENCE_API_TOKEN": "your_api_token",
"CONFLUENCE_BASE_URL": "your_confluence_instance_url/wiki",
"CONFLUENCE_USER_EMAIL": "your_email"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect