mcp server atlassian confluence
A Model Context Protocol server that enables AI assistants like Claude to access and search Atlassian Confluence content, allowing integration with your organization's knowledge base.
A Model Context Protocol server that enables AI assistants like Claude to access and search Atlassian Confluence content, allowing integration with your organization's knowledge base.
This project provides a Model Context Protocol (MCP) server that acts as a bridge between AI assistants (like Anthropic's Claude, Cursor AI, or other MCP-compatible clients) and your Atlassian Confluence instance. It allows AI to securely access and interact with your Confluence spaces and pages in real-time.
Model Context Protocol (MCP) is an open standard enabling AI models to connect securely to external tools and data sources. This server implements MCP specifically for Confluence.
Benefits:
This MCP server provides the following tools for your AI assistant:
List Spaces (list-spaces
)
{}
(no parameters needed for basic list) or { type: "global", status: "current" }
(to filter).Get Space (get-space
)
{ spaceKey: "DEV" }
List Pages (list-pages
)
list-spaces
first if you only know the key).{ spaceId: ["123456"] }
or { status: ["archived"], query: "Meeting Notes" }
.Get Page (get-page
)
list-pages
or search
) and need to read, analyze, or summarize its content.{ pageId: "12345678" }
Search (search
)
{ cql: "label = meeting-notes AND created > -7d" }
This server follows a "Minimal Interface, Maximal Detail" approach:
pageId
, spaceKey
, cql
).get-page
), the server provides all relevant information by default (content, labels, links, etc.) without needing extra flags.Follow these steps to connect your AI assistant to Confluence:
Important: Treat your API token like a password. Do not share it or commit it to version control.
mcp-confluence-access
).Choose one of the following methods:
This keeps credentials separate and organized.
~/.mcp/
~/.mcp/configs.json
Add the configuration: Paste the following JSON structure, replacing the placeholders:
{
"@aashari/mcp-server-atlassian-confluence": {
"environments": {
"ATLASSIAN_SITE_NAME": "<YOUR_SITE_NAME>",
"ATLASSIAN_USER_EMAIL": "<YOUR_ATLASSIAN_EMAIL>",
"ATLASSIAN_API_TOKEN": "<YOUR_COPIED_API_TOKEN>"
}
}
// Add other servers here if needed
}
<YOUR_SITE_NAME>
: Your Confluence site name (e.g., mycompany
for mycompany.atlassian.net
).<YOUR_ATLASSIAN_EMAIL>
: Your Atlassian account email.<YOUR_COPIED_API_TOKEN>
: The API token from Step 1.Set environment variables when running the server.
ATLASSIAN_SITE_NAME="<YOUR_SITE_NAME>" nATLASSIAN_USER_EMAIL="<YOUR_EMAIL>" nATLASSIAN_API_TOKEN="<YOUR_API_TOKEN>" nnpx -y @aashari/mcp-server-atlassian-confluence
Configure your MCP client (Claude Desktop, Cursor, etc.) to run this server.
Add or merge into mcpServers
:
{
"mcpServers": {
"aashari/mcp-server-atlassian-confluence": {
"command": "npx",
"args": ["-y", "@aashari/mcp-server-atlassian-confluence"]
}
// ... other servers
}
}
Save and Restart Claude Desktop.
Cmd+Shift+P
/ Ctrl+Shift+P
) > Cursor Settings > MCP.aashari/mcp-server-atlassian-confluence
command
npx -y @aashari/mcp-server-atlassian-confluence
You can now ask your AI assistant questions related to your Confluence instance:
label = meeting-notes AND created > -7d
"search
or list-pages
first to find the page ID).You can also use this package directly from your terminal. Ensure credentials are set first (Method A or B above).
npx
npx -y @aashari/mcp-server-atlassian-confluence list-spaces
npx -y @aashari/mcp-server-atlassian-confluence get-page --page 123456
npx -y @aashari/mcp-server-atlassian-confluence search --cql "type=page AND text~API" --limit 10
npm install -g @aashari/mcp-server-atlassian-confluence
mcp-atlassian-confluence
command:mcp-atlassian-confluence list-spaces --limit 5
mcp-atlassian-confluence get-space --space DEV
mcp-atlassian-confluence list-pages --space-id 12345 --status archived
mcp-atlassian-confluence --help # See all commands
ATLASSIAN_SITE_NAME
, ATLASSIAN_USER_EMAIL
, and ATLASSIAN_API_TOKEN
in ~/.mcp/configs.json
or environment variables.npx ...
) is correct in your client's config.npx
command directly in your terminal for error messages.pageId
(must be numeric) or spaceKey
is correct.DEBUG=true
environment variable (e.g., add "DEBUG": "true"
in configs.json
or run DEBUG=true npx ...
).Contributions are welcome! If you'd like to contribute:
.cursorrules
or code comments for details.npm install
. Use npm run dev:server
or npm run dev:cli -- <command>
.npm run lint
and npm run format
.npm test
.This project (@aashari/mcp-server-atlassian-confluence
) follows Semantic Versioning and is versioned independently from other @aashari/mcp-server-*
packages.
[
{
"description": "List Confluence spaces with optional filtering capabilities.nnPURPOSE: Discovers available spaces in your Confluence instance with their keys, names, types, and URLs.nnWHEN TO USE:n- When you need to discover what spaces exist in your Confluence instancen- When you want to find spaces by type (global, personal, archived)n- When you need to browse available spaces before accessing specific pagesn- When you need space keys for use with other Confluence toolsnnWHEN NOT TO USE:n- When you already know the specific space key/ID (use get-space instead)n- When you need detailed information about a specific space (use get-space instead)n- When you need to find content across multiple spaces (use search instead)n- When you need to list pages within a specific space (use list-pages instead)nnRETURNS: Formatted list of spaces with IDs, keys, names, types, and URLs, plus pagination info.nnEXAMPLES:n- List all spaces: {}n- Filter by type: {type: "global"}n- With pagination: {limit: 10, cursor: "next-page-token"}nnERRORS:n- Authentication failures: Check your Confluence credentialsn- No spaces found: Verify your permissions in Confluencen- Rate limiting: Use pagination and reduce query frequency",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cursor": {
"description": "Pagination cursor for retrieving the next set of results. Use this to navigate through large result sets. The cursor value can be obtained from the pagination information in a previous response.",
"type": "string"
},
"limit": {
"description": "Maximum number of spaces to return (1-250). Use this to control the response size. Useful for pagination or when you only need a few results.",
"maximum": 250,
"minimum": 1,
"type": "number"
},
"status": {
"description": "Filter spaces by status. Options: "current" (active spaces) or "archived" (inactive spaces). Defaults to "current" if not specified.",
"enum": [
"current",
"archived"
],
"type": "string"
},
"type": {
"description": "Filter spaces by type. Options: "global" (company-wide spaces), "personal" (user-specific spaces), "collaboration" (team spaces), or "knowledge_base" (documentation spaces). Defaults to "global" if not specified.",
"enum": [
"global",
"personal",
"collaboration",
"knowledge_base"
],
"type": "string"
}
},
"type": "object"
},
"name": "list-spaces"
},
{
"description": "Get detailed information about a specific Confluence space by ID or key.nnPURPOSE: Retrieves comprehensive space metadata including description, homepage, permissions, and more.nnWHEN TO USE:n- When you need detailed information about a specific spacen- When you need to find the homepage or key pages within a spacen- When you need to verify space permissions or settingsn- After using list-spaces to identify the relevant spacennWHEN NOT TO USE:n- When you don't know which space to look for (use list-spaces first)n- When you need to browse multiple spaces (use list-spaces instead)n- When you need to find specific content (use search or list-pages instead)nnRETURNS: Detailed space information including key, name, description, type, homepage, and metadata.nnEXAMPLES:n- By key: {idOrKey: "DEV"}n- By ID: {idOrKey: "123456"}nnERRORS:n- Space not found: Verify the space key or ID is correctn- Permission errors: Ensure you have access to the requested spacen- Rate limiting: Cache space information when possible",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "The numeric ID of the Confluence space to retrieve (e.g., "123456"). This is required and must be a valid space ID from your Confluence instance.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"name": "get-space"
},
{
"description": "List Confluence pages with optional filtering by space and status.nnPURPOSE: Finds pages within Confluence spaces with their IDs, titles, and locations to help you discover available content.nnWHEN TO USE:n- When you need to find pages within a specific spacen- When you want to list the most recently updated contentn- When you need to browse available pages before accessing specific contentn- When you need page IDs for use with other Confluence toolsn- When looking for pages with specific statuses (current, draft, trashed)nnWHEN NOT TO USE:n- When you already know the specific page ID (use get-page instead)n- When you need the actual content of a page (use get-page instead)n- When you need to search across multiple spaces (use search instead)n- When you need to find spaces rather than pages (use list-spaces instead)nnRETURNS: Formatted list of pages with IDs, titles, space information, and URLs, plus pagination info.nnEXAMPLES:n- Pages in a space: {spaceId: "DEV"}n- With status filter: {spaceId: "DEV", status: "current"}n- With pagination: {spaceId: "DEV", limit: 10, cursor: "next-page-token"}nnERRORS:n- Space not found: Verify the space ID is correctn- Authentication failures: Check your Confluence credentialsn- No pages found: The space might be empty or you lack permissionsn- Rate limiting: Use pagination and reduce query frequency",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cursor": {
"description": "Pagination cursor for retrieving the next set of results. Use this to navigate through large result sets. The cursor value can be obtained from the pagination information in a previous response.",
"type": "string"
},
"limit": {
"description": "Maximum number of pages to return (1-250). Use this to control the response size. Useful for pagination or when you only need a few results. The Confluence API caps results at 250 items per request.",
"maximum": 250,
"minimum": 1,
"type": "number"
},
"spaceId": {
"description": "Filter pages by space IDs. Provide an array of space IDs (e.g., ["123456", "789012"]) to only show pages from specific spaces. Useful when you want to focus on content from particular projects or teams.",
"items": {
"type": "string"
},
"type": "array"
},
"status": {
"description": "Filter pages by status. Options include: "current" (published pages), "trashed" (pages in trash), "deleted" (permanently deleted), "draft" (unpublished drafts), "archived" (archived pages), or "historical" (previous versions). Defaults to "current" if not specified. Provide as an array to include multiple statuses.",
"items": {
"enum": [
"current",
"trashed",
"deleted",
"draft",
"archived",
"historical"
],
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"name": "list-pages"
},
{
"description": "Get detailed information and content of a specific Confluence page by ID.nnPURPOSE: Retrieves the full content of a page in Markdown format along with comprehensive metadata.nnWHEN TO USE:n- When you need to read the actual content of a pagen- When you need detailed page metadata (author, dates, versions)n- When you need to extract specific information from a pagen- After using list-pages or search to identify relevant page IDsnnWHEN NOT TO USE:n- When you don't know which page to look for (use list-pages or search first)n- When you only need basic page information without content (use list-pages instead)n- When you need to find content across multiple pages (use search instead)nnRETURNS: Complete page content in Markdown format with metadata including title, author, version, space, and creation/modification dates.nnEXAMPLES:n- By ID: {id: "123456"}nnERRORS:n- Page not found: Verify the page ID is correctn- Permission errors: Ensure you have access to the requested pagen- Rate limiting: Cache page content when possible for frequently accessed pages",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "The numeric ID of the Confluence page to retrieve (e.g., "456789"). This is required and must be a valid page ID from your Confluence instance. The page content will be returned in Markdown format for easy reading.",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"name": "get-page"
},
{
"description": "Search for content across Confluence using Confluence Query Language (CQL).nnPURPOSE: Finds content matching specific criteria with excerpts showing matches, helping you discover relevant information across spaces.nnWHEN TO USE:n- When you need to find specific content across multiple spacesn- When you want to search by various criteria (text, title, labels, content type)n- When you need to gather information scattered across different pagesn- When you're unfamiliar with the structure of Confluence and need discoveryn- When looking for content with specific labels or within specific date rangesnnWHEN NOT TO USE:n- When you already know the exact space and page (use get-page instead)n- When you want to list all spaces or pages systematically (use list-spaces/list-pages)n- When performing many rapid, consecutive searches (consider rate limits)n- When you need to retrieve complete page content (use get-page after search)nnRETURNS: Search results with titles, excerpts showing matches, content types, spaces, and URLs, plus pagination info.nnEXAMPLES:n- Simple text search: {cql: "text~documentation"}n- Space-specific search: {cql: "space=DEV AND text~API"}n- Title search: {cql: "title~Project Plan"}n- Content type filter: {cql: "type=page AND label=important"}n- With pagination: {cql: "text~API", limit: 10, cursor: "next-page-token"}nnERRORS:n- Invalid CQL syntax: Check CQL syntax (example: "type=page AND space=DEV")n- No results: Try broader search terms or check different spacesn- Authentication failures: Check your Confluence credentialsn- Rate limiting: Use more specific queries and pagination",
"inputSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cql": {
"description": "The Confluence Query Language (CQL) query to search for. This is a powerful query language that allows you to search for content based on various criteria. Examples:n- Search by space: "space=DEV AND type=page"n- Search by title: "title~Project AND type=page"n- Search by content: "text~API AND type=page"n- Search by label: "label=documentation AND type=page"n- Combined search: "space=DEV AND title~Project AND created>=2023-01-01"",
"type": "string"
},
"cursor": {
"description": "Pagination cursor for retrieving the next set of results. Use this to navigate through large result sets. The cursor value can be obtained from the pagination information in a previous response.",
"type": "string"
},
"limit": {
"description": "Maximum number of results to return (1-100). Use this to control the response size. Useful for pagination or when you only need a few results. The Confluence API may have its own limits on the number of results returned.",
"maximum": 100,
"minimum": 1,
"type": "number"
}
},
"required": [
"cql"
],
"type": "object"
},
"name": "search"
}
]