@yogeshrathod/confluence-mcp
v1.0.1
Published
MCP Server for Atlassian Confluence Wiki (Self-Hosted)
Maintainers
Readme
Confluence MCP Server
A Model Context Protocol (MCP) server for Atlassian Confluence Wiki (Self-Hosted), built with TypeScript and Node.js. Provides comprehensive tools for space management, page operations, search, labels, comments, attachments, and more.
✨ Features
- Space Management: List, get, create, and delete spaces
- Page Operations: Create, read, update, delete, and move pages
- Search: Search using CQL (Confluence Query Language) or text queries
- Labels: Add, remove, and search by labels
- Comments: Get and add comments on pages
- Attachments: List, get, and delete attachments
- Version History: View page history and retrieve specific versions
- Users: Search users and get user details
- Templates: List and retrieve page templates
- Watchers: Manage page watchers
- Permissions: View page restrictions
📋 Prerequisites
- Node.js 18+
- Self-hosted Confluence instance
- Personal Access Token (PAT) for authentication
🚀 Installation
Using npm (Global)
npm install -g confluence-mcpFrom Source
git clone <repository-url>
cd wikimcp
npm install
npm run build⚙️ Configuration
Getting a Personal Access Token
- Log into your Confluence instance
- Go to Profile → Personal Access Tokens
- Click Create token
- Give it a name and set appropriate permissions
- Copy the generated token
Environment Variables
Create a .env file in the project root:
CONFLUENCE_BASE_URL=https://your-confluence-instance.com
PAT=your-personal-access-tokenMCP Client Configuration
Add to your MCP client configuration (e.g., Claude Desktop). If you installed globally with npm or ran via npx, point to the binary name instead of the local dist file:
{
"mcpServers": {
"confluence": {
"command": "node",
"args": ["/path/to/wikimcp/dist/index.js"],
"env": {
"CONFLUENCE_BASE_URL": "https://your-confluence-instance.com",
"PAT": "your-personal-access-token"
}
}
}
}Or if installed globally via npm:
{
"mcpServers": {
"confluence": {
"command": "confluence-mcp",
"env": {
"CONFLUENCE_BASE_URL": "https://your-confluence-instance.com",
"PAT": "your-personal-access-token"
}
}
}
}Or run it directly with npx (no global install needed):
{
"mcpServers": {
"confluence": {
"command": "npx",
"args": ["@yogeshrathod/confluence-mcp"],
"env": {
"CONFLUENCE_BASE_URL": "https://your-confluence-instance.com",
"PAT": "your-personal-access-token"
}
}
}
}📖 Usage
Running the Server
# Development mode
npm run dev
# Production mode
npm run build
npm startQuick start with npx
If you just want to try the MCP server without cloning the repo, run it directly via npx (Node 18+):
CONFLUENCE_BASE_URL="https://your-confluence-instance" \
PAT="your-personal-access-token" \
npx @yogeshrathod/confluence-mcpThis will download the published package, read the environment variables, and start the server on stdio so it can be discovered by your MCP-compatible client (e.g., Claude Desktop). When using npx, remember to keep the terminal session open because it hosts the MCP process.
🛠️ Available Tools (38 total)
Connection
confluence_test_connection- Test connection to Confluence APIconfluence_get_current_user- Get the current authenticated user
Spaces
confluence_get_spaces- List all spacesconfluence_get_space- Get space detailsconfluence_create_space- Create a new spaceconfluence_delete_space- Delete a space
Pages
confluence_get_page- Get a page by IDconfluence_get_page_by_title- Get a page by title within a spaceconfluence_get_pages- List pages with filtersconfluence_create_page- Create a new pageconfluence_update_page- Update an existing pageconfluence_delete_page- Delete a pageconfluence_move_page- Move a page to different locationconfluence_get_page_children- Get child pagesconfluence_get_page_ancestors- Get ancestor pages (breadcrumb)
Search
confluence_search- Search using CQLconfluence_search_content- Search by text query
Labels
confluence_get_labels- Get labels on contentconfluence_add_labels- Add labels to contentconfluence_remove_label- Remove a labelconfluence_get_content_by_label- Find content by label
Comments
confluence_get_comments- Get comments on a pageconfluence_add_comment- Add a comment to a page
Attachments
confluence_get_attachments- Get attachments on a pageconfluence_get_attachment- Get attachment detailsconfluence_delete_attachment- Delete an attachment
History
confluence_get_page_history- Get page version historyconfluence_get_page_version- Get specific page version
Users
confluence_search_users- Search for usersconfluence_get_user- Get user details
Permissions
confluence_get_page_restrictions- Get page restrictions
Templates
confluence_get_templates- List available templatesconfluence_get_template- Get template details
Watchers
confluence_get_watchers- Get page watchersconfluence_add_watcher- Add a watcherconfluence_remove_watcher- Remove a watcher
📚 Resources
The server also exposes the following MCP resources:
confluence://spaces- List of all Confluence spacesconfluence://current-user- Current authenticated user info
🔍 Example CQL Queries
# Find all pages in a space
space = "MYSPACE" AND type = page
# Find pages modified in the last week
lastModified >= now("-1w")
# Find pages with a specific label
label = "documentation"
# Find pages created by a user
creator = "username"
# Full-text search
text ~ "search term"
# Combined query
space = "DEV" AND type = page AND label = "api" AND lastModified >= now("-30d")🤝 Contributing
Development Setup
- Clone the repository
- Install dependencies:
npm install - Create
.envfile with your configuration - Run in development mode:
npm run dev
Building
npm run buildReporting Issues
Please include:
- Confluence version
- Node.js version
- Error messages
- Steps to reproduce
📄 License
MIT
🙏 Acknowledgments
- Built following the patterns from BitbucketMCP and JiraMCP
- Uses the Model Context Protocol SDK
- For Atlassian Confluence REST API documentation, see Confluence REST API
