AWS MCP Server
This is a Model Context Protocol (MCP) server that provides read-only access to AWS resources. It is built using TypeScript and the AWS SDK v3.
Features
This server exposes the following tools:
get_aws_caller_identity: Verify the current AWS credentials.list_s3_buckets: List all S3 buckets.list_ec2_instances: List EC2 instances in the configured region (or a specified region).list_iam_users: List IAM users.
Prerequisites
- Node.js (v16 or higher)
- AWS Credentials (Access Key ID and Secret Access Key) with read-only permissions.
Setup
-
Install dependencies:
npm install -
Build the project:
npm run build(Note:
npm run buildis not defined in package.json yet, command isnpx tsc)
Usage (Private / Team)
Since this is a private tool, you can share it with your team in two main ways:
Option 1: Share via Git (Recommended)
-
Push this code to your private repository (GitHub, GitLab, etc.).
-
Team members should clone the repository:
git clone <your-private-repo-url> cd mcp-server-aws npm install npm run build -
Configure MCP Client: Use the absolute path to the locally built file.
{ "mcpServers": { "aws-mcp": { "command": "node", "args": ["/path/to/cloned/repo/dist/index.js"], "env": { "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY", "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_KEY", "AWS_REGION": "us-east-1" } } } }
Option 2: Share as a Single File (.tgz)
You can package the server into a single file and send it to your team (Slack, Email, Sharepoint).
-
Create the package:
npm packThis creates a file like
mcp-server-aws-1.0.0.tgz. -
Team members install it globally (or locally):
npm install -g mcp-server-aws-1.0.0.tgz -
Configure MCP Client: If installed globally, they can run it directly:
{ "mcpServers": { "aws-mcp": { "command": "mcp-server-aws", "args": [], "env": { ... } } } }
### Option 2: Running Locally
If you cloned the repository and built it locally:
**Command**: `node`
**Args**: `/path/to/dist/index.js` (Absolute path recommended)
**Example Configuration (JSON)**:
```json
{
"mcpServers": {
"aws-mcp": {
"command": "node",
"args": ["/Users/bhaveshkumarparmar/Desktop/Shellkode/MSP-Projects/MCP-server-aws/dist/index.js"],
"env": {
"AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY",
"AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_KEY",
"AWS_REGION": "us-east-1"
}
}
}
}
Development
To run the server in development mode (watching for changes):
npx tsx watch src/index.ts
