lczc1988/confluence-mcp-server
If you are the rightful owner of confluence-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A comprehensive Model Context Protocol (MCP) server that integrates with Confluence and Splunk for documentation management and log analysis.
Confluence + Splunk MCP Server
A comprehensive Model Context Protocol (MCP) server that provides integration with both Confluence and Splunk, allowing you to manage documentation, search logs, and monitor systems through GitHub Copilot and other MCP-compatible clients.
🌟 Features
Confluence Integration
- Page Management: Create, read, update, and delete Confluence pages
- Space Management: Get space information and list all spaces
- Content Search: Search for pages using Confluence Query Language (CQL)
- Full API Integration: Complete integration with Confluence REST API
Splunk Integration ✨ NEW
- Log Search: Search logs using Splunk Processing Language (SPL)
- Index Management: List and explore available Splunk indexes
- Alert Management: Create and manage Splunk alerts/saved searches
- Real-time Monitoring: Monitor system health and security events
- Performance Analytics: Analyze application and infrastructure performance
- 🏢 Ford SSO Support: Specialized integration for Ford's Splunk environment
Server Options
- Confluence-only server: For pure documentation management
- Splunk-only server: For pure log analysis and monitoring
- Ford Splunk server: Optimized for Ford's SSO environment
- Combined server: Unified access to both Confluence and Splunk (recommended)
🚀 Quick Start
- Clone and Install:
git clone <repository-url>
cd confluencemcplocal
npm install
- Configure Services:
cp .env.example .env
# Edit .env with your Confluence and/or Splunk credentials
- Build and Test:
npm run build
# Test Confluence (if configured)
./interactive-test.sh
# Test Splunk (if configured)
./splunk-quick-test.sh
# Test Ford Splunk (if using Ford SSO)
./ford-splunk-test.sh
# Run interactive demo
./splunk-demo.sh
- Start the Server:
# Combined server (recommended)
npm run start:combined
# Or individual servers
npm run start:confluence
npm run start:splunk
npm run start:ford-splunk # For Ford SSO environment
⚙️ Configuration
Environment Variables
Create a .env file with your service credentials:
# Confluence Configuration (optional)
CONFLUENCE_BASE_URL=https://your-domain.atlassian.net
CONFLUENCE_USERNAME=your-email@example.com
CONFLUENCE_API_TOKEN=your-confluence-api-token
# Splunk Configuration (optional)
SPLUNK_BASE_URL=https://your-splunk-instance.com:8089
SPLUNK_USERNAME=your-splunk-username
SPLUNK_PASSWORD=your-splunk-password
SPLUNK_DEFAULT_INDEX=main
# Ford Splunk SSO Configuration (for Ford environments)
SPLUNK_BASE_URL=https://ford-splunk-instance.ford.com:8089
SPLUNK_AUTH_METHOD=token # or 'basic', 'session'
SPLUNK_API_TOKEN=your-ford-splunk-api-token
SPLUNK_DEFAULT_INDEX=main
Getting API Credentials
Confluence API Token
- Go to Atlassian API tokens
- Click "Create API token"
- Give it a label and copy the generated token
- Use your email as the username
Splunk Credentials
- Use your existing Splunk username and password
- Ensure your user has search permissions for the indexes you want to query
- For production use, consider creating a dedicated service account
🔧 Usage
Available Scripts
# Build the project
npm run build
# Start individual servers
npm run start:confluence # Confluence only
npm run start:splunk # Splunk only
npm run start:combined # Both services (recommended)
# Development mode with auto-rebuild
npm run dev
# Testing scripts
./interactive-test.sh # Test Confluence integration
./splunk-quick-test.sh # Quick Splunk connectivity test
./splunk-interactive-test.sh # Interactive Splunk testing
./splunk-demo.sh # Comprehensive demo scenarios
Testing Your Setup
- Quick connectivity test:
./splunk-quick-test.sh
- Interactive testing:
./splunk-interactive-test.sh
- Full demo with real-world scenarios:
./splunk-demo.sh
{
"servers": {
"confluence-mcp": {
"type": "stdio",
"command": "node",
"args": ["/Users/chao/Documents/workspace/confluencemcp/dist/index.js"],
"env": {
"CONFLUENCE_BASE_URL": "https://your-domain.atlassian.net",
"CONFLUENCE_USERNAME": "your-email@example.com",
"CONFLUENCE_API_TOKEN": "your-api-token"
}
}
}
}
-
重启VS Code,MCP server将自动可用于GitHub Copilot。
-
现在你可以在Copilot Chat中使用Confluence相关的命令!
🚀 GitHub Copilot 使用指南
基础语法
@mcp [操作] [参数]
常用命令示例
# 列出所有Confluence空间
@mcp list spaces
# 搜索页面
@mcp search "Authorization"
# 在特定空间中搜索
@mcp search "API" in space:CDL
# 获取页面详情
@mcp get page:607043116
# 创建新页面
@mcp create page in space:CDL title:"新文档" content:"内容"
🎯 实际使用示例
用户: @mcp search "authorization" in space:CDL
Copilot: 在 Chinese Dev Lab 空间中找到 3 个关于授权的页面:
1. 1.3.1 Authorization - 用户授权流程详细说明
2. 1.3 Auth/De-auth - 授权和去授权流程
3. Authorization Overview - 授权概览文档
📚 详细使用指南: 查看 GITHUB_COPILOT_MCP_GUIDE.md 获取完整的命令参考
📋 快速参考: 查看 MCP_QUICK_REFERENCE.md 获取常用命令
验证安装
运行快速测试脚本:
./quick-test.sh
或手动测试:
echo '{}' | node dist/index.js
你应该看到输出:"Confluence MCP server running on stdio"
Available Tools
get_page
Retrieve a Confluence page by its ID.
Parameters:
pageId(string): The ID of the page to retrieveexpand(string, optional): Comma-separated list of properties to expand
search_pages
Search for Confluence pages using CQL.
Parameters:
cql(string): Confluence Query Language query stringlimit(number, optional): Maximum number of results (default: 10)
Example CQL queries:
text ~ "keyword"- Search for pages containing a keywordspace = "SPACE_KEY"- Find pages in a specific spacetitle ~ "title*"- Search by title pattern
create_page
Create a new Confluence page.
Parameters:
spaceKey(string): The key of the space to create the page intitle(string): The title of the new pagecontent(string): The content in storage format (HTML)parentId(string, optional): Optional parent page ID
update_page
Update an existing Confluence page.
Parameters:
pageId(string): The ID of the page to updatetitle(string): The new title for the pagecontent(string): The new content in storage format (HTML)versionNumber(number): The current version number of the page
delete_page
Delete a Confluence page.
Parameters:
pageId(string): The ID of the page to delete
get_space
Get information about a Confluence space.
Parameters:
spaceKey(string): The key of the space to retrieveexpand(string, optional): Comma-separated list of properties to expand
list_spaces
List all Confluence spaces.
Parameters:
limit(number, optional): Maximum number of spaces to return (default: 10)start(number, optional): Starting index for pagination (default: 0)
Development
# Watch mode for development
npm run dev
# Build the project
npm run build
# Run the built project
npm start
Error Handling
The server includes comprehensive error handling for:
- Invalid Confluence API credentials
- Network connectivity issues
- Invalid page/space IDs
- Permission errors
- Malformed requests
All errors are returned as proper MCP error responses with descriptive messages.
Security Notes
- Never commit API tokens to version control
- Use environment variables for all sensitive configuration
- Consider using OAuth 2.0 for production deployments
- Regularly rotate API tokens
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
ISC License - see LICENSE file for details.