mcp-postgresql-ops 3.1.5__tar.gz → 3.1.6__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.
- {mcp_postgresql_ops-3.1.5/src/mcp_postgresql_ops.egg-info → mcp_postgresql_ops-3.1.6}/PKG-INFO +5 -5
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/README.md +4 -4
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/pyproject.toml +1 -1
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/mcp_main.py +23 -24
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6/src/mcp_postgresql_ops.egg-info}/PKG-INFO +5 -5
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/LICENSE +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/MANIFEST.in +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/setup.cfg +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/__init__.py +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/__main__.py +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/functions.py +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/version_compat.py +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/SOURCES.txt +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/dependency_links.txt +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/entry_points.txt +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/requires.txt +0 -0
- {mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/top_level.txt +0 -0
{mcp_postgresql_ops-3.1.5/src/mcp_postgresql_ops.egg-info → mcp_postgresql_ops-3.1.6}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-postgresql-ops
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.6
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author-email: JungJungIn <call518@gmail.com>
|
|
6
6
|
Requires-Python: >=3.12
|
|
@@ -981,17 +981,17 @@ For `streamable-http` mode, this MCP server supports Bearer token authentication
|
|
|
981
981
|
```bash
|
|
982
982
|
# In .env file
|
|
983
983
|
REMOTE_AUTH_ENABLE=true
|
|
984
|
-
REMOTE_SECRET_KEY=
|
|
984
|
+
REMOTE_SECRET_KEY=my-test-secret-key-12345
|
|
985
985
|
```
|
|
986
986
|
|
|
987
987
|
**Or via CLI:**
|
|
988
988
|
|
|
989
989
|
```bash
|
|
990
990
|
# Module method
|
|
991
|
-
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key
|
|
991
|
+
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
992
992
|
|
|
993
993
|
# Script method
|
|
994
|
-
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key
|
|
994
|
+
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
995
995
|
```
|
|
996
996
|
|
|
997
997
|
#### Security Levels
|
|
@@ -1011,7 +1011,7 @@ When authentication is enabled, MCP clients must include the Bearer token in the
|
|
|
1011
1011
|
"type": "streamable-http",
|
|
1012
1012
|
"url": "http://your-server:8000/mcp",
|
|
1013
1013
|
"headers": {
|
|
1014
|
-
"Authorization": "Bearer
|
|
1014
|
+
"Authorization": "Bearer my-test-secret-key-12345"
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
@@ -965,17 +965,17 @@ For `streamable-http` mode, this MCP server supports Bearer token authentication
|
|
|
965
965
|
```bash
|
|
966
966
|
# In .env file
|
|
967
967
|
REMOTE_AUTH_ENABLE=true
|
|
968
|
-
REMOTE_SECRET_KEY=
|
|
968
|
+
REMOTE_SECRET_KEY=my-test-secret-key-12345
|
|
969
969
|
```
|
|
970
970
|
|
|
971
971
|
**Or via CLI:**
|
|
972
972
|
|
|
973
973
|
```bash
|
|
974
974
|
# Module method
|
|
975
|
-
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key
|
|
975
|
+
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
976
976
|
|
|
977
977
|
# Script method
|
|
978
|
-
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key
|
|
978
|
+
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
979
979
|
```
|
|
980
980
|
|
|
981
981
|
#### Security Levels
|
|
@@ -995,7 +995,7 @@ When authentication is enabled, MCP clients must include the Bearer token in the
|
|
|
995
995
|
"type": "streamable-http",
|
|
996
996
|
"url": "http://your-server:8000/mcp",
|
|
997
997
|
"headers": {
|
|
998
|
-
"Authorization": "Bearer
|
|
998
|
+
"Authorization": "Bearer my-test-secret-key-12345"
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
@@ -63,30 +63,27 @@ logging.basicConfig(
|
|
|
63
63
|
# Authentication Setup
|
|
64
64
|
# =============================================================================
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
_auth_enable = os.environ.get("REMOTE_AUTH_ENABLE", "false").lower() == "true"
|
|
68
|
-
_secret_key = os.environ.get("REMOTE_SECRET_KEY", "")
|
|
66
|
+
TRUTHY_VALUES = ("true", "1", "yes", "on")
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
|
|
69
|
+
def _parse_bool_env(value: str) -> bool:
|
|
70
|
+
return value.strip().lower() in TRUTHY_VALUES
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _build_static_token_auth(secret_key: str) -> StaticTokenVerifier:
|
|
75
74
|
tokens = {
|
|
76
|
-
|
|
75
|
+
secret_key: {
|
|
77
76
|
"client_id": "postgresql-ops-client",
|
|
78
|
-
"user": "admin",
|
|
79
77
|
"scopes": ["read", "write"],
|
|
80
|
-
"description": "PostgreSQL Operations access token"
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
return StaticTokenVerifier(tokens=tokens)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# Initialize MCP instance once for decorator registration.
|
|
84
|
+
# Runtime authentication is configured in main() before mcp.run().
|
|
85
|
+
logger.info("Initializing MCP instance")
|
|
86
|
+
mcp = FastMCP("mcp-postgresql-ops")
|
|
90
87
|
|
|
91
88
|
# =============================================================================
|
|
92
89
|
# Server initialization
|
|
@@ -3684,7 +3681,9 @@ def main(argv: Optional[list] = None) -> None:
|
|
|
3684
3681
|
port = args.port or int(os.getenv("FASTMCP_PORT", "8000"))
|
|
3685
3682
|
|
|
3686
3683
|
# Authentication settings
|
|
3687
|
-
auth_enable = args.auth_enable or
|
|
3684
|
+
auth_enable = args.auth_enable or _parse_bool_env(
|
|
3685
|
+
os.getenv("REMOTE_AUTH_ENABLE", "false")
|
|
3686
|
+
)
|
|
3688
3687
|
secret_key = args.secret_key or os.getenv("REMOTE_SECRET_KEY", "")
|
|
3689
3688
|
|
|
3690
3689
|
# Validation for streamable-http mode with authentication
|
|
@@ -3700,11 +3699,11 @@ def main(argv: Optional[list] = None) -> None:
|
|
|
3700
3699
|
logger.warning("This server will accept requests without Bearer token verification.")
|
|
3701
3700
|
logger.warning("Set REMOTE_AUTH_ENABLE=true and REMOTE_SECRET_KEY to enable authentication.")
|
|
3702
3701
|
|
|
3703
|
-
#
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3702
|
+
# Configure authentication provider before server startup.
|
|
3703
|
+
if auth_enable:
|
|
3704
|
+
mcp.auth = _build_static_token_auth(secret_key)
|
|
3705
|
+
else:
|
|
3706
|
+
mcp.auth = None
|
|
3708
3707
|
|
|
3709
3708
|
# Debug logging for environment variables
|
|
3710
3709
|
logger.debug(f"Environment variables - POSTGRES_HOST: {os.getenv('POSTGRES_HOST')}, POSTGRES_PORT: {os.getenv('POSTGRES_PORT')}")
|
{mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6/src/mcp_postgresql_ops.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-postgresql-ops
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.6
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author-email: JungJungIn <call518@gmail.com>
|
|
6
6
|
Requires-Python: >=3.12
|
|
@@ -981,17 +981,17 @@ For `streamable-http` mode, this MCP server supports Bearer token authentication
|
|
|
981
981
|
```bash
|
|
982
982
|
# In .env file
|
|
983
983
|
REMOTE_AUTH_ENABLE=true
|
|
984
|
-
REMOTE_SECRET_KEY=
|
|
984
|
+
REMOTE_SECRET_KEY=my-test-secret-key-12345
|
|
985
985
|
```
|
|
986
986
|
|
|
987
987
|
**Or via CLI:**
|
|
988
988
|
|
|
989
989
|
```bash
|
|
990
990
|
# Module method
|
|
991
|
-
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key
|
|
991
|
+
python -m mcp_postgresql_ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
992
992
|
|
|
993
993
|
# Script method
|
|
994
|
-
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key
|
|
994
|
+
mcp-postgresql-ops --type streamable-http --auth-enable --secret-key my-test-secret-key-12345
|
|
995
995
|
```
|
|
996
996
|
|
|
997
997
|
#### Security Levels
|
|
@@ -1011,7 +1011,7 @@ When authentication is enabled, MCP clients must include the Bearer token in the
|
|
|
1011
1011
|
"type": "streamable-http",
|
|
1012
1012
|
"url": "http://your-server:8000/mcp",
|
|
1013
1013
|
"headers": {
|
|
1014
|
-
"Authorization": "Bearer
|
|
1014
|
+
"Authorization": "Bearer my-test-secret-key-12345"
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops/version_compat.py
RENAMED
|
File without changes
|
{mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/requires.txt
RENAMED
|
File without changes
|
{mcp_postgresql_ops-3.1.5 → mcp_postgresql_ops-3.1.6}/src/mcp_postgresql_ops.egg-info/top_level.txt
RENAMED
|
File without changes
|