mcp-postgresql-ops 3.2.4__tar.gz → 3.2.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.
Files changed (19) hide show
  1. {mcp_postgresql_ops-3.2.4/src/mcp_postgresql_ops.egg-info → mcp_postgresql_ops-3.2.6}/PKG-INFO +42 -5
  2. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/README.md +41 -4
  3. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/pyproject.toml +1 -1
  4. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6/src/mcp_postgresql_ops.egg-info}/PKG-INFO +42 -5
  5. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/tests/test_tools_integration.py +46 -40
  6. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/LICENSE +0 -0
  7. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/MANIFEST.in +0 -0
  8. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/setup.cfg +0 -0
  9. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops/__init__.py +0 -0
  10. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops/__main__.py +0 -0
  11. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops/functions.py +0 -0
  12. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops/mcp_main.py +0 -0
  13. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops/version_compat.py +0 -0
  14. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops.egg-info/SOURCES.txt +0 -0
  15. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops.egg-info/dependency_links.txt +0 -0
  16. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops.egg-info/entry_points.txt +0 -0
  17. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops.egg-info/requires.txt +0 -0
  18. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/src/mcp_postgresql_ops.egg-info/top_level.txt +0 -0
  19. {mcp_postgresql_ops-3.2.4 → mcp_postgresql_ops-3.2.6}/tests/test_version_compat.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-postgresql-ops
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Add your description here
5
5
  Author-email: JungJungIn <call518@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -932,7 +932,7 @@ cd MCP-PostgreSQL-Ops
932
932
  uv sync
933
933
 
934
934
  # Test with MCP Inspector (loads .env automatically)
935
- ./scripts/run-mcp-inspector-local.sh
935
+ ./run-mcp-inspector-local.sh
936
936
 
937
937
  # Direct execution methods:
938
938
  # 1. Using uv run (recommended for development)
@@ -946,9 +946,46 @@ mcp-postgresql-ops --log-level DEBUG
946
946
 
947
947
  # Test version compatibility (requires different PostgreSQL versions)
948
948
  # Modify POSTGRES_HOST in .env to point to different versions
949
+ ```
950
+
951
+ ### Running Tests
952
+
953
+ Two test suites are available:
954
+
955
+ | Suite | File | Requires Docker |
956
+ |-------|------|----------------|
957
+ | Unit tests (version compatibility logic) | `tests/test_version_compat.py` | No |
958
+ | Integration tests (all tools × PG 12–18) | `tests/test_tools_integration.py` | Yes |
959
+
960
+ #### Option A — Run everything with a single command (recommended)
961
+
962
+ `uv run pytest` automatically starts the Docker test containers (PG 12–18), waits for them to be fully initialized, runs all tests, then tears everything down.
963
+
964
+ ```bash
965
+ # Run all tests (unit + integration) — Docker is managed automatically
966
+ uv run pytest -v
967
+
968
+ # Unit tests only (no Docker needed)
969
+ uv run pytest tests/test_version_compat.py -v
970
+
971
+ # Integration tests only
972
+ uv run pytest tests/test_tools_integration.py -v
973
+ ```
974
+
975
+ #### Option B — Manual control via helper script
976
+
977
+ ```bash
978
+ # Full run: docker up → wait → pytest → docker down
979
+ uv run python scripts/run-tests.py
980
+
981
+ # Pass pytest options directly
982
+ uv run python scripts/run-tests.py -v --tb=short
983
+
984
+ # Keep containers running after tests (for debugging)
985
+ uv run python scripts/run-tests.py --no-cleanup
986
+ ```
949
987
 
950
- # Run tests (if you add any)
951
- uv run pytest
988
+ > **Note**: Docker must be running. The test stack uses ports 5412–5418 (PG 12–18).
952
989
  ```
953
990
 
954
991
  ### Version Compatibility Testing
@@ -1189,7 +1226,7 @@ Add your tool description to `src/mcp_postgresql_ops/prompt_template.md` for bet
1189
1226
 
1190
1227
  ```bash
1191
1228
  # Local testing with MCP Inspector
1192
- ./scripts/run-mcp-inspector-local.sh
1229
+ ./run-mcp-inspector-local.sh
1193
1230
 
1194
1231
  # Or test with Docker stack
1195
1232
  docker-compose up -d
@@ -916,7 +916,7 @@ cd MCP-PostgreSQL-Ops
916
916
  uv sync
917
917
 
918
918
  # Test with MCP Inspector (loads .env automatically)
919
- ./scripts/run-mcp-inspector-local.sh
919
+ ./run-mcp-inspector-local.sh
920
920
 
921
921
  # Direct execution methods:
922
922
  # 1. Using uv run (recommended for development)
@@ -930,9 +930,46 @@ mcp-postgresql-ops --log-level DEBUG
930
930
 
931
931
  # Test version compatibility (requires different PostgreSQL versions)
932
932
  # Modify POSTGRES_HOST in .env to point to different versions
933
+ ```
934
+
935
+ ### Running Tests
936
+
937
+ Two test suites are available:
938
+
939
+ | Suite | File | Requires Docker |
940
+ |-------|------|----------------|
941
+ | Unit tests (version compatibility logic) | `tests/test_version_compat.py` | No |
942
+ | Integration tests (all tools × PG 12–18) | `tests/test_tools_integration.py` | Yes |
943
+
944
+ #### Option A — Run everything with a single command (recommended)
945
+
946
+ `uv run pytest` automatically starts the Docker test containers (PG 12–18), waits for them to be fully initialized, runs all tests, then tears everything down.
947
+
948
+ ```bash
949
+ # Run all tests (unit + integration) — Docker is managed automatically
950
+ uv run pytest -v
951
+
952
+ # Unit tests only (no Docker needed)
953
+ uv run pytest tests/test_version_compat.py -v
954
+
955
+ # Integration tests only
956
+ uv run pytest tests/test_tools_integration.py -v
957
+ ```
958
+
959
+ #### Option B — Manual control via helper script
960
+
961
+ ```bash
962
+ # Full run: docker up → wait → pytest → docker down
963
+ uv run python scripts/run-tests.py
964
+
965
+ # Pass pytest options directly
966
+ uv run python scripts/run-tests.py -v --tb=short
967
+
968
+ # Keep containers running after tests (for debugging)
969
+ uv run python scripts/run-tests.py --no-cleanup
970
+ ```
933
971
 
934
- # Run tests (if you add any)
935
- uv run pytest
972
+ > **Note**: Docker must be running. The test stack uses ports 5412–5418 (PG 12–18).
936
973
  ```
937
974
 
938
975
  ### Version Compatibility Testing
@@ -1173,7 +1210,7 @@ Add your tool description to `src/mcp_postgresql_ops/prompt_template.md` for bet
1173
1210
 
1174
1211
  ```bash
1175
1212
  # Local testing with MCP Inspector
1176
- ./scripts/run-mcp-inspector-local.sh
1213
+ ./run-mcp-inspector-local.sh
1177
1214
 
1178
1215
  # Or test with Docker stack
1179
1216
  docker-compose up -d
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-postgresql-ops"
3
- version = "3.2.4"
3
+ version = "3.2.6"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-postgresql-ops
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Add your description here
5
5
  Author-email: JungJungIn <call518@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -932,7 +932,7 @@ cd MCP-PostgreSQL-Ops
932
932
  uv sync
933
933
 
934
934
  # Test with MCP Inspector (loads .env automatically)
935
- ./scripts/run-mcp-inspector-local.sh
935
+ ./run-mcp-inspector-local.sh
936
936
 
937
937
  # Direct execution methods:
938
938
  # 1. Using uv run (recommended for development)
@@ -946,9 +946,46 @@ mcp-postgresql-ops --log-level DEBUG
946
946
 
947
947
  # Test version compatibility (requires different PostgreSQL versions)
948
948
  # Modify POSTGRES_HOST in .env to point to different versions
949
+ ```
950
+
951
+ ### Running Tests
952
+
953
+ Two test suites are available:
954
+
955
+ | Suite | File | Requires Docker |
956
+ |-------|------|----------------|
957
+ | Unit tests (version compatibility logic) | `tests/test_version_compat.py` | No |
958
+ | Integration tests (all tools × PG 12–18) | `tests/test_tools_integration.py` | Yes |
959
+
960
+ #### Option A — Run everything with a single command (recommended)
961
+
962
+ `uv run pytest` automatically starts the Docker test containers (PG 12–18), waits for them to be fully initialized, runs all tests, then tears everything down.
963
+
964
+ ```bash
965
+ # Run all tests (unit + integration) — Docker is managed automatically
966
+ uv run pytest -v
967
+
968
+ # Unit tests only (no Docker needed)
969
+ uv run pytest tests/test_version_compat.py -v
970
+
971
+ # Integration tests only
972
+ uv run pytest tests/test_tools_integration.py -v
973
+ ```
974
+
975
+ #### Option B — Manual control via helper script
976
+
977
+ ```bash
978
+ # Full run: docker up → wait → pytest → docker down
979
+ uv run python scripts/run-tests.py
980
+
981
+ # Pass pytest options directly
982
+ uv run python scripts/run-tests.py -v --tb=short
983
+
984
+ # Keep containers running after tests (for debugging)
985
+ uv run python scripts/run-tests.py --no-cleanup
986
+ ```
949
987
 
950
- # Run tests (if you add any)
951
- uv run pytest
988
+ > **Note**: Docker must be running. The test stack uses ports 5412–5418 (PG 12–18).
952
989
  ```
953
990
 
954
991
  ### Version Compatibility Testing
@@ -1189,7 +1226,7 @@ Add your tool description to `src/mcp_postgresql_ops/prompt_template.md` for bet
1189
1226
 
1190
1227
  ```bash
1191
1228
  # Local testing with MCP Inspector
1192
- ./scripts/run-mcp-inspector-local.sh
1229
+ ./run-mcp-inspector-local.sh
1193
1230
 
1194
1231
  # Or test with Docker stack
1195
1232
  docker-compose up -d
@@ -4,46 +4,52 @@ Requires Docker Compose test stack running (tests/docker/docker-compose.test.yml
4
4
  """
5
5
  import pytest
6
6
 
7
- # Import all tool functions directly
8
- from mcp_postgresql_ops.mcp_main import (
9
- get_lock_monitoring,
10
- get_wal_status,
11
- get_replication_status,
12
- get_server_info,
13
- get_current_database_info,
14
- get_database_list,
15
- get_table_list,
16
- get_user_list,
17
- get_table_schema_info,
18
- get_database_schema_info,
19
- get_table_relationships,
20
- get_active_connections,
21
- get_pg_stat_statements_top_queries,
22
- get_pg_stat_monitor_recent_queries,
23
- get_database_size_info,
24
- get_table_size_info,
25
- get_postgresql_config,
26
- get_index_usage_stats,
27
- get_vacuum_analyze_stats,
28
- get_table_bloat_analysis,
29
- get_database_bloat_overview,
30
- get_autovacuum_status,
31
- get_autovacuum_activity,
32
- get_running_vacuum_operations,
33
- get_vacuum_effectiveness_analysis,
34
- get_database_stats,
35
- get_bgwriter_stats,
36
- get_io_stats,
37
- get_table_io_stats,
38
- get_index_io_stats,
39
- get_all_tables_stats,
40
- get_user_functions_stats,
41
- get_database_conflicts_stats,
42
- get_wait_events,
43
- get_wal_summarizer_status,
44
- get_async_io_status,
45
- get_per_backend_io_stats,
46
- )
7
+ import mcp_postgresql_ops.mcp_main as _mcp_main
8
+
9
+
10
+ def _fn(name: str):
11
+ """Extract the raw callable from a FunctionTool (fastmcp >= 2.14) or return as-is."""
12
+ tool = getattr(_mcp_main, name)
13
+ return getattr(tool, "fn", tool)
14
+
15
+
16
+ get_lock_monitoring = _fn("get_lock_monitoring")
17
+ get_wal_status = _fn("get_wal_status")
18
+ get_replication_status = _fn("get_replication_status")
19
+ get_server_info = _fn("get_server_info")
20
+ get_current_database_info = _fn("get_current_database_info")
21
+ get_database_list = _fn("get_database_list")
22
+ get_table_list = _fn("get_table_list")
23
+ get_user_list = _fn("get_user_list")
24
+ get_table_schema_info = _fn("get_table_schema_info")
25
+ get_database_schema_info = _fn("get_database_schema_info")
26
+ get_table_relationships = _fn("get_table_relationships")
27
+ get_active_connections = _fn("get_active_connections")
28
+ get_pg_stat_statements_top_queries = _fn("get_pg_stat_statements_top_queries")
29
+ get_pg_stat_monitor_recent_queries = _fn("get_pg_stat_monitor_recent_queries")
30
+ get_database_size_info = _fn("get_database_size_info")
31
+ get_table_size_info = _fn("get_table_size_info")
32
+ get_postgresql_config = _fn("get_postgresql_config")
33
+ get_index_usage_stats = _fn("get_index_usage_stats")
34
+ get_vacuum_analyze_stats = _fn("get_vacuum_analyze_stats")
35
+ get_table_bloat_analysis = _fn("get_table_bloat_analysis")
36
+ get_database_bloat_overview = _fn("get_database_bloat_overview")
37
+ get_autovacuum_status = _fn("get_autovacuum_status")
38
+ get_autovacuum_activity = _fn("get_autovacuum_activity")
39
+ get_running_vacuum_operations = _fn("get_running_vacuum_operations")
40
+ get_vacuum_effectiveness_analysis = _fn("get_vacuum_effectiveness_analysis")
41
+ get_database_stats = _fn("get_database_stats")
42
+ get_bgwriter_stats = _fn("get_bgwriter_stats")
43
+ get_io_stats = _fn("get_io_stats")
44
+ get_table_io_stats = _fn("get_table_io_stats")
45
+ get_index_io_stats = _fn("get_index_io_stats")
46
+ get_all_tables_stats = _fn("get_all_tables_stats")
47
+ get_user_functions_stats = _fn("get_user_functions_stats")
48
+ get_database_conflicts_stats = _fn("get_database_conflicts_stats")
49
+ get_wait_events = _fn("get_wait_events")
50
+ get_wal_summarizer_status = _fn("get_wal_summarizer_status")
51
+ get_async_io_status = _fn("get_async_io_status")
52
+ get_per_backend_io_stats = _fn("get_per_backend_io_stats")
47
53
 
48
54
 
49
55
  pytestmark = pytest.mark.asyncio