feat: added terraform script to deploy MCP server on Agentcore runtime#1086
feat: added terraform script to deploy MCP server on Agentcore runtime#1086anujbpanchal wants to merge 5 commits intomainfrom
Conversation
Coverage Report for CI Build 24723317621Warning No base build found for commit Coverage: 81.798%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
| output "get_token_command" { | ||
| description = "Command to generate an OAuth token for the test user" | ||
| value = <<-EOT | ||
| python3 scripts/get_token.py \ | ||
| --region ${local.region} \ | ||
| --user-pool-id ${aws_cognito_user_pool.mcp.id} \ | ||
| --client-id ${aws_cognito_user_pool_client.mcp.id} \ | ||
| --username ${var.cognito_test_username} \ | ||
| --password <PASSWORD> | ||
| EOT | ||
| } |
There was a problem hiding this comment.
The Cognito pool is configured with username_attributes = ["email"], so users must authenticate with their email. The Cognito user resource reflects this:
resource "aws_cognito_user" "test_user" {
username = var.cognito_test_user_email # email is the usernameBut the generated command uses a different variable:
--username ${var.cognito_test_username} # defaults to "mcp-test-user"
Note: the cognito_test_username output above this block correctly maps to var.cognito_test_user_email, but Terraform outputs don't assign to input variables, so the command will embed "mcp-test-user" and fail.
Replace var.cognito_test_username with var.cognito_test_user_email on the --username line.
There was a problem hiding this comment.
I don't think this should be checked in/committed
| } | ||
|
|
||
| # MongoDB / Atlas credentials passed to the MCP server at runtime | ||
| variable "mdb_connection_string" { |
There was a problem hiding this comment.
The variable has no default, making it required at terraform apply. Anyone using only Atlas tools (no direct MongoDB connection) will be blocked.
Add default = "" to match the other optional credential variables.
|
Thanks for putting this together. The README is thorough and the IAM policies are well-scoped. Before we merge, I'd like to discuss the intended audience for this module. As it stands, a few things make it feel more like a personal "here's how I got it working" setup than something others can drop in:
Would you be open to one of these directions?
Happy to help shape whichever direction makes more sense. |
Proposed changes
Checklist
MongoDB Contributor Agreement.pdf