awslabs.stepfunctions-tool-mcp-server 0.1.4__tar.gz → 0.1.7__tar.gz
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_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/Dockerfile +11 -8
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/PKG-INFO +1 -1
- awslabs_stepfunctions_tool_mcp_server-0.1.7/awslabs/__init__.py +16 -0
- awslabs_stepfunctions_tool_mcp_server-0.1.7/awslabs/stepfunctions_tool_mcp_server/__init__.py +17 -0
- awslabs_stepfunctions_tool_mcp_server-0.1.7/awslabs/stepfunctions_tool_mcp_server/aws_helper.py +71 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/awslabs/stepfunctions_tool_mcp_server/server.py +22 -9
- awslabs_stepfunctions_tool_mcp_server-0.1.7/docker-healthcheck.sh +26 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/pyproject.toml +2 -1
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/run_tests.sh +15 -0
- awslabs_stepfunctions_tool_mcp_server-0.1.7/tests/test_aws_helper.py +66 -0
- awslabs_stepfunctions_tool_mcp_server-0.1.7/tests/test_server.py +23 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/uv.lock +3 -1
- awslabs_stepfunctions_tool_mcp_server-0.1.4/awslabs/__init__.py +0 -2
- awslabs_stepfunctions_tool_mcp_server-0.1.4/awslabs/stepfunctions_tool_mcp_server/__init__.py +0 -3
- awslabs_stepfunctions_tool_mcp_server-0.1.4/docker-healthcheck.sh +0 -12
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/.gitignore +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/.pre-commit-config.yaml +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/.python-version +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/CHANGELOG.md +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/LICENSE +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/NOTICE +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/README.md +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/.gitignore +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/README.md +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/__init__.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_create_state_machine_tool.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_filter_state_machines_by_tag.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_format_state_machine_response.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_get_schema_arn_from_state_machine_arn.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_get_schema_from_registry.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_invoke_express_state_machine_impl.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_invoke_standard_state_machine_impl.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_main.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_register_state_machines.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_sanitize_tool_name.py +0 -0
- {awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/tests/test_validate_state_machine_name.py +0 -0
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
4
|
-
#
|
|
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
|
|
5
6
|
#
|
|
6
|
-
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
8
|
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
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.
|
|
11
14
|
|
|
12
15
|
#FROM public.ecr.aws/sam/build-python3.10:1.137.1-20250411084548
|
|
13
|
-
FROM public.ecr.aws/sam/build-python3.10@sha256:
|
|
16
|
+
FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1 AS uv
|
|
14
17
|
|
|
15
18
|
# Install the project into `/app`
|
|
16
19
|
WORKDIR /app
|
|
@@ -44,7 +47,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
|
44
47
|
# Make the directory just in case it doesn't exist
|
|
45
48
|
RUN mkdir -p /root/.local
|
|
46
49
|
|
|
47
|
-
FROM public.ecr.aws/sam/build-python3.10@sha256:
|
|
50
|
+
FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1
|
|
48
51
|
|
|
49
52
|
# Place executables in the environment at the front of the path and include other binaries
|
|
50
53
|
ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
|
{awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.stepfunctions-tool-mcp-server
|
|
3
|
-
Version: 0.1.
|
|
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,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
|
+
|
|
15
|
+
# This file is part of the awslabs namespace.
|
|
16
|
+
# It is intentionally minimal to support PEP 420 namespace packages.
|
|
@@ -0,0 +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
|
+
|
|
15
|
+
"""awslabs.stepfunctions-tool-mcp-server"""
|
|
16
|
+
|
|
17
|
+
__version__ = '0.0.0'
|
awslabs_stepfunctions_tool_mcp_server-0.1.7/awslabs/stepfunctions_tool_mcp_server/aws_helper.py
ADDED
|
@@ -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
|
-
|
|
18
|
-
logger.info(f'
|
|
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
|
-
|
|
44
|
-
|
|
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',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
if [ "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\s.*socket$" | wc -l)" -ne "0" ]; then
|
|
18
|
+
echo -n "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\s.*socket$" | wc -l) awslabs.* streams found";
|
|
19
|
+
exit 0;
|
|
20
|
+
else
|
|
21
|
+
echo -n "Zero awslabs.* streams found";
|
|
22
|
+
exit 1;
|
|
23
|
+
fi;
|
|
24
|
+
|
|
25
|
+
echo -n "Never should reach here";
|
|
26
|
+
exit 99;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "awslabs.stepfunctions-tool-mcp-server"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.7" # When updating this version, also update __version__ in awslabs/stepfunctions_tool_mcp_server/server.py
|
|
4
4
|
description = "An AWS Labs Model Context Protocol (MCP) server for AWS Step Functions"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -47,6 +47,7 @@ dev = [
|
|
|
47
47
|
"pytest-asyncio>=0.26.0",
|
|
48
48
|
"pytest-cov>=4.1.0",
|
|
49
49
|
"pytest-mock>=3.12.0",
|
|
50
|
+
"tomli>=2.0.1",
|
|
50
51
|
]
|
|
51
52
|
|
|
52
53
|
[build-system]
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
2
17
|
# Script to run the stepfunctions-tool-mcp-server tests
|
|
3
18
|
|
|
4
19
|
# Set the Python path to include the current directory and the parent directory
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Tests for the AWS Helper."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from awslabs.stepfunctions_tool_mcp_server.aws_helper import AwsHelper
|
|
5
|
+
from awslabs.stepfunctions_tool_mcp_server.server import __version__
|
|
6
|
+
from unittest.mock import ANY, MagicMock, patch
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TestAwsHelper:
|
|
10
|
+
"""Tests for the AwsHelper class."""
|
|
11
|
+
|
|
12
|
+
def test_get_aws_region_default(self):
|
|
13
|
+
"""Test that get_aws_region returns the default region."""
|
|
14
|
+
with patch.dict(os.environ, {}, clear=True):
|
|
15
|
+
region = AwsHelper.get_aws_region()
|
|
16
|
+
assert region == 'us-east-1'
|
|
17
|
+
|
|
18
|
+
@patch.dict(os.environ, {'AWS_REGION': 'us-west-2'})
|
|
19
|
+
def test_get_aws_region_from_env(self):
|
|
20
|
+
"""Test that get_aws_region returns the region from the environment."""
|
|
21
|
+
region = AwsHelper.get_aws_region()
|
|
22
|
+
assert region == 'us-west-2'
|
|
23
|
+
|
|
24
|
+
@patch.dict(os.environ, {'AWS_PROFILE': 'test-profile'})
|
|
25
|
+
def test_get_aws_profile_from_env(self):
|
|
26
|
+
"""Test that get_aws_profile returns the profile from the environment."""
|
|
27
|
+
profile = AwsHelper.get_aws_profile()
|
|
28
|
+
assert profile == 'test-profile'
|
|
29
|
+
|
|
30
|
+
@patch('boto3.Session')
|
|
31
|
+
def test_create_boto3_client_with_profile(self, mock_boto3_session):
|
|
32
|
+
"""Test client creation with profile."""
|
|
33
|
+
mock_session = MagicMock()
|
|
34
|
+
mock_boto3_session.return_value = mock_session
|
|
35
|
+
|
|
36
|
+
with patch.object(AwsHelper, 'get_aws_profile', return_value='test-profile'):
|
|
37
|
+
with patch.object(AwsHelper, 'get_aws_region', return_value='us-west-2'):
|
|
38
|
+
AwsHelper.create_boto3_client('stepfunctions')
|
|
39
|
+
mock_boto3_session.assert_called_once_with(profile_name='test-profile')
|
|
40
|
+
mock_session.client.assert_called_once_with(
|
|
41
|
+
'stepfunctions', region_name='us-west-2', config=ANY
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
@patch('boto3.client')
|
|
45
|
+
def test_create_boto3_client_without_profile(self, mock_boto3_client):
|
|
46
|
+
"""Test client creation without profile."""
|
|
47
|
+
with patch.object(AwsHelper, 'get_aws_profile', return_value=None):
|
|
48
|
+
with patch.object(AwsHelper, 'get_aws_region', return_value='us-west-2'):
|
|
49
|
+
AwsHelper.create_boto3_client('stepfunctions')
|
|
50
|
+
mock_boto3_client.assert_called_once_with(
|
|
51
|
+
'stepfunctions', region_name='us-west-2', config=ANY
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
def test_create_boto3_client_user_agent(self):
|
|
55
|
+
"""Test that create_boto3_client sets the user agent correctly."""
|
|
56
|
+
mock_session = MagicMock()
|
|
57
|
+
with patch('boto3.Session', return_value=mock_session):
|
|
58
|
+
with patch.object(AwsHelper, 'get_aws_profile', return_value='test-profile'):
|
|
59
|
+
AwsHelper.create_boto3_client('stepfunctions')
|
|
60
|
+
_, kwargs = mock_session.client.call_args
|
|
61
|
+
config = kwargs.get('config')
|
|
62
|
+
assert config is not None
|
|
63
|
+
assert (
|
|
64
|
+
config.user_agent_extra
|
|
65
|
+
== f'awslabs/mcp/aws-stepfunctions-tool-mcp-server/{__version__}'
|
|
66
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Tests for the Step Functions Tool MCP Server."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# https://github.com/awslabs/mcp/issues/167
|
|
5
|
+
# https://github.com/awslabs/mcp/issues/425
|
|
6
|
+
# def test_version_matches_pyproject():
|
|
7
|
+
# """Test that the version in server.py matches pyproject.toml."""
|
|
8
|
+
# import pathlib
|
|
9
|
+
# import tomli
|
|
10
|
+
|
|
11
|
+
# # Read pyproject.toml
|
|
12
|
+
# pyproject_path = pathlib.Path(__file__).parent.parent / 'pyproject.toml'
|
|
13
|
+
# with open(pyproject_path, 'rb') as f:
|
|
14
|
+
# pyproject = tomli.load(f)
|
|
15
|
+
|
|
16
|
+
# # Get version from pyproject.toml
|
|
17
|
+
# pyproject_version = pyproject['project']['version']
|
|
18
|
+
|
|
19
|
+
# # Verify versions match
|
|
20
|
+
# assert __version__ == pyproject_version, (
|
|
21
|
+
# f'Version mismatch: server.py has version {__version__}, '
|
|
22
|
+
# f'but pyproject.toml has version {pyproject_version}'
|
|
23
|
+
# )
|
{awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/uv.lock
RENAMED
|
@@ -37,7 +37,7 @@ wheels = [
|
|
|
37
37
|
|
|
38
38
|
[[package]]
|
|
39
39
|
name = "awslabs-stepfunctions-tool-mcp-server"
|
|
40
|
-
version = "0.1.
|
|
40
|
+
version = "0.1.5"
|
|
41
41
|
source = { editable = "." }
|
|
42
42
|
dependencies = [
|
|
43
43
|
{ name = "boto3" },
|
|
@@ -55,6 +55,7 @@ dev = [
|
|
|
55
55
|
{ name = "pytest-cov" },
|
|
56
56
|
{ name = "pytest-mock" },
|
|
57
57
|
{ name = "ruff" },
|
|
58
|
+
{ name = "tomli" },
|
|
58
59
|
]
|
|
59
60
|
|
|
60
61
|
[package.metadata]
|
|
@@ -74,6 +75,7 @@ dev = [
|
|
|
74
75
|
{ name = "pytest-cov", specifier = ">=4.1.0" },
|
|
75
76
|
{ name = "pytest-mock", specifier = ">=3.12.0" },
|
|
76
77
|
{ name = "ruff", specifier = ">=0.9.7" },
|
|
78
|
+
{ name = "tomli", specifier = ">=2.0.1" },
|
|
77
79
|
]
|
|
78
80
|
|
|
79
81
|
[[package]]
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
if [ "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\s.*socket$" | wc -l)" -ne "0" ]; then
|
|
4
|
-
echo -n "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\s.*socket$" | wc -l) awslabs.* streams found";
|
|
5
|
-
exit 0;
|
|
6
|
-
else
|
|
7
|
-
echo -n "Zero awslabs.* streams found";
|
|
8
|
-
exit 1;
|
|
9
|
-
fi;
|
|
10
|
-
|
|
11
|
-
echo -n "Never should reach here";
|
|
12
|
-
exit 99;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/LICENSE
RENAMED
|
File without changes
|
{awslabs_stepfunctions_tool_mcp_server-0.1.4 → awslabs_stepfunctions_tool_mcp_server-0.1.7}/NOTICE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|