Content
# Tool List
> Based on Spring Boot 4.0, this is an enterprise-level Confluence MCP server that provides standard Model Context Protocol interfaces, supporting Confluence content search and page access.
## ✨ Core Features
- **Standardized MCP Protocol**: Fully compliant with the Model Context Protocol specification
- **Enterprise-level Architecture**: Modular design with clear separation of responsibilities
- **High-performance HTTP Client**: Connection pool management and timeout control
- **Complete Test Coverage**: Unit tests + integration tests + CI/CD pipeline
- **Production-ready**: Comprehensive exception handling, log monitoring, and security configuration
## 🛠️ Technical Stack
| Component | Technology Selection |
|---------------|---------------------|
| Development Language | Java 17+ |
| Core Framework | Spring Boot 4.x |
| MCP Protocol Support | Spring AI MCP |
| Build Tool | Maven |
| Test Framework | JUnit 5, Mockito |
| HTTP Client | Apache HttpClient 5 |
## 🚀 Quick Start
### Requirements
- JDK 17 or higher
- Maven 3.6+
- Confluence server access permission
### Installation and Deployment
```bash
# 1. Clone the project
git clone https://github.com/your-org/confluence-mcp-server.git
cd confluence-mcp-server
# 2. Build the project
mvn clean package
# 3. Configure environment variables
export CONFLUENCE_URL=your_confluence_url
export CONFLUENCE_USERNAME=your_username
export CONFLUENCE_PASSWORD=your_password
# 4. Run the application
java -jar target/confluence-mcp-server-*.jar
# Development mode
mvn spring-boot:run
```
## ⚙️ Configuration Instructions
Create `application.yml` or use environment variables:
```yaml
server:
port: 9091
spring:
application:
name: confluence-mcp-server
ai:
mcp:
server:
enabled: true
name: confluence_mcp_server
version: 1.0.0
sse-endpoint: /mcp/sse
sse-message-endpoint: /api/v1/mcp
confluence:
url: ${CONFLUENCE_URL:https://your-confluence.com}
username: ${CONFLUENCE_USERNAME}
password: ${CONFLUENCE_PASSWORD}
default-space: ${CONFLUENCE_DEFAULT_SPACE:RP}
default-content-type: ${CONFLUENCE_DEFAULT_CONTENT_TYPE:page,blogpost}
default-search-limit: ${CONFLUENCE_DEFAULT_SEARCH_LIMIT:10}
connection-timeout: ${CONFLUENCE_CONNECTION_TIMEOUT:30000}
read-timeout: ${CONFLUENCE_READ_TIMEOUT:30000}
```
## 📡 MCP Tool Interface
### searchConfluence
Search for content in Confluence
**Parameters:**
- `searchKeyword`: Search keyword (required)
- `space`: Space identifier
- `contentType`: Content type (page/blogpost)
- `limit`: Result quantity limit
### getConfluencePage
Get the content of a specified page
**Parameters:**
- `pageId`: Confluence page ID (required)
## 🏗️ Project Structure
```
src/
├── main/
│ ├── java/com/confluence/mcp/
│ │ ├── config/ # Configuration classes
│ │ │ ├── ConfluenceConfig.java
│ │ │ ├── HttpClientConfig.java
│ │ │ └── McpConfig.java
│ │ ├── exception/ # Exception handling
│ │ │ ├── ConfluenceException.java
│ │ │ └── ExceptionHandlerUtil.java
│ │ ├── tool/ # MCP tool implementation
│ │ │ └── ConfluenceTool.java
│ │ ├── util/ # Utility classes
│ │ │ ├── HttpClientUtil.java
│ │ │ └── JsonParserUtil.java
│ │ └── ConfluenceMcpServerApplication.java
│ └── resources/
│ └── application.yml
└── test/
└── java/com/confluence/mcp/
└── tool/ # Test classes
├── ConfluenceToolMockTest.java
└── ConfluenceToolTest.java
```
## 🧪 Testing
```bash
# Run all tests
mvn test
# Run a specific test class
mvn test -Dtest=ConfluenceToolTest
# Generate test report
mvn jacoco:report
```
## 🔧 Development Specifications
- **Code Style**: Follow the Google Java style guide
- **Exception Handling**: Unified use of ConfluenceException business exceptions
- **Logging Specifications**: SLF4J + unified format
- **Configuration Management**: Environment variables inject sensitive information
## 📦 CI/CD Process
GitHub Actions automation pipeline includes:
1. Code compilation and dependency checking
2. Unit testing and integration testing
3. Code quality scanning
4. Security vulnerability detection
## 🚨 Security Considerations
- 🔐 Use environment variables to manage Confluence credentials
- 🛡️ Validate and filter all input parameters
- ⏱️ Configure reasonable network timeouts
- 📊 Enable detailed access logs and monitoring
## 📄 License
MIT License - see [LICENSE](LICENSE) file
## 🤝 Contribution
Feel free to submit issues and pull requests! Before contributing, ensure:
- Code complies with project code style
- Includes corresponding unit tests
- Updates relevant documentation