confluence-server-mcp
Confluence MCP Server (confluence-server-mcp)
A Model Context Protocol (MCP) server that exposes the Confluence Server / Data Center REST API to MCP clients (Claude Desktop, Cursor, etc.).
It authenticates with a Personal Access Token (PAT) using the Authorization: Bearer header.
Install
npm install -g confluence-server-mcp
Or run it directly via npx:
npx confluence-server-mcp
Features
Read and write access to Confluence via these tools:
| Tool | Description |
|---|---|
list_spaces |
List spaces (optionally filter by global / personal) |
get_space |
Get a single space by key |
get_page |
Fetch a page by ID (body, version, space, ancestors, labels) |
search |
Search content with CQL |
create_page |
Create a page in a space (optional parent) |
update_page |
Update a page title/body (creates a new version) |
add_labels |
Add labels to a page |
list_labels |
List labels on a page |
list_attachments |
List attachments on a page |
Requirements
- Node.js >= 18
- A Confluence Server/Data Center instance (version 7.9+ for PAT support)
- A Personal Access Token (create it in your Atlassian profile: Profile → Personal Access Tokens)
Setup (from source)
npm install
npm run build
Configuration
The server reads configuration from environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
CONFLUENCE_URL |
Yes | — | Base URL (no trailing slash) |
CONFLUENCE_TOKEN |
Yes | — | Personal Access Token |
CONFLUENCE_PAGE_SIZE |
No | 25 |
Page size for list/search tools |
You can create a .env file and load it with your MCP client, or export the variables directly.
Note: the SDK does not auto-load
.env. Pass env vars explicitly (see below), or use a tool likedotenv-cli/direnv/ your MCP client'senvblock.
Running
npm run start # from source
confluence-server-mcp # global install (bin name)
MCP Client Configuration
Add this to your MCP client config. Example for Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["-y", "confluence-server-mcp"],
"env": {
"CONFLUENCE_URL": "https://confluence.example.com",
"CONFLUENCE_TOKEN": "your-personal-access-token"
}
}
}
}
For Cursor (.cursor/mcp.json):
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["-y", "confluence-server-mcp"],
"env": {
"CONFLUENCE_URL": "https://confluence.example.com",
"CONFLUENCE_TOKEN": "your-personal-access-token"
}
}
}
}
Example tool calls
Search for pages mentioning "roadmap" in a space:
search: { "cql": "space = \"MYSPACE\" AND text ~ \"roadmap\"", "limit": 10 }
Get a page body:
get_page: { "pageId": "123456789" }
Create a page:
create_page: { "spaceKey": "MYSPACE", "title": "New page", "body": "<p>Hello <strong>world</strong></p>" }
Development
npm run dev # run with tsx (hot reload)
npm run typecheck
npm run build
Security
- Never commit your token. It is provided only via the
CONFLUENCE_TOKENenvironment variable. - The token is used exclusively in the
Authorization: Bearerheader for REST API calls.