confluence-mcp
Provides tools for searching, reading, and retrieving documentation from Confluence, including full-text/CQL search, page retrieval by ID or title, listing space pages, fetching child pages, syncing pages to local markdown, and pushing markdown files to Confluence.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@confluence-mcpSearch for 'API docs' in Confluence"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Confluence MCP Server
Model Context Protocol (MCP) server for integrating Confluence with AI agents. This server allows AI assistants to search, read, and retrieve documentation from your Confluence workspace.
Features
🔍 Search Confluence - Full-text and CQL search across spaces
📄 Get Page by ID - Retrieve complete page content by ID
📝 Get Page by Title - Find pages by exact title match
📚 List Space Pages - Get all pages in a space
🌲 Get Page Children - Navigate page hierarchies
📥 Sync Docs - Sync Confluence pages to local markdown files
📤 Push MD to Confluence - Push markdown files to Confluence (create/update pages)
Related MCP server: confluence-mcp-server
Installation
git clone https://github.com/harshpuri84/confluence-mcp.git
cd confluence-mcp
npm install
npm run buildConfiguration
Create a
.envfile from the example:
cp .env.example .envConfigure your Confluence credentials:
CONFLUENCE_BASE_URL=https://your-domain.atlassian.net
CONFLUENCE_USER_EMAIL=your-email@example.com
CONFLUENCE_API_TOKEN=your-api-token
CONFLUENCE_SPACE_KEY=DOCS
CONFLUENCE_PAGE_LIMIT=10
CONFLUENCE_SYNC_DIR=./confluence-docsGetting Confluence API Token
Go to https://id.atlassian.com/manage-profile/security/api-tokens
Click "Create API token"
Give it a descriptive name (e.g., "MCP Server")
Copy the token and add it to your
.envfile
Usage with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"confluence": {
"command": "node",
"args": [
"/Users/harsh.puri/Documents/AI-airlcl/mcp-servers/confluence-mcp/dist/index.js"
],
"env": {
"CONFLUENCE_BASE_URL": "https://your-domain.atlassian.net",
"CONFLUENCE_USER_EMAIL": "your-email@example.com",
"CONFLUENCE_API_TOKEN": "your-api-token",
"CONFLUENCE_SPACE_KEY": "DOCS"
}
}
}
}Restart Claude Desktop after configuration.
Available Tools
search_confluence
Search Confluence for pages matching a query.
Parameters:
query(required): Search query or CQL statementlimit(optional): Maximum results (default: 10)spaceKey(optional): Restrict to specific space
Example queries:
"freight operations"
"text ~ \"booking\" AND space = DOCS"
"title ~ \"API\" AND type = page"get_page_by_id
Get a Confluence page by its ID.
Parameters:
pageId(required): The page IDexpandBody(optional): Include content (default: true)
get_page_by_title
Find a page by exact title match.
Parameters:
title(required): Exact page titlespaceKey(required): Space key
get_space_pages
List all pages in a space.
Parameters:
spaceKey(required): The space keylimit(optional): Max pages (default: 25)
get_page_children
Get child pages of a parent page.
Parameters:
pageId(required): Parent page IDlimit(optional): Max children (default: 25)
sync_confluence_docs
Sync Confluence pages to local markdown files. Supports syncing entire spaces, search results, or specific pages.
Parameters:
spaceKey(optional): Space key to sync all pages fromquery(optional): CQL query to sync matching pagespageIds(optional): Array of specific page IDs to syncoutputDir(optional): Output directory (default: ./confluence-docs)includeChildren(optional): Include child pages (default: false)recursive(optional): Recursively sync child pages (default: false)
Note: You must provide at least one of spaceKey, query, or pageIds.
Syncing Docs to Local Files
Using the Standalone Sync Script
The Confluence MCP includes a standalone CLI script for syncing documentation:
# Build the project first
npm run build
# Sync all pages from a space
node dist/sync.js space DOCS
# Sync to a custom directory
node dist/sync.js space DOCS ./my-docs
# Sync recursively (includes all child pages)
node dist/sync.js space DOCS --recursive
# Sync pages matching a query
node dist/sync.js query "API documentation"
# Sync with space filter
node dist/sync.js query "best practices" --space DOCS
# Sync specific pages by ID
node dist/sync.js pages 123456 789012 345678Using the MCP Tool
You can also sync docs via the MCP sync_confluence_docs tool:
{
"tool": "sync_confluence_docs",
"arguments": {
"spaceKey": "DOCS",
"outputDir": "./confluence-docs",
"recursive": true
}
}Output Format
Synced files are saved as Markdown with frontmatter:
Files are organized by space key:
{outputDir}/{spaceKey}/{page-title}.mdEach file includes metadata (ID, title, space, URL, version, last modified)
HTML content is converted to Markdown
Child pages are included if
recursiveorincludeChildrenis true
Example output structure:
confluence-docs/
DOCS/
Getting-Started.md
API-Reference.md
Best-Practices.md
Sub-Page.mdPushing Markdown Files to Confluence
Using the Standalone Push Script
Push markdown files to Confluence using the CLI script:
# Build the project first
npm run build
# Push a single markdown file
node dist/push.js file document.md --space DOCS
# Push with parent page (create as child page)
node dist/push.js file document.md --space DOCS --parent 123456
# Push all markdown files from a directory
node dist/push.js dir ./docs --space DOCS
# Push directory with parent page
node dist/push.js dir ./docs --space DOCS --parent 123456
# Create new pages only (don't update existing)
node dist/push.js file document.md --space DOCS --no-update
# Or use npm script
npm run push file document.md --space DOCSUsing the MCP Tool
You can also push markdown files via the MCP push_md_to_confluence tool:
{
"tool": "push_md_to_confluence",
"arguments": {
"filePath": "./document.md",
"spaceKey": "DOCS",
"updateExisting": true
}
}Or push an entire directory:
{
"tool": "push_md_to_confluence",
"arguments": {
"directory": "./docs",
"spaceKey": "DOCS",
"parentPageId": "123456"
}
}File Format
Markdown files can include frontmatter for metadata:
---
id: 123456
title: My Document Title
spaceKey: DOCS
---
# My Document
Content goes here...Frontmatter fields:
id(optional): Existing Confluence page ID - if provided, will update that pagetitle(optional): Page title - defaults to filename if not providedspaceKey(optional): Space key - can be provided via CLI/API parameter instead
Behavior:
If
idis in frontmatter and page exists → Updates the pageIf
titlematches existing page in space → Updates the page (ifupdateExistingis true)Otherwise → Creates a new page
Markdown is converted to HTML automatically
Supports standard markdown: headings, lists, code blocks, links, etc.
Example AI Prompts
Once configured, you can ask Claude:
"Search our Confluence for documentation about booking workflows"
"Get the AI Agentic Playbook page from Confluence"
"Show me all pages in the DOCS space"
"Find pages about rate determination in Confluence"
"Get the child pages of page ID 123456"
"Sync all pages from the DOCS space to local files"
"Sync all API documentation pages matching 'API' query"
"Push markdown file document.md to Confluence"
"Push all markdown files from ./docs directory to Confluence"
Integration with AI Agents
This MCP server enables your AI agents (from the playbook) to:
Retrieve SOPs - Agents can fetch standard operating procedures
// Rate Agent example const sopContent = await mcp.call('search_confluence', { query: 'text ~ "rate calculation SOP"' });Access Knowledge Base - Build RAG pipeline with Confluence as source
// Learning Agent example const bestPractices = await mcp.call('get_page_by_title', { title: 'Best Practices - Booking Validation', spaceKey: 'DOCS' });Context-Aware Assistance - Provide agents with real-time documentation
// Exception Handler example const dgProcedure = await mcp.call('search_confluence', { query: 'DG Class 3 handling procedure', spaceKey: 'COMPLIANCE' });
Use Cases (logistics agent examples)
1. SOP Retrieval
User: "What's the DG process for Class 3 cargo?"
↓
Agent searches Confluence: search_confluence("DG Class 3 procedure")
↓
Returns: Complete SOP with approval workflow
↓
Agent answers with citations2. Master Data Validation
Booking Validator needs to check customer policies
↓
Searches: get_page_by_title("Customer X - Shipping Policy", "CUSTOMERS")
↓
Validates booking against documented policies3. Learning Agent Improvement
Learning Agent detects pattern: "50% shipper mismatches"
↓
Searches Confluence: search_confluence("shipper master data rules")
↓
Finds updated SOP: "Always use legal name, not trade name"
↓
Updates agent prompt with Confluence documentation4. Exception Handler Context
Exception: "Customs clearance delayed"
↓
Agent searches: search_confluence("customs clearance troubleshooting")
↓
Retrieves relevant procedures
↓
Suggests actions to operator with documentation linksTroubleshooting
Authentication Errors
Verify your API token is correct
Check that your email matches your Atlassian account
Ensure the token has sufficient permissions
Page Not Found
Verify the space key is correct
Check page permissions (must be readable by your account)
Try searching by ID instead of title
Connection Errors
Verify CONFLUENCE_BASE_URL format (include https://)
Check network/firewall settings
Ensure your Confluence instance is accessible
Development
# Watch mode for development
npm run dev
# Build
npm run build
# Run locally
npm startSecurity Notes
⚠️ Important Security Considerations:
API Token Storage: Never commit
.envfile to gitLeast Privilege: Create API token with minimum required permissions
Token Rotation: Rotate tokens regularly (every 90 days)
Access Logging: Monitor token usage in Atlassian audit logs
Scope Restriction: Limit access to specific spaces if possible
Roadmap
Future enhancements:
Sync Confluence docs to local markdown files
Push markdown files to Confluence (create/update pages)
Add comments to pages
Attachment download
Page versioning and history
Advanced CQL query builder
Caching layer for frequently accessed pages
Webhook integration for real-time updates
Incremental sync (only sync changed pages)
Sync with git integration
License
MIT
Related Documentation
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceAn MCP server that enables AI agents to interact with Atlassian products (Confluence and Jira) for content management, issue tracking, and project management through a standardized interface.3,5946MIT
- AlicenseBqualityDmaintenanceAn MCP server that connects AI assistants to Confluence, enabling search and fetch of pages in real time.22MIT
- Flicense-qualityDmaintenanceAn MCP server that enables AI agents to read Confluence page content by URL, supporting self-hosted Confluence with basic auth.
- AlicenseAqualityCmaintenanceMCP server for Confluence Server/Data Center (self-hosted) that gives LLM agents access to search, read, create/edit pages, comments, labels, and attachments via the Confluence REST API.1536ISC
Related MCP Connectors
MCP server for AgentDocs (agentdocs.eu): read, search, write, comment on & share Markdown docs.
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/harshpuri84/confluence-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server