You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add support for configuring custom HTTP headers (sooperset#570)
Add support for configuring custom HTTP headers for both Jira and
Confluence API requests via environment variables. This enables users
in corporate environments to add required authentication, routing, or
security headers.
Changes:
- Add get_custom_headers() utility function for parsing comma-separated key=value pairs
- Add custom_headers field to JiraConfig and ConfluenceConfig classes
- Apply custom headers to underlying session objects during client initialization
- Support service-specific headers via JIRA_CUSTOM_HEADERS and CONFLUENCE_CUSTOM_HEADERS
- Header values masked in debug logs to protect sensitive information
- Graceful handling of malformed headers (skip invalid, continue processing valid)
- Comprehensive test coverage with 470+ lines of tests
- Documentation with examples, debugging guide, and security considerations
Usage:
JIRA_CUSTOM_HEADERS=X-Corp-Auth=token123,X-Dept=engineering
CONFLUENCE_CUSTOM_HEADERS=X-ALB-Token=secret,X-Service=mcp-atlassian
This enables MCP server usage in corporate environments requiring
additional HTTP headers for security, authentication, or routing.
Reported-by: Sajjad Pervaiz
Github-Issue: sooperset#436
MCP Atlassian supports adding custom HTTP headers to all API requests. This feature is particularly useful in corporate environments where additional headers are required for security, authentication, or routing purposes.
380
+
381
+
Custom headers are configured using environment variables with comma-separated key=value pairs:
- Custom header values are masked in debug logs to protect sensitive information
420
+
- Ensure custom headers don't conflict with standard HTTP or Atlassian API headers
421
+
- Avoid including sensitive authentication tokens in custom headers if already using basic auth or OAuth
422
+
- Headers are sent with every API request - verify they don't interfere with API functionality
423
+
424
+
</details>
425
+
376
426
377
427
<details>
378
428
<summary>Multi-Cloud OAuth Support</summary>
@@ -755,6 +805,43 @@ The server provides two ways to control tool access:
755
805
- For older Confluence servers: Some older versions require basic authentication with `CONFLUENCE_USERNAME` and `CONFLUENCE_API_TOKEN` (where token is your password)
756
806
- **SSL Certificate Issues**: If using Server/Data Center and encounter SSL errors, set `CONFLUENCE_SSL_VERIFY=false` or `JIRA_SSL_VERIFY=false`
757
807
- **Permission Errors**: Ensure your Atlassian account has sufficient permissions to access the spaces/projects
808
+
- **Custom Headers Issues**: See the ["Debugging Custom Headers"](#debugging-custom-headers) section below to analyze and resolve issues with custom headers
809
+
810
+
### Debugging Custom Headers
811
+
812
+
To verify custom headers are being applied correctly:
813
+
814
+
1. **Enable Debug Logging**: Set `MCP_VERY_VERBOSE=true` to see detailed request logs
815
+
```bash
816
+
# In your .env file or environment
817
+
MCP_VERY_VERBOSE=true
818
+
MCP_LOGGING_STDOUT=true
819
+
```
820
+
821
+
2. **Check Header Parsing**: Custom headers appear in logs with masked values for security:
0 commit comments