This agent automatically checks if your Confluence documentation needs updating based on GitHub PR changes.
- Fetches GitHub PR details and code diffs via MCP server
- Fetches Confluence pages via direct REST API
- Analyzes discrepancies between code changes and documentation
- Provides specific, actionable update recommendations
Create a .env file in the simple-agent directory with the following:
# GitHub Personal Access Token
# Get one from: https://github.com/settings/tokens
# Scopes needed: repo (for private repos) or public_repo (for public repos)
GITHUB_TOKEN=ghp_your_github_token_here
# Atlassian Confluence Credentials
# Get your instance URL from your Confluence site (no trailing slash)
ATLASSIAN_BASE_URL=https://yourcompany.atlassian.net
# Your Atlassian account email
[email protected]
# Atlassian API Token (no quotes needed)
# Create one at: https://id.atlassian.com/manage-profile/security/api-tokens
ATLASSIAN_API_TOKEN=your_atlassian_api_token_here
# Datadog Workflow Keys (optional - for posting recommendations)
DD_API_KEY=your_datadog_api_key
DD_APP_KEY=your_datadog_app_key- Go to https://github.com/settings/tokens
- Click "Generate new token" → "Generate new token (classic)"
- Give it a name (e.g., "MCP Agent")
- Select scopes:
repofor private repositories- OR
public_repofor public repositories only
- Copy the token and add to
.env
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a label (e.g., "Documentation Agent")
- Copy the token and add to
.env
Edit agent.py and update these values:
owner = "your-github-username"
repo = "your-repo-name"
pr_number = 123 # Your PR number
confluence_search_query = "search terms" # What to search for in Confluence- Fetch PR: Connects to GitHub MCP server and retrieves PR data including the code diff
- Fetch Confluence: Uses direct REST API to get your Confluence page content
- Analyze & Recommend: Uses GPT-4 to compare the PR changes with current documentation and suggest specific updates
- Post to Datadog: (Optional) Automatically posts recommendations to your Datadog workflow
python agent.pyOr trigger via dispatch:
# Your dispatch command hereThe agent will provide:
- Summary of PR changes
- Identification of outdated documentation sections
- Specific text updates needed (in Confluence format)
- Priority levels for each recommended update
- Automatic notification to Datadog workflow (if configured)
- Ensure Node.js and npx are installed
- The GitHub MCP server will be auto-installed on first run via
npx -y @modelcontextprotocol/server-github
- Your user account doesn't have Confluence product access
- Go to https://admin.atlassian.com/
- Grant Confluence access to your user account
- Add user to the relevant Confluence space
- Check the page ID is correct (find it in the URL:
/pages/123456/...) - Verify the page exists and isn't deleted
- Ensure your user has permission to view the page
- Verify your
GITHUB_TOKENis correct in.env - Check token has
reposcope (for private repos) orpublic_repo(for public)