mcp-confluence-platform-interface
Facilitate interaction with Confluence Data Center content via its established REST API layer, enabling programmatic execution of tasks such as content retrieval, querying, genesis, modification, and eradication through natural language interpretation.
Author

masna-ai
Quick Info
Actions
Tags
Confluence Model Context Protocol Adapter
This implementation serves as an MCP (Model Context Protocol) adapter specifically engineered to interface with Confluence Data Center environments utilizing the underlying RESTful web services infrastructure. It furnishes a suite of functional components allowing sophisticated AI agents to manipulate and query Confluence assets.
Core Capabilities
This specialized MCP adapter exposes the following operative functions for Confluence management:
- Execution of queries formulated using CQL (Confluence Query Language)
- Fetching the raw textual payload of a designated page via its unique identifier
- Retrieving a page, including its complete body markup
- Locating pages based on their associated space key identifier
- Pinpointing a specific page by referencing both its title string and parent space key
- Provisioning new documentation pages (with optional specification of a parent document ID)
- Overwriting or refreshing the attributes of existing documentation assets
- Permanent disposal of a specified page entity
Deployment Procedure
- Obtain a local copy of this code repository.
- Install required software dependencies:
bash pip install -r requirements.txt
Configuration Prerequisites
Establish a configuration file named .env within the primary project directory, populating it with the following necessary environment variables:
CONFLUENCE_API_BASE=http://localhost:8090/rest/api CONFLUENCE_USERNAME=your_username CONFLUENCE_PASSWORD=your_password
Ensure these parameters accurately reflect the settings of your target Confluence deployment.
Server Initiation Protocols
Preferred Method: Development Mode
The prescribed methodology for launching this MCP adapter involves leveraging the MCP Command Line Interface (CLI) utility with the development flag. This action bootstraps the MCP Inspector graphical interface, which is invaluable for iterative testing and debugging:
bash mcp dev confluence.py
This command typically launches the Inspector utility accessible via the address http://127.0.0.1:6274 by default.
Alternative Method: Direct Script Invocation (Not Advised)
MCP adapters are architected primarily for integration with the MCP CLI or companion applications like Claude Desktop. Direct execution via the Python interpreter is not the standard operational paradigm, though a fallback mechanism exists for rudimentary validation:
bash python confluence.py
Be aware that this mode offers circumscribed functionality, intended strictly for minimal testing purposes.
Integration with Claude Desktop
To incorporate this adapter into the Claude Desktop environment:
bash mcp install confluence.py
Function Reference
execute_cql_search
Executes a CQL search string against the Confluence repository.
Arguments:
- cql: The CQL search expression (textual).
- limit: The maximum count of results to be returned (defaults to 10).
get_page_content
Retrieves the underlying data structure of a Confluence page.
Arguments:
- pageId: The unique numerical identifier assigned to the Confluence page.
get_page_with_body
Fetches a Confluence page, including its rendered body content.
Arguments:
- pageId: The unique numerical identifier assigned to the Confluence page.
find_pages_by_space
Discovers documentation pages associated with a specified Confluence space identifier.
Arguments:
- spaceKey: The organizational key designating the Confluence space.
- limit: The ceiling on the number of resultant pages (defaults to 10).
- expand: An optional, comma-delimited string detailing additional attributes to enrich the response data.
find_page_by_title
Pinpoints a documentation page using both its given title and its containing space key.
Arguments:
- title: The precise title string of the target page.
- spaceKey: The organizational key designating the Confluence space.
create_page
Instantiates a novel documentation page within the Confluence instance.
Arguments:
- title: The desired title for the new document.
- spaceKey: The key of the space where the page should reside.
- content: The page markup, typically formatted as HTML storage syntax.
- parentId: Identifier of an optional parent page under which the new page will be nested.
update_page
Modifies the attributes or content of an extant documentation page.
Arguments:
- pageId: The unique numerical identifier of the page targeted for revision.
- content: The novel content payload in storage format (HTML).
- title: An optional parameter to set a new title for the page.
- spaceKey: An optional space key (only required if the page is being relocated to a different space).
delete_page
Removes a specified page entity based on its unique ID.
Arguments:
- pageId: The unique numerical identifier of the page to be erased.
Illustrative Interactions
Upon successful deployment and connection to an AI agent, users can formulate directives to Confluence using natural language constructs. Examples include:
- "List all documents residing within the 'DOCS' project area"
- "Retrieve the full content payload for the asset identified as 123456"
- "Generate a fresh document named 'Meeting Notes' inside the 'TEAM' space, containing the text '
Summary of our discussion
'." - "Apply modifications to page 123456, setting its content to '
Revised minutes from the session
'." - "Modify the designation of page 123456 to 'Finalized Meeting Minutes'"
Licensing Details
Distributed under the terms of the MIT License.
WIKIPEDIA: XMLHttpRequest (XHR) represents an Application Programming Interface implemented as a JavaScript object, facilitating the transmission of HTTP requests from a web browser environment to a backend web server. The utility methods provided allow client-side applications to dispatch server inquiries subsequent to initial page load and subsequently receive data back. XMLHttpRequest forms a foundational element of Ajax programming methodologies. Preceding the widespread adoption of Ajax, the standard mechanisms for server interaction were primarily reliant upon traditional hyperlinks and HTML form submissions, actions which typically mandated a complete page refresh.
== Historical Context == The underlying concept for XMLHttpRequest was first conceived around the year 2000 by engineers associated with Microsoft Outlook development. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). Nevertheless, the initial syntactic implementation did not employ the standardized XMLHttpRequest identifier. Instead, developers relied upon instantiating objects using the identifiers ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP"). By the time Internet Explorer 7 was released (2006), broad compliance across all major browser engines had been achieved using the unified XMLHttpRequest identifier. The XMLHttpRequest identifier has since solidified its position as the de facto standard across the primary web browsing platforms, including Mozilla's Gecko rendering engine (adopted in 2002), Safari version 1.2 (2004), and Opera version 8.0 (2005).
=== Formal Standardization === The World Wide Web Consortium (W3C) published its initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. Subsequently, on February 25, 2008, the W3C issued the Working Draft specification for Level 2. This Level 2 iteration introduced crucial capabilities such as monitoring the progress of events, enabling cross-origin requests (cross-site requests), and managing binary byte streams. By the close of 2011, the Level 2 specification components were fully merged back into the primary specification document. At the conclusion of 2012, responsibility for maintaining the standard transitioned to the WHATWG consortium, which now maintains a continuously updated specification document utilizing Web IDL definitions.
== Operational Use Cases == Generally, initiating a data request using XMLHttpRequest involves a sequence of distinct programming stages.
Instantiation of an XMLHttpRequest object is achieved by invoking its constructor method: Configuration of the request type, specification of the target resource URI, and selection between synchronous or asynchronous processing is handled via the "open" method: For asynchronous operations, a listener function must be assigned to handle state transition notifications: The request is then launched into the network by calling the "send" method, optionally carrying payload data: Event listeners then process the object's state changes. Upon successful receipt of response data from the server, it is typically stored within the "responseText" property by default. When the object completes all processing steps, its state transitions to 4, signifying the "done" state. Beyond these fundamental steps, XMLHttpRequest offers numerous parameters to govern request transmission and response handling. Custom header fields can be programmatically appended to instruct the server on fulfillment methods, and data can be transmitted to the server by embedding it within the argument passed to the "send" call. The received response data can be automatically deserialized from formats like JSON into native, immediately usable JavaScript objects, or processed incrementally as data streams arrive, obviating the need to wait for the entire payload. Furthermore, requests retain the capability to be terminated prematurely or configured with timeouts to mandate failure if completion is not achieved within a defined temporal window.
== Inter-domain Communication ==
During the nascent period of the World Wide Web's evolution, it became evident that mechanisms allowing circumvention of security restrictions that prevented brea
