Skip to content

Commit c76aed9

Browse files
committed
Fixed: output for mcp server endpoint after stack update
1 parent a5bedfb commit c76aed9

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

docs/mcp-integration.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ When MCP is enabled, an additional Cognito User Pool Client is created:
138138
- **OAuth Scopes**: openid, email, profile
139139
- **Callback URLs**:
140140
- CloudFront distribution URL
141-
- QuickSight OAuth callback
141+
- Quick Suite OAuth callback
142142
- Cognito User Pool domain
143143

144144
### Token Management
@@ -251,4 +251,10 @@ print(f"Query result: {result}")
251251

252252
### Amazon Quick Suite Integration
253253

254-
For Amazon Quick Suite integration, use the provided OAuth callback URLs and configure QuickSight to authenticate against the Cognito User Pool using the External App Client credentials.
254+
For Amazon Quick Suite integration, configure the MCP connection using the CloudFormation stack outputs detailed in the [Output Parameters](#output-parameters) section.
255+
256+
- **MCP Server**: Use `MCPServerEndpoint` output value
257+
- **Client ID**: Use `MCPClientId` output value
258+
- **Client Secret**: Use `MCPClientSecret` output value
259+
- **Token URL**: Use `MCPTokenURL` output value
260+
- **Authorization URL**: Use `MCPAuthorizationURL` output value

src/lambda/agentcore_gateway_manager/index.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,22 @@ def create_or_update_gateway(props, gateway_name):
6868

6969
if existing_gateways:
7070
existing_gateway = existing_gateways[0]
71-
logger.info(f"Gateway {gateway_name} already exists, returning existing configuration")
72-
return {
73-
'gateway_url': existing_gateway.get('gatewayUrl'),
74-
'gateway_id': existing_gateway.get('gatewayId'),
75-
'gateway_arn': existing_gateway.get('gatewayArn')
76-
}
71+
gateway_id = existing_gateway.get('gatewayId')
72+
73+
if gateway_id:
74+
try:
75+
gateway_details = control_client.get_gateway(gatewayIdentifier=gateway_id)
76+
if gateway_details and gateway_details.get('gatewayUrl'):
77+
return {
78+
'gateway_url': gateway_details.get('gatewayUrl'),
79+
'gateway_id': gateway_details.get('gatewayId'),
80+
'gateway_arn': gateway_details.get('gatewayArn')
81+
}
82+
except Exception as e:
83+
logger.warning(f"Error getting gateway details: {e}")
84+
7785
except Exception as e:
78-
logger.info(f"Error checking for existing gateway: {e}")
86+
logger.warning(f"Error checking for existing gateway: {e}")
7987

8088
# Gateway doesn't exist, create it
8189
logger.info(f"Gateway {gateway_name} does not exist, creating new one")

0 commit comments

Comments
 (0)