Skip to content

Conversation

@AiGOVERNOR
Copy link

Fixes #1692

Summary

This PR fixes region detection in the CloudWatch MCP Server.
It ensures that the service honors AWS_REGION and AWS_DEFAULT_REGION environment variables before defaulting to us-east-1.

Changes

  • Added get_effective_region() helper for consistent region resolution.
  • Updated CloudWatch Logs client creation to use detected region.
  • Region precedence: argument → environment → boto3 session → fallback us-east-1.

User experience

Before: The server always defaulted to us-east-1, ignoring environment settings.
After: The server correctly uses the configured AWS region, improving portability for multi-region deployments.

Checklist

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested locally with and without AWS_REGION set
  • Changes are documented in code comments

Is this a breaking change? (Y/N)
N

RFC issue number: N/A

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution under the terms of the project license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

(aws-iot-sitewise-mcp-server): (Identify the target region using the AWS_REGION env)

1 participant