Package Exports
- confluence-developer-mcp
- confluence-developer-mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (confluence-developer-mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Confluence Developer MCP Server
A Model Context Protocol (MCP) server for fetching Confluence page content with authentication.
Features
- Confluence Integration: Fetch and parse Confluence pages with authentication
- Content Extraction: Smart content extraction and formatting from Confluence pages
- Error Handling: Comprehensive error handling with detailed error messages
- Simple Setup: Easy configuration with environment variables
Installation
Global Installation (Recommended)
npm install -g confluence-developer-mcpLocal Installation
npm install confluence-developer-mcpConfiguration
Set the required environment variable for Confluence access:
# For Confluence access
export CONFLUENCE_API_KEY="your-confluence-pat-here"Getting Confluence PAT
- Go to your Confluence profile settings
- Navigate to Personal Access Tokens
- Create a new token with appropriate permissions (read access to the pages you want to access)
IDE Configuration
Cursor IDE
Cursor has built-in MCP support. To configure the Confluence MCP server:
Open Cursor Settings
- Press
Cmd+,(macOS) orCtrl+,(Windows/Linux) - Or go to
Cursor > Preferences > Settings
- Press
Navigate to MCP Settings
- Search for "MCP" in the settings search bar
- Or go to
AI > MCP Servers
Add MCP Server Configuration
{ "mcpServers": { "confluence": { "command": "npx", "args": ["-y", "confluence-developer-mcp"], "env": { "CONFLUENCE_API_KEY": "your-confluence-pat-here" } } } }
Alternative: Using settings.json
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Type "Preferences: Open Settings (JSON)"
- Add the configuration above to your
settings.json
- Open Command Palette (
Restart Cursor
- Restart Cursor for the MCP server to be recognized
Visual Studio Code
VS Code requires the MCP extension to use MCP servers:
Install MCP Extension
- Open Extensions (
Cmd+Shift+X/Ctrl+Shift+X) - Search for "Model Context Protocol" or "MCP"
- Install the official MCP extension
- Open Extensions (
Configure MCP Server
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Type "MCP: Configure Server"
- Select "Add New Server"
- Open Command Palette (
Server Configuration
{ "name": "confluence", "command": "npx", "args": ["-y", "confluence-developer-mcp"], "env": { "CONFLUENCE_API_KEY": "your-confluence-pat-here" } }
Using settings.json (Alternative)
- Open Command Palette
- Type "Preferences: Open Settings (JSON)"
- Add to your
settings.json:
{ "mcp.servers": [ { "name": "confluence", "command": "npx", "args": ["-y", "confluence-developer-mcp"], "env": { "CONFLUENCE_API_KEY": "your-confluence-pat-here" } } ] }
Using the MCP Server in IDEs
Once configured, you can use the Confluence MCP server in your AI conversations:
Example Prompts:
- "Fetch the documentation from our Confluence page about API setup"
- "Get the latest project requirements from our Confluence space"
- "Show me the troubleshooting guide from our Confluence documentation"
Available Tools:
fetch_confluence_content: Retrieves content from any Confluence page URL
Example Usage:
User: "Get the content from https://company.atlassian.net/wiki/spaces/PROJ/pages/123456789/API+Documentation"
AI: I'll fetch that Confluence page for you using the fetch_confluence_content tool.Troubleshooting IDE Configuration
Common Issues:
Server not found
- Ensure
confluence-developer-mcpis installed globally:npm install -g confluence-developer-mcp - Check if the command is available:
confluence-developer-mcp --version
- Ensure
Authentication errors
- Verify your
CONFLUENCE_API_KEYis correct - Check if the PAT has the necessary permissions
- Ensure the PAT hasn't expired
- Verify your
Server won't start
- Check Node.js version (requires 18+)
- Verify all environment variables are set correctly
- Check the IDE's console for error messages
Permission denied
- On macOS/Linux, ensure the command is executable
- Try running:
chmod +x $(which confluence-developer-mcp)
Debug Mode: To run the server in debug mode for troubleshooting:
DEBUG=* confluence-developer-mcpUsage
As a Global Command
# Set your PAT
export CONFLUENCE_API_KEY="your-pat-here"
# Start the server
confluence-developer-mcpAs an MCP Server
The server provides the following tool:
fetch_confluence_content
Fetches content from Confluence pages with authentication.
Parameters:
url(required): The Confluence URL to fetch content from
Example:
{
"name": "fetch_confluence_content",
"arguments": {
"url": "https://confluence.company.com/display/PROJECT/Documentation"
}
}Programmatic Usage
import { MCPServer } from 'confluence-developer-mcp';
// Set environment variables
process.env.CONFLUENCE_API_KEY = "your-confluence-pat-here";
// Create and start server
const server = new MCPServer();
server.start();Development
Prerequisites
- Node.js 18+
- npm or yarn
Setup
# Clone the repository
git clone <repository-url>
cd confluence-developer-mcp
# Install dependencies
npm install
# Set your Confluence PAT
export CONFLUENCE_API_KEY="your-pat-here"
# Build the project
npm run build
# Start in development mode
npm run dev
# Start in production mode
npm startProject Structure
src/
├── config/ # Configuration management
├── services/ # Confluence service
├── tools/ # MCP tool definitions
├── types/ # TypeScript type definitions
├── index.ts # Main exports
└── server.ts # MCP server implementationEnvironment Variables
| Variable | Description | Required |
|---|---|---|
CONFLUENCE_API_KEY |
Personal Access Token for Confluence | Yes |
CONFLUENCE_BASE_URL |
Base URL for Confluence instance | No |
Error Handling
The server provides detailed error messages for various scenarios:
- 401: Authentication failed - check your PAT
- 403: Access forbidden - insufficient permissions
- 404: Page not found - check the URL
- Timeout: Request timed out - try again
- Network: Connection issues - check network connectivity
Security Notes
- Keep your PAT secure and don't commit it to version control
- Use environment variables for sensitive configuration
- The server handles tokens securely in memory
- Consider using a secrets manager for production deployments
License
MIT License - see LICENSE file for details.