awslabs.stepfunctions-tool-mcp-server 0.1.4__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
awslabs/__init__.py CHANGED
@@ -1,2 +1,16 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # This file is part of the awslabs namespace.
2
16
  # It is intentionally minimal to support PEP 420 namespace packages.
@@ -1,3 +1,17 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  """awslabs.stepfunctions-tool-mcp-server"""
2
16
 
3
17
  __version__ = '0.0.0'
@@ -0,0 +1,71 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """AWS Helper for Step Functions Tool MCP Server."""
16
+
17
+ import boto3
18
+ import botocore.config
19
+ import os
20
+ from typing import Any, Optional
21
+
22
+
23
+ class AwsHelper:
24
+ """Helper class for AWS operations."""
25
+
26
+ @staticmethod
27
+ def get_aws_region() -> Optional[str]:
28
+ """Get AWS region from environment variable.
29
+
30
+ Returns:
31
+ str: AWS region if set in environment, None otherwise
32
+ """
33
+ return os.environ.get('AWS_REGION', 'us-east-1')
34
+
35
+ @staticmethod
36
+ def get_aws_profile() -> Optional[str]:
37
+ """Get AWS profile from environment variable.
38
+
39
+ Returns:
40
+ str: AWS profile if set in environment, None otherwise
41
+ """
42
+ return os.environ.get('AWS_PROFILE')
43
+
44
+ @staticmethod
45
+ def create_boto3_client(service_name: str, region_name: Optional[str] = None) -> Any:
46
+ """Create a boto3 client with the appropriate configuration.
47
+
48
+ Args:
49
+ service_name: AWS service name (e.g., 'stepfunctions', 'schemas')
50
+ region_name: Optional region override
51
+
52
+ Returns:
53
+ boto3.client: Configured boto3 client
54
+ """
55
+ from awslabs.stepfunctions_tool_mcp_server.server import __version__
56
+
57
+ # Create config with user agent
58
+ config = botocore.config.Config(
59
+ user_agent_extra=f'awslabs/mcp/aws-stepfunctions-tool-mcp-server/{__version__}'
60
+ )
61
+
62
+ # Get profile and region
63
+ profile = AwsHelper.get_aws_profile()
64
+ region = region_name or AwsHelper.get_aws_region()
65
+
66
+ # Create client with or without profile
67
+ if profile:
68
+ session = boto3.Session(profile_name=profile)
69
+ return session.client(service_name, region_name=region, config=config)
70
+ else:
71
+ return boto3.client(service_name, region_name=region, config=config)
@@ -1,11 +1,28 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  """awslabs Step Functions Tool MCP Server implementation."""
2
16
 
17
+ # This version should match the version in pyproject.toml
18
+ __version__ = '0.1.5'
19
+
3
20
  import asyncio
4
- import boto3
5
21
  import json
6
22
  import logging
7
23
  import os
8
24
  import re
25
+ from awslabs.stepfunctions_tool_mcp_server.aws_helper import AwsHelper
9
26
  from mcp.server.fastmcp import Context, FastMCP
10
27
  from typing import Optional
11
28
 
@@ -14,11 +31,8 @@ from typing import Optional
14
31
  logging.basicConfig(level=logging.INFO)
15
32
  logger = logging.getLogger(__name__)
16
33
 
17
- AWS_PROFILE = os.environ.get('AWS_PROFILE', 'default')
18
- logger.info(f'AWS_PROFILE: {AWS_PROFILE}')
19
-
20
- AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')
21
- logger.info(f'AWS_REGION: {AWS_REGION}')
34
+ logger.info(f'AWS_PROFILE: {AwsHelper.get_aws_profile()}')
35
+ logger.info(f'AWS_REGION: {AwsHelper.get_aws_region()}')
22
36
 
23
37
  STATE_MACHINE_PREFIX = os.environ.get('STATE_MACHINE_PREFIX', '')
24
38
  logger.info(f'STATE_MACHINE_PREFIX: {STATE_MACHINE_PREFIX}')
@@ -40,9 +54,8 @@ STATE_MACHINE_INPUT_SCHEMA_ARN_TAG_KEY = os.environ.get('STATE_MACHINE_INPUT_SCH
40
54
  logger.info(f'STATE_MACHINE_INPUT_SCHEMA_ARN_TAG_KEY: {STATE_MACHINE_INPUT_SCHEMA_ARN_TAG_KEY}')
41
55
 
42
56
  # Initialize AWS clients
43
- session = boto3.Session(profile_name=AWS_PROFILE, region_name=AWS_REGION)
44
- sfn_client = session.client('stepfunctions')
45
- schemas_client = session.client('schemas')
57
+ sfn_client = AwsHelper.create_boto3_client('stepfunctions')
58
+ schemas_client = AwsHelper.create_boto3_client('schemas')
46
59
 
47
60
  mcp = FastMCP(
48
61
  'awslabs.stepfunctions-tool-mcp-server',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.stepfunctions-tool-mcp-server
3
- Version: 0.1.4
3
+ Version: 0.1.7
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for AWS Step Functions
5
5
  Project-URL: Homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: Documentation, https://awslabs.github.io/mcp/servers/stepfunctions-tool-mcp-server/
@@ -0,0 +1,10 @@
1
+ awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
2
+ awslabs/stepfunctions_tool_mcp_server/__init__.py,sha256=4SROt2yOCZeQ1L008_6ngAffiudcpwQ8fRFSgCdanAg,683
3
+ awslabs/stepfunctions_tool_mcp_server/aws_helper.py,sha256=TCwI6AoEguBG9tD8g2mf-4f2Tk0E-mnsiTUUnEOcI5o,2444
4
+ awslabs/stepfunctions_tool_mcp_server/server.py,sha256=3mhfTltnMoo-lzqE7tI68OwF_1YcsEv3CB0IuVWE24U,16106
5
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/METADATA,sha256=cxC_9iabILzpObVvTXkicZzBHdVLWKzvx61urr_vI6k,9698
6
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/entry_points.txt,sha256=PVQOhNJ_2mgqvdXcqv2KS8Wa2-vZkjatVw0upZga7RU,108
8
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
9
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/licenses/NOTICE,sha256=9GfleTZWBLGtrNSl42TlT_fT7wPBajAx1OQdlIaXUkY,105
10
+ awslabs_stepfunctions_tool_mcp_server-0.1.7.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- awslabs/__init__.py,sha256=4zfFn3N0BkvQmMTAIvV_QAbKp6GWzrwaUN17YeRoChM,115
2
- awslabs/stepfunctions_tool_mcp_server/__init__.py,sha256=n0IrKZR35oICjSeI7vz7nq78OleFf8Rvo09My7d7SJY,67
3
- awslabs/stepfunctions_tool_mcp_server/server.py,sha256=B0yqqtbRS-sKEFaGEUKtTLQ_c2zrCvVDfC5Ry1wc_f8,15474
4
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/METADATA,sha256=tvSFFB0f8U23p7W9tbNlt4kq553TOozKuHkIOiaCMOA,9698
5
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/entry_points.txt,sha256=PVQOhNJ_2mgqvdXcqv2KS8Wa2-vZkjatVw0upZga7RU,108
7
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
8
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/licenses/NOTICE,sha256=9GfleTZWBLGtrNSl42TlT_fT7wPBajAx1OQdlIaXUkY,105
9
- awslabs_stepfunctions_tool_mcp_server-0.1.4.dist-info/RECORD,,