awslabs.postgres-mcp-server 1.0.8__tar.gz → 1.0.11__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_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/PKG-INFO +48 -79
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/README.md +44 -76
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/__init__.py +8 -1
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/connection/__init__.py +0 -1
- awslabs_postgres_mcp_server-1.0.11/awslabs/postgres_mcp_server/connection/cp_api_connection.py +592 -0
- awslabs_postgres_mcp_server-1.0.11/awslabs/postgres_mcp_server/connection/db_connection_map.py +128 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/connection/psycopg_pool_connection.py +101 -54
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/connection/rds_api_connection.py +5 -1
- awslabs_postgres_mcp_server-1.0.11/awslabs/postgres_mcp_server/server.py +765 -0
- awslabs_postgres_mcp_server-1.0.11/kiro_power/POWER.md +300 -0
- awslabs_postgres_mcp_server-1.0.11/kiro_power/mcp.json +10 -0
- awslabs_postgres_mcp_server-1.0.11/kiro_power/steering/aurora-postgres-mcp.md +57 -0
- awslabs_postgres_mcp_server-1.0.11/kiro_power/steering/aurora-postgres.md +746 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/pyproject.toml +4 -3
- awslabs_postgres_mcp_server-1.0.11/tests/test_abstract_db_connection.py +60 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_cp_api_connection.py +892 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_cp_api_iam_policy.py +722 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_cp_api_simple_functions.py +158 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_db_connection_map.py +811 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_psycopg_connector.py +1019 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_rds_api_connection.py +302 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/tests/test_server.py +310 -48
- awslabs_postgres_mcp_server-1.0.11/tests/test_server_error_handling.py +147 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_server_helpers.py +155 -0
- awslabs_postgres_mcp_server-1.0.11/tests/test_server_internal_functions.py +341 -0
- awslabs_postgres_mcp_server-1.0.11/uv-requirements.txt +27 -0
- awslabs_postgres_mcp_server-1.0.11/uv.lock +1837 -0
- awslabs_postgres_mcp_server-1.0.8/awslabs/postgres_mcp_server/connection/db_connection_singleton.py +0 -117
- awslabs_postgres_mcp_server-1.0.8/awslabs/postgres_mcp_server/server.py +0 -323
- awslabs_postgres_mcp_server-1.0.8/tests/test_psycopg_connector.py +0 -402
- awslabs_postgres_mcp_server-1.0.8/tests/test_singleton.py +0 -116
- awslabs_postgres_mcp_server-1.0.8/uv-requirements.txt +0 -24
- awslabs_postgres_mcp_server-1.0.8/uv.lock +0 -1378
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/.gitignore +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/.python-version +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/CHANGELOG.md +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/Dockerfile +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/LICENSE +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/NOTICE +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/__init__.py +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/connection/abstract_db_connection.py +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/awslabs/postgres_mcp_server/mutable_sql_detector.py +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/docker-healthcheck.sh +0 -0
- {awslabs_postgres_mcp_server-1.0.8 → awslabs_postgres_mcp_server-1.0.11}/tests/conftest.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.postgres-mcp-server
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.11
|
|
4
4
|
Summary: An AWS Labs Model Context Protocol (MCP) server for postgres
|
|
5
5
|
Project-URL: homepage, https://awslabs.github.io/mcp/
|
|
6
6
|
Project-URL: docs, https://awslabs.github.io/mcp/servers/postgres-mcp-server/
|
|
@@ -21,8 +21,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
24
|
+
Requires-Dist: aiorwlock
|
|
25
|
+
Requires-Dist: boto3>=1.42.4
|
|
26
|
+
Requires-Dist: botocore>1.42.4
|
|
26
27
|
Requires-Dist: loguru>=0.7.0
|
|
27
28
|
Requires-Dist: mcp[cli]>=1.11.0
|
|
28
29
|
Requires-Dist: psycopg[pool]>=3.1.12
|
|
@@ -43,11 +44,9 @@ An AWS Labs Model Context Protocol (MCP) server for Aurora Postgres
|
|
|
43
44
|
|
|
44
45
|
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
|
|
45
46
|
2. Install Python using `uv python install 3.10`
|
|
46
|
-
3.
|
|
47
|
-
4.
|
|
48
|
-
5.
|
|
49
|
-
6. Docker runtime
|
|
50
|
-
7. Set up AWS credentials with access to AWS services
|
|
47
|
+
3. This MCP server can only be run locally on the same host as your LLM client.
|
|
48
|
+
4. Docker runtime
|
|
49
|
+
5. Set up AWS credentials with access to AWS services
|
|
51
50
|
- You need an AWS account with appropriate permissions
|
|
52
51
|
- Configure AWS credentials with `aws configure` or environment variables
|
|
53
52
|
|
|
@@ -59,8 +58,6 @@ An AWS Labs Model Context Protocol (MCP) server for Aurora Postgres
|
|
|
59
58
|
|
|
60
59
|
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
|
|
61
60
|
|
|
62
|
-
### Option 1: Using RDS Data API Connection (for Aurora Postgres)
|
|
63
|
-
|
|
64
61
|
```json
|
|
65
62
|
{
|
|
66
63
|
"mcpServers": {
|
|
@@ -68,11 +65,7 @@ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q De
|
|
|
68
65
|
"command": "uvx",
|
|
69
66
|
"args": [
|
|
70
67
|
"awslabs.postgres-mcp-server@latest",
|
|
71
|
-
"--
|
|
72
|
-
"--secret_arn", "[your data]",
|
|
73
|
-
"--database", "[your data]",
|
|
74
|
-
"--region", "[your data]",
|
|
75
|
-
"--readonly", "True"
|
|
68
|
+
"--allow_write_query"
|
|
76
69
|
],
|
|
77
70
|
"env": {
|
|
78
71
|
"AWS_PROFILE": "your-aws-profile",
|
|
@@ -86,35 +79,6 @@ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q De
|
|
|
86
79
|
}
|
|
87
80
|
```
|
|
88
81
|
|
|
89
|
-
### Option 2: Using Direct PostgreSQL(psycopg) Connection (for Aurora Postgres and RDS Postgres)
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"mcpServers": {
|
|
94
|
-
"awslabs.postgres-mcp-server": {
|
|
95
|
-
"command": "uvx",
|
|
96
|
-
"args": [
|
|
97
|
-
"awslabs.postgres-mcp-server@latest",
|
|
98
|
-
"--hostname", "[your data]",
|
|
99
|
-
"--secret_arn", "[your data]",
|
|
100
|
-
"--database", "[your data]",
|
|
101
|
-
"--region", "[your data]",
|
|
102
|
-
"--readonly", "True"
|
|
103
|
-
],
|
|
104
|
-
"env": {
|
|
105
|
-
"AWS_PROFILE": "your-aws-profile",
|
|
106
|
-
"AWS_REGION": "us-east-1",
|
|
107
|
-
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
108
|
-
},
|
|
109
|
-
"disabled": false,
|
|
110
|
-
"autoApprove": []
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Note: The `--port` parameter is optional and defaults to 5432 (the standard PostgreSQL port). You only need to specify it if your PostgreSQL instance uses a non-standard port.
|
|
117
|
-
|
|
118
82
|
### Windows Installation
|
|
119
83
|
|
|
120
84
|
For Windows users, the MCP server configuration format is slightly different:
|
|
@@ -167,56 +131,61 @@ For Windows users, the MCP server configuration format is slightly different:
|
|
|
167
131
|
"-e", "AWS_SECRET_ACCESS_KEY=[your data]",
|
|
168
132
|
"-e", "AWS_REGION=[your data]",
|
|
169
133
|
"awslabs/postgres-mcp-server:latest",
|
|
170
|
-
"--
|
|
171
|
-
"--secret_arn", "[your data]",
|
|
172
|
-
"--database", "[your data]",
|
|
173
|
-
"--region", "[your data]",
|
|
174
|
-
"--readonly", "True"
|
|
134
|
+
"--allow_write_query"
|
|
175
135
|
]
|
|
176
136
|
}
|
|
177
137
|
}
|
|
178
138
|
}
|
|
179
139
|
```
|
|
180
140
|
|
|
181
|
-
|
|
141
|
+
NOTE: the MCP config example include --allow_write_query illustrate how to enable write queries. If you want to disable write queries, remove --allow_write_query option.
|
|
182
142
|
|
|
183
|
-
|
|
184
|
-
{
|
|
185
|
-
"mcpServers": {
|
|
186
|
-
"awslabs.postgres-mcp-server": {
|
|
187
|
-
"command": "docker",
|
|
188
|
-
"args": [
|
|
189
|
-
"run",
|
|
190
|
-
"-i",
|
|
191
|
-
"--rm",
|
|
192
|
-
"-e", "AWS_ACCESS_KEY_ID=[your data]",
|
|
193
|
-
"-e", "AWS_SECRET_ACCESS_KEY=[your data]",
|
|
194
|
-
"-e", "AWS_REGION=[your data]",
|
|
195
|
-
"awslabs/postgres-mcp-server:latest",
|
|
196
|
-
"--hostname", "[your data]",
|
|
197
|
-
"--secret_arn", "[your data]",
|
|
198
|
-
"--database", "[your data]",
|
|
199
|
-
"--region", "[your data]",
|
|
200
|
-
"--readonly", "True"
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
```
|
|
143
|
+
## Support for Database Cluster Creation
|
|
206
144
|
|
|
207
|
-
|
|
145
|
+
You can use the following LLM prompt to create a new Aurora PostgreSQL cluster:
|
|
208
146
|
|
|
209
|
-
|
|
147
|
+
> Create an Aurora PostgreSQL cluster named 'mycluster' in us-west-2 region
|
|
148
|
+
|
|
149
|
+
---
|
|
210
150
|
|
|
211
151
|
## Connection Methods
|
|
212
152
|
|
|
213
|
-
|
|
153
|
+
The MCP server supports connecting to multiple database endpoints using different connection methods via LLM prompts.
|
|
154
|
+
|
|
155
|
+
### Database Types
|
|
156
|
+
- **APG**: Amazon Aurora PostgreSQL
|
|
157
|
+
- **RPG**: Amazon RDS for PostgreSQL
|
|
158
|
+
|
|
159
|
+
### Example Prompts
|
|
160
|
+
|
|
161
|
+
**Connect using RDS Data API:**
|
|
162
|
+
> Connect to database named postgres in Aurora PostgreSQL cluster 'my-cluster' with database_type as APG, using rdsapi as connection method in us-west-2 region
|
|
163
|
+
|
|
164
|
+
**Connect using pgwire (Aurora PostgreSQL):**
|
|
165
|
+
> Connect to database named postgres with database endpoint as my-apg17-instance-1.ctgfg6yyo9df.us-west-2.rds.amazonaws.com with database_type as APG, using pgwire as connection method in us-west-2 region
|
|
166
|
+
|
|
167
|
+
**Connect using pgwire (RDS PostgreSQL):**
|
|
168
|
+
> Connect to database named postgres with database endpoint as test-apg17-instance-1.ctgfg6yyo9df.us-west-2.rds.amazonaws.com with database_type as RPG, using pgwire as connection method in us-west-2 region
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Supported Connection Methods
|
|
173
|
+
|
|
174
|
+
| Method | Description | Supported Database Types |
|
|
175
|
+
|--------|-------------|--------------------------|
|
|
176
|
+
| `pgwire` | Connect to PostgreSQL instance directly using the PostgreSQL wire protocol. Requires proper VPC security group configuration for direct database connectivity. | APG, RPG |
|
|
177
|
+
| `pgwire_iam` | Same as `pgwire`, but uses IAM authentication. Requires IAM authentication to be enabled on the Aurora PostgreSQL cluster. | APG only |
|
|
178
|
+
| `rdsapi` | Connect to Aurora PostgreSQL using the RDS Data API. Requires the RDS Data API to be enabled on the cluster. | APG only |
|
|
214
179
|
|
|
215
|
-
|
|
180
|
+
### Prerequisites by Connection Method
|
|
216
181
|
|
|
217
|
-
|
|
182
|
+
#### pgwire / pgwire_iam
|
|
183
|
+
- VPC security group must allow inbound connections from your MCP server to the database
|
|
184
|
+
- For `pgwire_iam`: IAM authentication must be enabled on the Aurora PostgreSQL cluster
|
|
218
185
|
|
|
219
|
-
|
|
186
|
+
#### rdsapi
|
|
187
|
+
- RDS Data API must be enabled on the Aurora PostgreSQL cluster
|
|
188
|
+
- Appropriate IAM permissions for Data API access
|
|
220
189
|
|
|
221
190
|
### AWS Authentication
|
|
222
191
|
|
|
@@ -12,11 +12,9 @@ An AWS Labs Model Context Protocol (MCP) server for Aurora Postgres
|
|
|
12
12
|
|
|
13
13
|
1. Install `uv` from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
|
|
14
14
|
2. Install Python using `uv python install 3.10`
|
|
15
|
-
3.
|
|
16
|
-
4.
|
|
17
|
-
5.
|
|
18
|
-
6. Docker runtime
|
|
19
|
-
7. Set up AWS credentials with access to AWS services
|
|
15
|
+
3. This MCP server can only be run locally on the same host as your LLM client.
|
|
16
|
+
4. Docker runtime
|
|
17
|
+
5. Set up AWS credentials with access to AWS services
|
|
20
18
|
- You need an AWS account with appropriate permissions
|
|
21
19
|
- Configure AWS credentials with `aws configure` or environment variables
|
|
22
20
|
|
|
@@ -28,8 +26,6 @@ An AWS Labs Model Context Protocol (MCP) server for Aurora Postgres
|
|
|
28
26
|
|
|
29
27
|
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
|
|
30
28
|
|
|
31
|
-
### Option 1: Using RDS Data API Connection (for Aurora Postgres)
|
|
32
|
-
|
|
33
29
|
```json
|
|
34
30
|
{
|
|
35
31
|
"mcpServers": {
|
|
@@ -37,11 +33,7 @@ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q De
|
|
|
37
33
|
"command": "uvx",
|
|
38
34
|
"args": [
|
|
39
35
|
"awslabs.postgres-mcp-server@latest",
|
|
40
|
-
"--
|
|
41
|
-
"--secret_arn", "[your data]",
|
|
42
|
-
"--database", "[your data]",
|
|
43
|
-
"--region", "[your data]",
|
|
44
|
-
"--readonly", "True"
|
|
36
|
+
"--allow_write_query"
|
|
45
37
|
],
|
|
46
38
|
"env": {
|
|
47
39
|
"AWS_PROFILE": "your-aws-profile",
|
|
@@ -55,35 +47,6 @@ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q De
|
|
|
55
47
|
}
|
|
56
48
|
```
|
|
57
49
|
|
|
58
|
-
### Option 2: Using Direct PostgreSQL(psycopg) Connection (for Aurora Postgres and RDS Postgres)
|
|
59
|
-
|
|
60
|
-
```json
|
|
61
|
-
{
|
|
62
|
-
"mcpServers": {
|
|
63
|
-
"awslabs.postgres-mcp-server": {
|
|
64
|
-
"command": "uvx",
|
|
65
|
-
"args": [
|
|
66
|
-
"awslabs.postgres-mcp-server@latest",
|
|
67
|
-
"--hostname", "[your data]",
|
|
68
|
-
"--secret_arn", "[your data]",
|
|
69
|
-
"--database", "[your data]",
|
|
70
|
-
"--region", "[your data]",
|
|
71
|
-
"--readonly", "True"
|
|
72
|
-
],
|
|
73
|
-
"env": {
|
|
74
|
-
"AWS_PROFILE": "your-aws-profile",
|
|
75
|
-
"AWS_REGION": "us-east-1",
|
|
76
|
-
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
77
|
-
},
|
|
78
|
-
"disabled": false,
|
|
79
|
-
"autoApprove": []
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Note: The `--port` parameter is optional and defaults to 5432 (the standard PostgreSQL port). You only need to specify it if your PostgreSQL instance uses a non-standard port.
|
|
86
|
-
|
|
87
50
|
### Windows Installation
|
|
88
51
|
|
|
89
52
|
For Windows users, the MCP server configuration format is slightly different:
|
|
@@ -136,56 +99,61 @@ For Windows users, the MCP server configuration format is slightly different:
|
|
|
136
99
|
"-e", "AWS_SECRET_ACCESS_KEY=[your data]",
|
|
137
100
|
"-e", "AWS_REGION=[your data]",
|
|
138
101
|
"awslabs/postgres-mcp-server:latest",
|
|
139
|
-
"--
|
|
140
|
-
"--secret_arn", "[your data]",
|
|
141
|
-
"--database", "[your data]",
|
|
142
|
-
"--region", "[your data]",
|
|
143
|
-
"--readonly", "True"
|
|
102
|
+
"--allow_write_query"
|
|
144
103
|
]
|
|
145
104
|
}
|
|
146
105
|
}
|
|
147
106
|
}
|
|
148
107
|
```
|
|
149
108
|
|
|
150
|
-
|
|
109
|
+
NOTE: the MCP config example include --allow_write_query illustrate how to enable write queries. If you want to disable write queries, remove --allow_write_query option.
|
|
151
110
|
|
|
152
|
-
|
|
153
|
-
{
|
|
154
|
-
"mcpServers": {
|
|
155
|
-
"awslabs.postgres-mcp-server": {
|
|
156
|
-
"command": "docker",
|
|
157
|
-
"args": [
|
|
158
|
-
"run",
|
|
159
|
-
"-i",
|
|
160
|
-
"--rm",
|
|
161
|
-
"-e", "AWS_ACCESS_KEY_ID=[your data]",
|
|
162
|
-
"-e", "AWS_SECRET_ACCESS_KEY=[your data]",
|
|
163
|
-
"-e", "AWS_REGION=[your data]",
|
|
164
|
-
"awslabs/postgres-mcp-server:latest",
|
|
165
|
-
"--hostname", "[your data]",
|
|
166
|
-
"--secret_arn", "[your data]",
|
|
167
|
-
"--database", "[your data]",
|
|
168
|
-
"--region", "[your data]",
|
|
169
|
-
"--readonly", "True"
|
|
170
|
-
]
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
```
|
|
111
|
+
## Support for Database Cluster Creation
|
|
175
112
|
|
|
176
|
-
|
|
113
|
+
You can use the following LLM prompt to create a new Aurora PostgreSQL cluster:
|
|
177
114
|
|
|
178
|
-
|
|
115
|
+
> Create an Aurora PostgreSQL cluster named 'mycluster' in us-west-2 region
|
|
116
|
+
|
|
117
|
+
---
|
|
179
118
|
|
|
180
119
|
## Connection Methods
|
|
181
120
|
|
|
182
|
-
|
|
121
|
+
The MCP server supports connecting to multiple database endpoints using different connection methods via LLM prompts.
|
|
122
|
+
|
|
123
|
+
### Database Types
|
|
124
|
+
- **APG**: Amazon Aurora PostgreSQL
|
|
125
|
+
- **RPG**: Amazon RDS for PostgreSQL
|
|
126
|
+
|
|
127
|
+
### Example Prompts
|
|
128
|
+
|
|
129
|
+
**Connect using RDS Data API:**
|
|
130
|
+
> Connect to database named postgres in Aurora PostgreSQL cluster 'my-cluster' with database_type as APG, using rdsapi as connection method in us-west-2 region
|
|
131
|
+
|
|
132
|
+
**Connect using pgwire (Aurora PostgreSQL):**
|
|
133
|
+
> Connect to database named postgres with database endpoint as my-apg17-instance-1.ctgfg6yyo9df.us-west-2.rds.amazonaws.com with database_type as APG, using pgwire as connection method in us-west-2 region
|
|
134
|
+
|
|
135
|
+
**Connect using pgwire (RDS PostgreSQL):**
|
|
136
|
+
> Connect to database named postgres with database endpoint as test-apg17-instance-1.ctgfg6yyo9df.us-west-2.rds.amazonaws.com with database_type as RPG, using pgwire as connection method in us-west-2 region
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### Supported Connection Methods
|
|
141
|
+
|
|
142
|
+
| Method | Description | Supported Database Types |
|
|
143
|
+
|--------|-------------|--------------------------|
|
|
144
|
+
| `pgwire` | Connect to PostgreSQL instance directly using the PostgreSQL wire protocol. Requires proper VPC security group configuration for direct database connectivity. | APG, RPG |
|
|
145
|
+
| `pgwire_iam` | Same as `pgwire`, but uses IAM authentication. Requires IAM authentication to be enabled on the Aurora PostgreSQL cluster. | APG only |
|
|
146
|
+
| `rdsapi` | Connect to Aurora PostgreSQL using the RDS Data API. Requires the RDS Data API to be enabled on the cluster. | APG only |
|
|
183
147
|
|
|
184
|
-
|
|
148
|
+
### Prerequisites by Connection Method
|
|
185
149
|
|
|
186
|
-
|
|
150
|
+
#### pgwire / pgwire_iam
|
|
151
|
+
- VPC security group must allow inbound connections from your MCP server to the database
|
|
152
|
+
- For `pgwire_iam`: IAM authentication must be enabled on the Aurora PostgreSQL cluster
|
|
187
153
|
|
|
188
|
-
|
|
154
|
+
#### rdsapi
|
|
155
|
+
- RDS Data API must be enabled on the Aurora PostgreSQL cluster
|
|
156
|
+
- Appropriate IAM permissions for Data API access
|
|
189
157
|
|
|
190
158
|
### AWS Authentication
|
|
191
159
|
|
|
@@ -14,4 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
"""awslabs.postgres-mcp-server"""
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
from importlib.metadata import version
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
__version__ = version('awslabs.postgres-mcp-server')
|
|
21
|
+
except Exception:
|
|
22
|
+
__version__ = '1.0.11'
|
|
23
|
+
|
|
24
|
+
__user_agent__ = f'awslabs/mcp/postgres_mcp_server/{__version__}'
|