Skip to content

Commit 86e9e9b

Browse files
agsanketcharlie-7
authored andcommitted
feat: add bulk metadata transfer job management tools
1 parent ef1c288 commit 86e9e9b

File tree

9 files changed

+3288
-8
lines changed

9 files changed

+3288
-8
lines changed

src/aws-iot-sitewise-mcp-server/README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ A comprehensive MCP (Model Context Protocol) server that provides full AWS IoT S
3030
- **Time Series Management**: Associate and manage time series data streams
3131
- **Edge Computing**: Support for local data processing and intermittent connectivity
3232

33+
#### 📦 Bulk Operations & Metadata Transfer
34+
35+
- **Bulk Export**: Export ALL IoT SiteWise resources (asset models, assets, etc.) in one operation using metadata transfer jobs
36+
- **Bulk Import Schema**: Create and validate structured schemas for bulk asset/model imports
37+
- **Metadata Transfer Jobs**: Manage large-scale data migration between S3 and IoT SiteWise
38+
- **Job Monitoring**: Track progress and status of bulk operations
39+
- **Multi-Source Support**: Transfer data between S3 buckets and IoT SiteWise
40+
- **Schema Validation**: Ensure data integrity with comprehensive validation before import
41+
3342
#### 🔒 Security & Configuration
3443

3544
- **Access Policies**: Fine-grained access control for users and resources
@@ -72,11 +81,11 @@ Step-by-step guidance for setting up data ingestion:
7281

7382
```bash
7483
# Install UV if you don't have it yet
75-
curl -sSf https://astral.sh/uv/install | sh
84+
curl -sSf https://astral.sh/uv/install.sh | sh
7685

7786
# Clone the repository
7887
git clone https://github.com/awslabs/mcp.git
79-
cd src/aws-iot-sitewise-mcp-server
88+
cd mcp/src/aws-iot-sitewise-mcp-server
8089

8190
# Install as a uv tool (this makes it available globally via uvx)
8291
uv tool install .
@@ -96,7 +105,7 @@ pip install aws-iot-sitewise-mcp
96105

97106
# Or install from source
98107
git clone https://github.com/awslabs/mcp.git
99-
cd src/aws-iot-sitewise-mcp-server
108+
cd mcp/src/aws-iot-sitewise-mcp-server
100109
pip install .
101110

102111
# Run the server
@@ -105,7 +114,10 @@ python -m awslabs.aws_iot_sitewise_mcp_server.server
105114

106115
### AWS Configuration
107116

108-
Configure AWS credentials using any of these methods:
117+
Configure AWS credentials with permissions for:
118+
- AWS IoT SiteWise (full access for write operations)
119+
- AWS IoT TwinMaker (for metadata transfer operations)
120+
- Amazon S3 (for bulk import/export operations)
109121

110122
```bash
111123
# AWS CLI (recommended)
@@ -350,6 +362,16 @@ Configure in your workspace or global settings:
350362
| `unlink_time_series_asset_property` | Unlink streams |
351363
| `delete_time_series` | Remove time series |
352364

365+
### Metadata Transfer & Bulk Import Tools
366+
367+
| Tool Name | Description |
368+
|-----------|-------------|
369+
| `create_bulk_import_schema` | Construct and validate bulk import schemas for asset models and assets |
370+
| `create_metadata_transfer_job` | **🚀 PRIMARY TOOL for bulk export/import operations** - Use this for exporting all resources |
371+
| `cancel_metadata_transfer_job` | Cancel running metadata transfer jobs |
372+
| `get_metadata_transfer_job` | Get detailed information about metadata transfer jobs |
373+
| `list_metadata_transfer_jobs` | List metadata transfer jobs with filtering options |
374+
353375
### Access Control & Configuration Tools
354376

355377
| Tool Name | Description |
@@ -624,6 +646,18 @@ The implementation is validated against:
624646
- Check timestamp formats
625647
- Validate data types and ranges
626648

649+
4. **Metadata Transfer Issues**
650+
- Verify IoT TwinMaker service permissions
651+
- Check S3 bucket access for source/destination operations
652+
- Validate bulk import schema format
653+
- Monitor job status for detailed error messages
654+
655+
5. **Bulk Import Schema Errors**
656+
- Ensure asset model external IDs are unique
657+
- Verify property data types match requirements
658+
- Check hierarchy references are valid
659+
- Use create_bulk_import_schema tool for validation
660+
627661
### Getting Help
628662

629663
- Check AWS IoT SiteWise documentation

src/aws-iot-sitewise-mcp-server/awslabs/aws_iot_sitewise_mcp_server/client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ def create_sitewise_client(region: str = 'us-east-1'):
2828
Returns:
2929
boto3 IoT SiteWise client instance
3030
"""
31+
if region is None:
32+
region = 'us-east-1'
3133
config = Config(user_agent_extra=f'awslabs/mcp/aws-iot-sitewise-mcp-server/{__version__}')
3234

3335
return boto3.client('iotsitewise', region_name=region, config=config)
36+
37+
38+
def create_twinmaker_client(region: str = 'us-east-1'):
39+
"""Create a standardized AWS IoT TwinMaker client with proper user agent.
40+
41+
Args:
42+
region: AWS region name (default: us-east-1)
43+
44+
Returns:
45+
boto3 IoT TwinMaker client instance
46+
"""
47+
if region is None:
48+
region = 'us-east-1'
49+
config = Config(user_agent_extra=f'awslabs/mcp/aws-iot-sitewise-mcp-server/{__version__}')
50+
return boto3.client('iottwinmaker', region_name=region, config=config)

0 commit comments

Comments
 (0)