Enables semantic search and question-answering over Confluence documentation by indexing pages from selected spaces and providing natural language access to the content through AI assistants.
Confluence Knowledge Base MCP Server
An MCP server that turns your Confluence documentation into an AI-powered knowledge base for Gemini CLI. Ask natural language questions about your systems and get answers from your actual documentation.
Quick Start
One-Command Setup
The interactive wizard will:
✅ Install dependencies in a virtual environment
✅ Ask for your Confluence credentials
✅ Discover your spaces
✅ Help you choose which spaces to index
✅ Build the initial knowledge base
✅ Configure Gemini CLI automatically (merges with existing config)
What You'll Need
Before running the installer:
Confluence API Token
Go to: https://id.atlassian.com/manage-profile/security/api-tokens
Click "Create API token"
Copy the token (you won't see it again!)
Your Confluence URL
Example:
https://yourcompany.atlassian.net
Python 3.8+ installed
The installer creates a virtual environment automatically (no system-wide packages needed)
Gemini CLI installed
Install from: https://github.com/google-gemini/gemini-cli
Usage
Once installed, just start Gemini CLI and ask questions:
Gemini will automatically retrieve relevant documentation and answer your questions!
How It Works
Technologies Used
FastMCP - MCP server framework
ChromaDB - Local vector database
sentence-transformers - Semantic search
Confluence REST API - Documentation retrieval
Project Structure
Configuration
After installation, configuration is stored in:
Credentials:
~/.confluence_mcp.envIndex:
~/.confluence_mcp/index/Gemini Config:
~/.gemini/settings.jsonVirtual Environment:
./venv/(in the project directory)
Updating Documentation
When your Confluence docs are updated:
Option 1: Ask Gemini
Option 2: Command line
Option 3: Automated (Weekly)
Set up a cron job (see REINDEXING_GUIDE.md)
Customization
Change indexed spaces
Edit ~/.confluence_mcp.env:
Then rebuild the index.
Adjust chunk size
In confluence_knowledge_base.py:
Change embedding model
For better quality (slower, larger):
Troubleshooting
"Connection failed"
Check that:
Your Confluence URL is correct
Your API token is valid
You have internet connectivity
"No spaces found"
You might not have access to any Confluence spaces. Ask your admin for access.
Slow indexing
Normal for large documentation sets (500+ pages). Reduce spaces or run overnight.
Wrong/outdated answers
Your index is cached! Reindex when docs are updated:
Advanced Usage
Manual space discovery
Staleness detection
Use the enhanced version with automatic staleness warnings:
Add environment variables:
Scheduled reindexing
See REINDEXING_GUIDE.md for cron job setup.
FAQ
Q: Does this modify my Confluence documentation? A: No, it's read-only. It only downloads and indexes content.
Q: Where is my data stored?
A: Locally in ~/.confluence_mcp/index/. Nothing is sent to external services except Gemini API calls.
Q: How much does it cost? A: The MCP server is free. You only pay for Gemini API usage (queries to the AI).
Q: Can I use this with Claude instead of Gemini? A: Yes! MCP is a standard protocol. Just configure Claude Desktop to use this MCP server.
Q: How often should I reindex? A: Depends on how often your docs are updated. Weekly is common. Daily if very active.
Q: Can I exclude certain pages?
A: Not by default, but you can modify confluence_knowledge_base.py to filter by title, label, etc.
Q: What about attachments/PDFs? A: Currently only page content is indexed. Attachments could be added with additional code.
Documentation
KNOWLEDGE_BASE_SETUP.md- Comprehensive setup guideREINDEXING_GUIDE.md- Strategies for keeping docs fresh
Contributing
Feel free to:
Add features (write capabilities, attachment support, etc.)
Improve chunking strategies
Add better error handling
Create additional tools
License
[Your license here]
Support
For issues or questions:
Check the troubleshooting section above
Review the detailed guides in
/docsOpen an issue on GitHub
Ready to get started? Just run:
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Turns Confluence documentation into an AI-powered knowledge base, enabling natural language questions about your systems with answers retrieved from your actual documentation through semantic search.