# watsonx Orchestrate Lambda Deployer - MCP Server

This project contains MCP server implementations for automating AWS Lambda API Gateway deployment.

## Available Implementations

### 1. TypeScript/Node.js Implementation (Recommended - Currently Active)

**Location:** `/Users/amandawinkles/Documents/IBM Bob/MCP/wxo-lambda-deployer/`

**Status:** ✅ Fully functional and configured

**Requirements:**
- Node.js 18+ or 20+
- npm
- AWS CLI configured
- Terraform 1.0+

**Features:**
- 6 automation tools for Lambda deployment
- Complete test suite (22 passing tests)
- Full documentation
- Currently configured in Bob MCP settings

**Tools Available:**
1. `init_lambda_project` - Initialize Lambda projects
2. `deploy_lambda` - Deploy with Terraform
3. `update_lambda_code` - Update and redeploy code
4. `get_deployment_status` - Check deployment status
5. `destroy_lambda` - Clean up resources
6. `test_lambda_endpoint` - Test API endpoints

### 2. Python Implementation

**Location:** `/Users/amandawinkles/bob/wxO-nit/server.py`

**Status:** ⚠️ Requires Python 3.10+ (current system has Python 3.9.6)

**Requirements:**
- Python 3.10 or higher
- fastmcp package
- AWS CLI configured
- Terraform 1.0+

**Note:** The Python implementation is provided but cannot run on the current system due to Python version constraints. FastMCP requires Python 3.10+, but the system has Python 3.9.6.

## Current Configuration

The TypeScript implementation is currently active and configured in:
`~/.bob/settings/mcp_settings.json`

```json
{
  "mcpServers": {
    "wxo-lambda-deployer": {
      "command": "node",
      "args": [
        "/Users/amandawinkles/Documents/IBM Bob/MCP/wxo-lambda-deployer/build/index.js"
      ],
      "env": {
        "AWS_PROFILE": "default"
      }
    }
  }
}
```

## Usage

After restarting Bob, you can use commands like:

```
"Initialize a new Lambda project called my-api with Node.js 20"
"Deploy the Lambda project"
"Test the Lambda endpoint"
"Get deployment status"
"Destroy the Lambda deployment"
```

## Terraform Deployment Example

The MCP server was used to deploy the existing Terraform configuration in this directory:

```bash
# The terraform/ directory contains:
- terraform.tf    # Provider configuration
- main.tf         # Lambda, API Gateway, S3, IAM resources
- outputs.tf      # API endpoint and resource outputs
- variables.tf    # Configuration variables

# Deployment was completed with:
terraform init
terraform validate
terraform plan
terraform apply
```

## Upgrading to Python Implementation

If you upgrade to Python 3.10+, you can use the Python implementation:

1. **Install Python 3.10+:**
   ```bash
   brew install python@3.10  # macOS
   ```

2. **Install dependencies:**
   ```bash
   pip3 install -r requirements.txt
   ```

3. **Update MCP settings:**
   ```json
   {
     "mcpServers": {
       "wxo-lambda-deployer": {
         "command": "python3",
         "args": [
           "/Users/amandawinkles/bob/wxO-nit/server.py"
         ],
         "env": {
           "AWS_PROFILE": "default"
         }
       }
     }
   }
   ```

4. **Make server executable:**
   ```bash
   chmod +x server.py
   ```

## Documentation

- **TypeScript Implementation:** `/Users/amandawinkles/Documents/IBM Bob/MCP/wxo-lambda-deployer/README.md`
- **Contributing Guide:** `/Users/amandawinkles/Documents/IBM Bob/MCP/wxo-lambda-deployer/CONTRIBUTING.md`
- **Test Suite:** `/Users/amandawinkles/Documents/IBM Bob/MCP/wxo-lambda-deployer/src/__tests__/tools.test.ts`

## Architecture

```
User Request
     ↓
Bob/Claude (MCP Client)
     ↓
MCP Protocol
     ↓
wxo-lambda-deployer (TypeScript)
     ↓
Terraform CLI
     ↓
AWS API
     ↓
Lambda + API Gateway + S3 + IAM + CloudWatch
```

## Support

For issues or questions about the MCP server:
- Check the main README in the TypeScript implementation directory
- Review test cases for usage examples
- Consult Terraform documentation for infrastructure details