Confluence MCP Server
Provides search and content retrieval from LexisNexis Confluence, allowing users to query Confluence spaces, pages, blog posts, and attachments using CQL queries, with configurable result limits and bearer token authentication.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Confluence MCP Serverconfluence API documentation"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Confluence MCP Server
A Model Context Protocol (MCP) server that provides Confluence search functionality for LexisNexis internal systems:
Confluence Search - Search and retrieve content from LexisNexis Confluence
Overview
This MCP server is built using the @modelcontextprotocol/sdk and provides seamless integration with LexisNexis Confluence through standardized MCP protocols. It enables AI assistants and other MCP clients to search Confluence documentation.
Related MCP server: Confluence MCP Server
Features
🔍 Confluence Search Tool
Search across LexisNexis Confluence spaces, pages, blog posts, and attachments
Retrieve detailed content from search results
Support for CQL (Confluence Query Language) queries
Configurable search result limits
Bearer token authentication
Prerequisites
Node.js 18+
npm or pnpm package manager
TypeScript 5.3+
Access to LexisNexis internal networks (for Confluence services)
Installation
Clone the repository:
git clone <repository-url> cd confluence_mcpInstall dependencies:
npm install # or pnpm installBuild the project:
npm run build
Configuration
Environment Variables
Create a .env file in the project root with the following variables:
# Confluence Configuration
CONFLUENCE_BEARER_TOKEN=your_confluence_bearer_token_here
LIMIT=5 # Optional: Number of search results to return (default: 2)Bearer Token Setup
To use the Confluence search functionality, you'll need a valid bearer token:
Log into LexisNexis Confluence
Generate an API token
Set the
CONFLUENCE_BEARER_TOKENenvironment variable
Usage
Starting the Server
npm startThe server runs on stdio transport and will output:
Confluence MCP Server running on stdioTool Usage
Confluence Search
Tool Name: confluence-search
Description: Search Confluence using a search string. Input must start with 'confluence' (case-insensitive) followed by the search string.
Input Format:
confluence <your search terms>Examples:
confluence API documentation
confluence deployment guide
confluence troubleshootingResponse: Returns the full content of matching Confluence pages, including HTML markup.
Technical Architecture
MCP Protocol Implementation
This server implements the Model Context Protocol (MCP) specification:
Transport Layer: Uses stdio transport for communication
Message Format: JSON-RPC 2.0 protocol
Tool Registration: Dynamic tool registration with schema validation
Error Handling: Structured error responses with proper HTTP status codes
Request/Response Flow
Client Request: MCP client sends tool invocation request
Validation: Input parameters validated using Zod schemas
Processing: Tool-specific logic executed (API calls, authentication)
Response: Structured response returned with content array
Rate Limiting & Performance
Confluence API: Built-in 1-second delay between content detail requests
Concurrent Requests: Handles multiple tool invocations safely
Memory Management: Streaming responses for large content retrieval
API Endpoints
Confluence API
Base URL:
https://confluence.lexisnexis.devSearch Endpoint:
/rest/api/searchContent Endpoint:
/rest/api/content/{id}
Project Structure
confluence_mcp/
├── src/
│ └── confluence.ts # Main MCP server implementation
├── build/ # Compiled JavaScript output
│ └── confluence.js # Confluence search functionality
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── jest.config.js # Jest testing configuration
└── manifest.xml # Office add-in manifest (legacy)Development
Building
npm run buildThis compiles TypeScript files from src/ to build/ directory.
Testing
npm testNote: Tests are currently not implemented (returns "Error: no test specified").
Code Structure
The server uses the MCP SDK to:
Create an MCP Server instance for Confluence search functionality
Register tools using
server.tool()methodHandle stdio transport for communication
Implement async tool handlers with proper error handling
Key Dependencies
@modelcontextprotocol/sdk- Core MCP functionalitynode-fetch- HTTP requests to APIszod- Runtime type validation and schema validation
Advanced Configuration
Confluence Search Customization
You can customize the search behavior by modifying the CQL query in src/confluence.ts:
const cqlQuery = `siteSearch ~ "${searchString}" AND type in ("space","user","page","blogpost")`;Environment-Specific Settings
Different environments may require different configurations:
# Development
CONFLUENCE_BEARER_TOKEN=dev_token_here
LIMIT=2
# Production
CONFLUENCE_BEARER_TOKEN=prod_token_here
LIMIT=10Error Handling
The server implements comprehensive error handling:
Network Errors: Automatic retry logic for transient failures
Authentication Errors: Clear error messages for invalid credentials
Rate Limiting: Graceful handling of API rate limits
Input Validation: Schema-based validation with detailed error messages
Security Considerations
⚠️ Important Security Notes:
Credentials: Never commit bearer tokens or passwords to version control
Environment Variables: Use
.envfiles or secure environment variable managementNetwork Access: This server requires access to internal LexisNexis networks
Token Handling: Session tokens should be handled securely and not logged
Troubleshooting
Common Issues
"Invalid input" errors:
Ensure Confluence queries start with "confluence"
Authentication failures:
Check bearer token validity for Confluence
Ensure network connectivity to LexisNexis services
No search results:
Try broader search terms
Check if you have access to the Confluence spaces
Verify the LIMIT environment variable is set appropriately
Rate limiting errors:
The server implements 1-second delays between requests
For high-volume usage, consider implementing exponential backoff
Monitor API rate limits in your environment
Memory issues with large responses:
Reduce the LIMIT environment variable
Filter search results more specifically
Consider implementing response streaming for very large content
Debug Logging
The server outputs debug information to stderr:
Search queries and bearer tokens
API response statuses
Error messages and stack traces
Enable verbose logging by setting:
export DEBUG=confluence-mcp:*Performance Monitoring
Monitor key metrics:
Response times for Confluence searches
Memory usage during large content retrieval
Error rates for search operations
Integration Examples
Using with MCP Clients
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"confluence-mcp": {
"command": "node",
"args": ["c:/dev/confluence_mcp/build/confluence.js"],
"env": {
"CONFLUENCE_BEARER_TOKEN": "your_token_here",
"LIMIT": "5"
}
}
}
}Custom MCP Client
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
const transport = new StdioClientTransport({
command: 'node',
args: ['./build/confluence.js']
});
const client = new Client({
name: "confluence-client",
version: "1.0.0"
}, {
capabilities: {}
});
await client.connect(transport);License
ISC License
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests (when test framework is implemented)
Submit a pull request
Changelog
Version 1.0.0
Initial release with Confluence search tool
MCP SDK integration
TypeScript implementation
Basic error handling and logging
For more information about the Model Context Protocol, visit: https://modelcontextprotocol.io/
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mihirjoshi21/CONFLUENCE_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server