Transform how you access and interact with your team's knowledge by connecting Claude, Cursor AI, and other AI assistants directly to your Confluence spaces, pages, and documentation. Get instant answers from your knowledge base, search across all your spaces, and streamline your documentation workflow. - Ask AI about your documentation: "What's our API authentication process?" - Search across all
Add this skill
npx mdskills install aashari/mcp-server-atlassian-confluenceWell-documented MCP server providing comprehensive Confluence API access with token optimization features
Transform how you access and interact with your team's knowledge by connecting Claude, Cursor AI, and other AI assistants directly to your Confluence spaces, pages, and documentation. Get instant answers from your knowledge base, search across all your spaces, and streamline your documentation workflow.
Get up and running in 2 minutes:
Generate a Confluence API Token:
# Set your credentials
export ATLASSIAN_SITE_NAME="your-company" # for your-company.atlassian.net
export ATLASSIAN_USER_EMAIL="your.email@company.com"
export ATLASSIAN_API_TOKEN="your_api_token"
# List your Confluence spaces (TOON format by default)
npx -y @aashari/mcp-server-atlassian-confluence get --path "/wiki/api/v2/spaces"
# Get details about a specific space with field filtering
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/spaces/123456" \
--jq "{id: id, key: key, name: name, type: type}"
# Get a page with JMESPath filtering
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/pages/789" \
--jq "{id: id, title: title, status: status}"
# Search for pages (using CQL)
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/rest/api/search" \
--query-params '{"cql": "type=page AND space=DEV"}'
Add this to your Claude configuration file (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-confluence"],
"env": {
"ATLASSIAN_SITE_NAME": "your-company",
"ATLASSIAN_USER_EMAIL": "your.email@company.com",
"ATLASSIAN_API_TOKEN": "your_api_token"
}
}
}
}
Restart Claude Desktop, and you'll see the confluence server in the status bar.
Most AI assistants support MCP (Cursor AI, Continue.dev, and others). Install the server globally:
npm install -g @aashari/mcp-server-atlassian-confluence
Then configure your AI assistant to use the MCP server with STDIO transport. The binary is available as mcp-atlassian-confluence after global installation.
Create ~/.mcp/configs.json for system-wide configuration:
{
"confluence": {
"environments": {
"ATLASSIAN_SITE_NAME": "your-company",
"ATLASSIAN_USER_EMAIL": "your.email@company.com",
"ATLASSIAN_API_TOKEN": "your_api_token"
}
}
}
Alternative config keys: The system also accepts "atlassian-confluence", "@aashari/mcp-server-atlassian-confluence", or "mcp-server-atlassian-confluence" instead of "confluence".
You can also configure credentials using environment variables or a .env file:
# Create a .env file in your project directory
cat > .env ` (optional) - Query parameters as JSON
- `--jq ` (optional) - JMESPath filter expression
- `-o, --output-format ` (optional) - Output format: `toon` (default) or `json`
**Commands with body (post, put, patch):**
- `-b, --body ` (required) - Request body as JSON
### Examples
```bash
# GET request
npx -y @aashari/mcp-server-atlassian-confluence get --path "/wiki/api/v2/spaces"
# GET with query parameters and JMESPath filter
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/pages" \
--query-params '{"space-id": "123456", "limit": "10"}' \
--jq "results[*].{id: id, title: title}"
# GET with JSON output format
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/spaces" \
--output-format json
# POST request (create a page)
npx -y @aashari/mcp-server-atlassian-confluence post \
--path "/wiki/api/v2/pages" \
--body '{"spaceId": "123456", "status": "current", "title": "New Page", "body": {"representation": "storage", "value": "Content here
"}}'
# POST request (add a comment)
npx -y @aashari/mcp-server-atlassian-confluence post \
--path "/wiki/api/v2/pages/789/footer-comments" \
--body '{"body": {"representation": "storage", "value": "My comment
"}}'
# PUT request (update page - requires version increment)
npx -y @aashari/mcp-server-atlassian-confluence put \
--path "/wiki/api/v2/pages/789" \
--body '{"id": "789", "status": "current", "title": "Updated Title", "spaceId": "123456", "body": {"representation": "storage", "value": "Updated content
"}, "version": {"number": 2}}'
# PATCH request (partial update)
npx -y @aashari/mcp-server-atlassian-confluence patch \
--path "/wiki/api/v2/spaces/123456" \
--body '{"name": "New Space Name"}'
# DELETE request
npx -y @aashari/mcp-server-atlassian-confluence delete \
--path "/wiki/api/v2/pages/789"
When API responses exceed approximately 40,000 characters (~10,000 tokens), the server automatically truncates the response to stay within token limits. When this happens:
You'll see a truncation notice at the end of the response showing:
The full raw response is saved to a temporary file in /tmp/mcp/ (path provided in the truncation notice)
Best practices to avoid truncation:
jq parameter to filter responses to only needed fieldslimit query parameter to restrict result counts (e.g., {"limit": "5"})Example of efficient filtering:
# Instead of getting all space data (can be huge):
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/spaces"
# Get only the fields you need:
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/spaces" \
--query-params '{"limit": "10"}' \
--jq "results[*].{id: id, key: key, name: name}"
Enable debug logging to see detailed request/response information:
# Set DEBUG environment variable
export DEBUG=true
# For MCP mode
DEBUG=true npx -y @aashari/mcp-server-atlassian-confluence
# For CLI mode
DEBUG=true npx -y @aashari/mcp-server-atlassian-confluence get --path "/wiki/api/v2/spaces"
Debug logs are written to: ~/.mcp/data/@aashari-mcp-server-atlassian-confluence.[session-id].log
The MCP Inspector provides a visual interface for testing tools:
# Install the server globally
npm install -g @aashari/mcp-server-atlassian-confluence
# Run with MCP Inspector
npx @modelcontextprotocol/inspector node $(which mcp-atlassian-confluence)
Or use the built-in development command if you've cloned the repository:
npm run mcp:inspect
This starts the server in HTTP mode and opens the inspector UI in your browser.
You can run the server in HTTP mode to test with curl or other HTTP clients:
# Start server in HTTP mode
TRANSPORT_MODE=http npx -y @aashari/mcp-server-atlassian-confluence
The server will listen on http://localhost:3000/mcp by default. You can change the port:
PORT=8080 TRANSPORT_MODE=http npx -y @aashari/mcp-server-atlassian-confluence
Testing with curl:
# Initialize session
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "clientInfo": {"name": "curl-test", "version": "1.0.0"}, "capabilities": {}}}'
# List available tools
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
# Call a tool
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "conf_get", "arguments": {"path": "/wiki/api/v2/spaces", "queryParams": {"limit": "5"}}}}'
The response comes as Server-Sent Events (SSE) with format:
event: message
data: {"jsonrpc": "2.0", "id": 1, "result": {...}}
Check your API Token permissions:
Verify your site name format:
https://mycompany.atlassian.netmycompanyTest your credentials:
npx -y @aashari/mcp-server-atlassian-confluence get --path "/wiki/api/v2/spaces?limit=1"
Check the API path:
Verify access permissions:
Try different search terms:
Check CQL syntax:
~/.claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonIf you're still having issues:
Your Atlassian account needs:
Currently, this tool only supports Confluence Cloud. Confluence Server/Data Center support may be added in future versions.
Your site name is the first part of your Confluence URL:
https://mycompany.atlassian.net -> Site name: mycompanyhttps://acme-corp.atlassian.net -> Site name: acme-corpAny AI assistant that supports the Model Context Protocol (MCP):
Yes! This tool:
Yes! Use CQL queries for cross-space searches. For example:
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/rest/api/search" \
--query-params '{"cql": "type=page AND text~\"API documentation\""}'
Version 3.0 replaces 8+ specific tools with 5 generic HTTP method tools. If you're upgrading from v2.x:
Before (v2.x):
conf_ls_spaces, conf_get_space, conf_ls_pages, conf_get_page,
conf_search, conf_ls_comments, conf_add_comment, ...
After (v3.0):
conf_get, conf_post, conf_put, conf_patch, conf_delete
Migration examples:
conf_ls_spaces -> conf_get with path /wiki/api/v2/spacesconf_get_space -> conf_get with path /wiki/api/v2/spaces/{id}conf_ls_pages -> conf_get with path /wiki/api/v2/pages?space-id={id}conf_get_page -> conf_get with path /wiki/api/v2/pages/{id}conf_search -> conf_get with path /wiki/rest/api/search?cql=...conf_add_comment -> conf_post with path /wiki/api/v2/pages/{id}/footer-commentsregisterTool API)This server follows a 5-layer architecture:
src/tools/) - MCP tool definitions with Zod validationsrc/cli/) - Commander-based CLI for direct testingsrc/controllers/) - Business logic, JMESPath filtering, output formattingsrc/services/) - Confluence API communicationsrc/utils/) - Shared utilities (logger, config, formatters, TOON encoder)/tmp/mcp/v3.2.1 (Current)
v3.2.0
v3.1.0
v3.0.0 (Breaking change)
See CHANGELOG.md for complete version history.
Need help? Here's how to get assistance:
Made with care for teams who want to bring AI into their knowledge management workflow.
Install via CLI
npx mdskills install aashari/mcp-server-atlassian-confluenceConnect AI to Your Confluence Knowledge Base is a free, open-source AI agent skill. Transform how you access and interact with your team's knowledge by connecting Claude, Cursor AI, and other AI assistants directly to your Confluence spaces, pages, and documentation. Get instant answers from your knowledge base, search across all your spaces, and streamline your documentation workflow. - Ask AI about your documentation: "What's our API authentication process?" - Search across all
Install Connect AI to Your Confluence Knowledge Base with a single command:
npx mdskills install aashari/mcp-server-atlassian-confluenceThis downloads the skill files into your project and your AI agent picks them up automatically.
Connect AI to Your Confluence Knowledge Base works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.