Skip to content

Commit 8ad2f2e

Browse files
committed
chore: use uv workspaces for the examples
1 parent 6e82e27 commit 8ad2f2e

File tree

14 files changed

+3279
-579
lines changed

14 files changed

+3279
-579
lines changed

examples/mcp-client/agent-framework/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@
4949
dotenv.load_dotenv()
5050

5151
# MCP server configuration - can be set via environment variables or .env file
52-
MCP_URL = os.environ.get('MCP_SERVER_URL')
53-
MCP_SERVICE = os.environ.get('MCP_SERVER_AWS_SERVICE')
54-
MCP_REGION = os.environ.get('MCP_SERVER_REGION')
52+
try:
53+
MCP_URL = os.environ['MCP_SERVER_URL']
54+
MCP_SERVICE = os.environ['MCP_SERVER_AWS_SERVICE']
55+
MCP_REGION = os.environ['MCP_SERVER_REGION']
56+
except KeyError:
57+
raise AssertionError('Please follow the README to setup environment variables.')
5558

5659
# OpenAI API key for the language model
5760
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY', '<Your OpenAI API Key>')

examples/mcp-client/agent-framework/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ dependencies = [
99

1010
[tool.uv]
1111
prerelease = "allow"
12+
13+
[tool.uv.sources]
14+
mcp-proxy-for-aws = { workspace = true }

examples/mcp-client/langchain/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@
5454
dotenv.load_dotenv()
5555

5656
# MCP server configuration - can be set via environment variables or .env file
57-
MCP_URL = os.environ.get('MCP_SERVER_URL')
58-
MCP_SERVICE = os.environ.get('MCP_SERVER_AWS_SERVICE')
59-
MCP_REGION = os.environ.get('MCP_SERVER_REGION')
57+
try:
58+
MCP_URL = os.environ['MCP_SERVER_URL']
59+
MCP_SERVICE = os.environ['MCP_SERVER_AWS_SERVICE']
60+
MCP_REGION = os.environ['MCP_SERVER_REGION']
61+
except KeyError:
62+
raise AssertionError('Please follow the README to setup environment variables.')
6063

6164
# The model for the agent (using Claude Haiku on Amazon Bedrock as an example)
6265
BEDROCK_MODEL_ID = 'global.anthropic.claude-haiku-4-5-20251001-v1:0'

examples/mcp-client/langchain/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ dependencies = [
99
"mcp-proxy-for-aws",
1010
"python-dotenv",
1111
]
12+
13+
[tool.uv.sources]
14+
mcp-proxy-for-aws = { workspace = true }

examples/mcp-client/llamaindex/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@
5555
dotenv.load_dotenv()
5656

5757
# MCP server configuration - can be set via environment variables or .env file
58-
MCP_URL = os.environ.get('MCP_SERVER_URL')
59-
MCP_SERVICE = os.environ.get('MCP_SERVER_AWS_SERVICE')
60-
MCP_REGION = os.environ.get('MCP_SERVER_REGION')
58+
try:
59+
MCP_URL = os.environ['MCP_SERVER_URL']
60+
MCP_SERVICE = os.environ['MCP_SERVER_AWS_SERVICE']
61+
MCP_REGION = os.environ['MCP_SERVER_REGION']
62+
except KeyError:
63+
raise AssertionError('Please follow the README to setup environment variables.')
6164

6265
# OpenAI API key for the language model
6366
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY', '<Your OpenAI API Key>')
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
[project]
22
name = "mcp-client-example-llamaindex"
33
version = "0.1.0"
4-
requires-python = ">=3.10"
4+
requires-python = ">=3.10,<3.14"
55
dependencies = [
66
"llama-index",
77
"llama-index-llms-openai",
88
"llama-index-tools-mcp",
99
"mcp-proxy-for-aws",
1010
"python-dotenv",
1111
]
12+
13+
[tool.uv.sources]
14+
mcp-proxy-for-aws = { workspace = true }

examples/mcp-client/strands/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
dotenv.load_dotenv()
4747

4848
# MCP server configuration - can be set via environment variables or .env file
49-
MCP_URL = os.environ.get('MCP_SERVER_URL')
50-
MCP_SERVICE = os.environ.get('MCP_SERVER_AWS_SERVICE')
51-
MCP_REGION = os.environ.get('MCP_SERVER_REGION')
49+
try:
50+
MCP_URL = os.environ['MCP_SERVER_URL']
51+
MCP_SERVICE = os.environ['MCP_SERVER_AWS_SERVICE']
52+
MCP_REGION = os.environ['MCP_SERVER_REGION']
53+
except KeyError:
54+
raise AssertionError('Please follow the README to setup environment variables.')
5255

5356

5457
@asynccontextmanager

examples/mcp-client/strands/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ dependencies = [
77
"python-dotenv",
88
"strands-agents",
99
]
10+
11+
[tool.uv.sources]
12+
mcp-proxy-for-aws = { workspace = true }

pyproject.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[tool.uv]
2+
prerelease = "allow"
3+
4+
[tool.uv.workspace]
5+
members = [
6+
"examples/mcp-client/*"
7+
]
8+
19
[project]
210
name = "mcp-proxy-for-aws"
311

@@ -6,7 +14,7 @@ version = "1.0.0"
614

715
description = "MCP Proxy for AWS"
816
readme = "README.md"
9-
requires-python = ">=3.10"
17+
requires-python = ">=3.10,<3.14"
1018
dependencies = [
1119
"fastmcp>=2.13.0.2",
1220
"boto3>=1.34.0",
@@ -111,7 +119,7 @@ line-ending = "auto"
111119
docstring-code-format = true
112120

113121
[tool.pyright]
114-
include = ["mcp_proxy_for_aws", "tests"]
122+
include = ["mcp_proxy_for_aws", "tests", "examples/*"]
115123
exclude = ["**/__pycache__", "**/.venv", "**/node_modules", "**/dist", "**/build"]
116124

117125
[tool.commitizen]

tests/unit/examples/README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)