npm package: @ldavis9000aws/aws-mcp-jv3
Description: Simplified AWS SDK for Java 3 MCP Server implementation
Author: ldavis9000aws
Latest version: 1.0.9

# AWS MCP - AWS SDK for Java 3

A simplified Model Context Protocol (MCP) server for AWS SDK for Java 3, designed with simplicity in mind.

## Features

- Direct AWS SDK for Java 3 integration using pre-defined service clients
- No dynamic module loading or runtime npm installations
- Simple profile and credential management
- Executes AWS code in a VM sandbox
- Follows the original MCP server design pattern

## Installation

### Option 1: Install via npx (Recommended)

The easiest way to use this tool is via npx, which doesn't require installing the package:

```bash
npx aws-mcp-jv3
```

### Option 2: Install globally

```bash
npm install -g aws-mcp-jv3
aws-mcp-jv3
```

### Option 3: Clone and build from source

```bash
git clone https://github.com/ldavis9000aws/aws-mcp-jv3-v2.git
cd aws-mcp-jv3-v2
npm install
npm run build
npm start
```

## Claude Desktop Configuration

To use this tool with Claude Desktop, follow these steps:

### Windows

1. Open Claude Desktop application
2. Click on the gear icon in the bottom left corner to open Settings
3. Navigate to the "MCP Tools" section
4. Click "Add New Tool"
5. Configure the tool:
   ```
   Name: AWS SDK v3
   Description: Execute AWS SDK for Java 3 code
   Command: npx aws-mcp-jv3
   ```
6. Click "Save"
7. Restart Claude Desktop

### macOS/Linux

1. Open Claude Desktop application
2. Click on the gear icon in the bottom left corner to open Settings
3. Navigate to the "MCP Tools" section
4. Click "Add New Tool"
5. Configure the tool:
   ```
   Name: AWS SDK v3
   Description: Execute AWS SDK for Java 3 code
   Command: npx aws-mcp-jv3
   ```
6. Click "Save"
7. Restart Claude Desktop

## LibreChat Configuration

To use this tool with LibreChat, you need to add it to your `librechat.yaml` configuration:

### Method 1: Using MCP Servers section

```yaml
# librechat.yaml
mcp:
  servers:
    aws-sdk-v3:
      command: npx aws-mcp-jv3
      description: Execute AWS SDK for Java 3 code
```

### Method 2: Using Tools section (alternative)

```yaml
# librechat.yaml
tools:
  mcp:
    servers:
      aws-sdk-v3:
        command: npx aws-mcp-jv3
        description: Execute AWS SDK for Java 3 code
```

After updating your config, restart LibreChat to apply the changes.

## Permissions for MCP Tools

For both Claude Desktop and LibreChat:

1. Make sure you have Node.js (v16 or higher) installed on your system
2. If running with restricted permissions, you may need to:
   - On Windows: Run Claude Desktop or LibreChat as Administrator the first time
   - On Linux/macOS: Run `sudo npm install -g aws-mcp-jv3` first

## Usage with Claude

When using Claude with this tool:

1. **First, list available AWS profiles**:
   ```
   Please list my AWS profiles using the AWS SDK v3 tool.
   ```

2. **Select a profile before executing code**:
   ```
   Please select the "default" AWS profile using the AWS SDK v3 tool.
   ```

3. **Run AWS SDK v3 code**:
   ```
   Using AWS SDK v3, please list all my S3 buckets.
   ```

## Available Tools

- `run-aws-code` - Execute AWS SDK for Java 3 code
- `list-credentials` - List available AWS profiles
- `select-profile` - Select an AWS profile to use for subsequent operations

## Example Commands

### Example 1: List S3 buckets

```
Using AWS SDK v3, list all my S3 buckets.
```

Claude will execute:

```javascript
await run-aws-code({
  reasoning: "List all S3 buckets in the account",
  code: `
    const { ListBucketsCommand } = require("@aws-sdk/client-s3");
    const s3Client = await getClient("s3");
    const response = await s3Client.send(new ListBucketsCommand({}));
    return response.Buckets;
  `
});
```

### Example 2: List EC2 instances

```
Using AWS SDK v3, show me all my EC2 instances.
```

Claude will execute:

```javascript
await run-aws-code({
  reasoning: "Retrieve EC2 instances information",
  code: `
    const { DescribeInstancesCommand } = require("@aws-sdk/client-ec2");
    const ec2Client = await getClient("ec2");
    const response = await ec2Client.send(new DescribeInstancesCommand({}));
    
    // Extract relevant instance information
    const instances = [];
    for (const reservation of response.Reservations || []) {
      for (const instance of reservation.Instances || []) {
        instances.push({
          id: instance.InstanceId,
          type: instance.InstanceType,
          state: instance.State?.Name,
          publicIp: instance.PublicIpAddress,
          privateIp: instance.PrivateIpAddress,
          launchTime: instance.LaunchTime
        });
      }
    }
    return instances;
  `
});
```

## Troubleshooting

### Common Issues

1. **Error: Cannot find module**
   - Ensure Node.js (v16+) is installed
   - Try running `npm cache clean --force` and then retry

2. **Error loading AWS profiles**
   - Check that your AWS credentials file exists at:
     - Windows: `%USERPROFILE%\.aws\credentials`
     - Linux/macOS: `~/.aws/credentials`
   
3. **Permission denied errors**
   - Run with elevated permissions the first time
   - Check file permissions on your .aws directory

4. **Timeout when executing AWS commands**
   - Verify your internet connection
   - Check AWS region settings
   - Confirm your AWS credentials are valid

### Getting Support

If you encounter issues, please submit them on the [GitHub Issues page](https://github.com/ldavis9000aws/aws-mcp-jv3-v2/issues) with:
- Description of the problem
- Steps to reproduce
- Error messages and logs
- Your environment (OS, Node.js version)