Skip to content

Conversation

@yiyuan-he
Copy link
Contributor

Fixes

Summary

Adding Docker Nodejs Express app to our enablement tool testing infra.

Changes

This PR adds a new Node.js Express baseline application for testing AWS Application Signals enablement via the
get_enablement_guide MCP tool. The application is designed to run as a Docker container on EC2.

New files added:

  • docker-apps/nodejs/express/ - Complete Express application with:
    • Dockerfile using Node.js 20-alpine with health checks
    • REST API with three endpoints: /, /health, and /api/buckets
    • AWS SDK S3 integration to list S3 buckets
    • Traffic generation script for continuous testing
    • package.json with Express 5.1.0, AWS SDK, and Pino logger dependencies
    • infrastructure/ec2/cdk/config/nodejs-express.json - CDK configuration for deployment

Documentation updates:
- Updated README.md with Node.js Express app build/deploy instructions
- Added nodejs-express to ECR repository table
- Added NodejsExpressCdkStack to CDK stack deployment table

User experience

N/A

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

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

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@yiyuan-he yiyuan-he changed the title feat (samples/cloudwatch-applicationsignals-mcp): add docker nodejs express app feat(samples/cloudwatch-applicationsignals-mcp): add docker nodejs express app Nov 12, 2025
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.26%. Comparing base (63a92cd) to head (fe188cd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1721   +/-   ##
=======================================
  Coverage   90.26%   90.26%           
=======================================
  Files         781      781           
  Lines       59912    59912           
  Branches     9718     9718           
=======================================
  Hits        54077    54077           
  Misses       3646     3646           
  Partials     2189     2189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Node.js Express baseline application for testing AWS Application Signals enablement via the get_enablement_guide MCP tool. The application is containerized and designed to run on EC2 with Docker.

  • Complete Express application with health checks, S3 integration, and Pino logging
  • Multi-architecture Docker image support (linux/amd64, linux/arm64)
  • CDK infrastructure configuration for EC2 deployment
  • Traffic generation script for continuous testing

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docker-apps/nodejs/express/app.js Express server with endpoints for health checks and S3 bucket listing
docker-apps/nodejs/express/Dockerfile Multi-stage Docker build with Node.js 20-alpine, health checks, and security best practices
docker-apps/nodejs/express/package.json Dependencies including Express 5.1.0, AWS SDK S3, and Pino logger
docker-apps/nodejs/express/package-lock.json Lock file for dependency versions
docker-apps/nodejs/express/generate-traffic.sh Bash script for continuous traffic generation
infrastructure/ec2/cdk/config/nodejs-express.json CDK configuration for Node.js Express stack
README.md Updated documentation with Node.js Express build and deployment instructions
Comments suppressed due to low confidence (1)

samples/cloudwatch-applicationsignals-mcp/get-enablement-guide-samples/docker-apps/nodejs/express/app.js:19

  • Avoid automated semicolon insertion (91% of all statements in the enclosing script have an explicit semicolon).
const logger = require('pino')()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yiyuan-he
Copy link
Contributor Author

trivy is expected to fail for now. see here.

const HOST = process.env.HOST || '0.0.0.0';
const PORT = parseInt(process.env.PORT || '8080', 10);

const app = express();

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: javascript.express.security.audit.express-check-csurf-middleware-usage.express-check-csurf-middleware-usage Note

A CSRF middleware was not detected in your express application. Ensure you are either using one such as csurf or csrf (see rule references) and/or you are properly doing CSRF validation in your routes with a token or cookies.
vastin
vastin previously approved these changes Nov 12, 2025
@yiyuan-he yiyuan-he added this pull request to the merge queue Nov 13, 2025
Merged via the queue into awslabs:main with commit 1b1a21b Nov 13, 2025
140 checks passed
@yiyuan-he yiyuan-he deleted the pr/nodejs-express branch November 13, 2025 20:31
@github-project-automation github-project-automation bot moved this from To triage to Done in awslabs/mcp Project Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants