Connect AI to Your Confluence Knowledge Base
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.
What You Can Do
- Ask AI about your documentation: "What's our API authentication process?"
- Search across all spaces: "Find all pages about security best practices"
- Get instant answers: "Show me the latest release notes from the Product space"
- Access team knowledge: "What are our HR policies for remote work?"
- Review page comments: "Show me the discussion on the architecture document"
- Create and update content: "Create a new page in the DEV space"
Perfect For
- Developers who need quick access to technical documentation and API guides
- Product Managers searching for requirements, specs, and project updates
- HR Teams accessing policy documents and employee resources quickly
- Support Teams finding troubleshooting guides and knowledge base articles
- Anyone who wants to interact with Confluence using natural language
Quick Start
Get up and running in 2 minutes:
1. Get Your Confluence Credentials
Generate a Confluence API Token:
- Go to Atlassian API Tokens
- Click Create API token
- Give it a name like "AI Assistant"
- Copy the generated token immediately (you won't see it again!)
2. Try It Instantly
# 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"}'Connect to AI Assistants
For Claude Desktop Users
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.
For Other AI Assistants
Most AI assistants support MCP (Cursor AI, Continue.dev, and others). Install the server globally:
npm install -g @aashari/mcp-server-atlassian-confluenceThen configure your AI assistant to use the MCP server with STDIO transport. The binary is available as mcp-atlassian-confluence after global installation.
Alternative: Configuration File
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".
Using Environment Variables
You can also configure credentials using environment variables or a .env file:
# Create a .env file in your project directory
cat > .env << EOF
ATLASSIAN_SITE_NAME=your-company
ATLASSIAN_USER_EMAIL=your.email@company.com
ATLASSIAN_API_TOKEN=your_api_token
DEBUG=false
EOFThe server will automatically load these values from:
- Environment variables
.envfile in the current directory~/.mcp/configs.json(as shown above)
Available Tools
This MCP server provides 5 generic tools that can access any Confluence API endpoint:
| Tool | Description |
|---|---|
conf_get | GET any Confluence API endpoint (read data) |
conf_post | POST to any endpoint (create resources) |
conf_put | PUT to any endpoint (replace resources) |
conf_patch | PATCH to any endpoint (partial updates) |
conf_delete | DELETE from any endpoint (remove resources) |
Tool Parameters
All tools share these common parameters:
path(required): The API endpoint path (e.g.,/wiki/api/v2/spaces)queryParams(optional): Query parameters as key-value pairs (e.g.,{"limit": "25", "space-id": "123"})jq(optional): JMESPath expression to filter/transform the response (e.g.,results[*].{id: id, title: title})outputFormat(optional): Output format -"toon"(default, 30-60% fewer tokens) or"json"
Tools that accept a request body (conf_post, conf_put, conf_patch):
body(required): Request body as a JSON object
Common API Paths
Spaces:
/wiki/api/v2/spaces- List all spaces/wiki/api/v2/spaces/{id}- Get space details
Pages:
/wiki/api/v2/pages- List pages (usespace-idquery param to filter)/wiki/api/v2/pages/{id}- Get page details/wiki/api/v2/pages/{id}/body- Get page body (usebody-formatparam)/wiki/api/v2/pages/{id}/children- Get child pages/wiki/api/v2/pages/{id}/labels- Get page labels
Comments:
/wiki/api/v2/pages/{id}/footer-comments- List/add footer comments/wiki/api/v2/pages/{id}/inline-comments- List/add inline comments/wiki/api/v2/footer-comments/{comment-id}- Get/update/delete comment
Blog Posts:
/wiki/api/v2/blogposts- List blog posts/wiki/api/v2/blogposts/{id}- Get blog post
Search:
/wiki/rest/api/search- Search content (usecqlquery param)
TOON Output Format
What is TOON? TOON (Token-Oriented Object Notation) is a format optimized for LLM token efficiency, reducing token costs by 30-60% compared to JSON. It's the default output format for all tools.
Benefits:
- Tabular arrays use fewer tokens than JSON arrays
- Minimal syntax overhead (no quotes, brackets, commas where unnecessary)
- Still human-readable and parseable
When to use JSON instead:
- When you need standard JSON for other tools
- When debugging or manual inspection is needed
Example comparison:
// JSON format (verbose)
{"results": [{"id": "123", "title": "My Page"}, {"id": "456", "title": "Other Page"}]}
// TOON format (efficient)
results:
- id: 123
title: My Page
- id: 456
title: Other PageTo use JSON instead of TOON, set outputFormat: "json" in your request.
JMESPath Filtering
All tools support optional JMESPath (jq) filtering to extract specific data and reduce token costs:
# Get just space names and keys
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/spaces" \
--jq "results[].{id: id, key: key, name: name}"
# Get page title and status
npx -y @aashari/mcp-server-atlassian-confluence get \
--path "/wiki/api/v2/pages/123456" \
--jq "{id: id, title: title, status: status}"IMPORTANT: Always use the jq parameter to filter responses to only the fields you need. Unfiltered responses can be very large and expensive in token costs.
JMESPath Syntax Reference:
- Official docs: jmespath.org
- Common patterns:
results[*]- All items in results arrayresults[0]- First item onlyresults[*].id- Just IDs from all itemsresults[*].{id: id, title: title}- Create objects with selected fieldsresults[?status=='current']- Filter by condition
Real-World Examples
Explore Your Knowledge Base
Ask your AI assistant:
- "List all the spaces in our Confluence"
- "Show me details about the Engineering space"
- "What pages are in our Product space?"
- "Find the latest pages in the Marketing space"
Search and Find Information
Ask your AI assistant:
- "Search for pages about API authentication"
- "Find all documentation with 'security' in the title"
- "Show me pages labeled with 'getting-started'"
- "Search for content in the DEV space about deployment"
Access Specific Content
Ask your AI assistant:
- "Get the content of the API Authentication Guide page"
- "Show me the onboarding checklist document"
- "What's in our security policies page?"
- "Display the latest release notes"
Create and Update Content
Ask your AI assistant:
- "Create a new page in the DEV space titled 'API Guide'"
- "Add a comment to the architecture document"
- "Update the page content with the new release info"
CLI Commands
The CLI mirrors the MCP tools for direct terminal access. All commands support the same parameters as the tools.
Available Commands
get- GET any Confluence endpointpost- POST to any endpointput- PUT to any endpointpatch- PATCH any endpointdelete- DELETE from any endpoint
CLI Parameters
All commands:
-p, --path <path>(required) - API endpoint path-q, --query-params <json>(optional) - Query parameters as JSON--jq <expression>(optional) - JMESPath filter expression-o, --output-format <format>(optional) - Output format:toon(default) orjson
Commands with body (post, put, patch):
-b, --body <json>(required) - Request body as JSON
Examples
# 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": "<p>Content here</p>"}}'
# 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": "<p>My comment</p>"}}'
# 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": "<p>Updated content</p>"}, "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"Response Handling
Large Response Truncation
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 th
…