mcp-postgresql-ops 3.4.0__tar.gz → 3.4.1__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 (76) hide show
  1. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/workflows/pypi-publish.yml +33 -8
  2. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/workflows/test.yml +1 -1
  3. {mcp_postgresql_ops-3.4.0/src/mcp_postgresql_ops.egg-info → mcp_postgresql_ops-3.4.1}/PKG-INFO +18 -4
  4. mcp_postgresql_ops-3.4.0/PKG-INFO → mcp_postgresql_ops-3.4.1/README.md +17 -21
  5. mcp_postgresql_ops-3.4.1/scripts/check_release.py +72 -0
  6. mcp_postgresql_ops-3.4.1/scripts/publish_release.py +141 -0
  7. mcp_postgresql_ops-3.4.0/README.md → mcp_postgresql_ops-3.4.1/src/mcp_postgresql_ops.egg-info/PKG-INFO +35 -3
  8. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/SOURCES.txt +3 -0
  9. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/scm_file_list.json +3 -0
  10. mcp_postgresql_ops-3.4.1/src/mcp_postgresql_ops.egg-info/scm_version.json +8 -0
  11. mcp_postgresql_ops-3.4.1/tests/test_release.py +86 -0
  12. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/uv.lock +3 -3
  13. mcp_postgresql_ops-3.4.0/src/mcp_postgresql_ops.egg-info/scm_version.json +0 -8
  14. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.env.example +0 -0
  15. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/CONTRIBUTING.md +0 -0
  16. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/FUNDING.yml +0 -0
  17. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  18. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  19. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/ISSUE_TEMPLATE/documentation.md +0 -0
  20. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  21. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/ISSUE_TEMPLATE/question.md +0 -0
  22. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/copilot-instructions.md +0 -0
  23. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/dependabot.yml +0 -0
  24. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.github/pull_request_template.md +0 -0
  25. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.gitignore +0 -0
  26. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.gitleaks.toml +0 -0
  27. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.pre-commit-config.yaml +0 -0
  28. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/.python-version +0 -0
  29. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/Dockerfile.MCP-Server +0 -0
  30. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/Dockerfile.MCPO-Proxy +0 -0
  31. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/LICENSE +0 -0
  32. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/MANIFEST.in +0 -0
  33. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/SECURITY.md +0 -0
  34. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/_config.yml +0 -0
  35. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/_includes/head-custom-google-analytics.html +0 -0
  36. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/build-mcp-server-docker-image.sh +0 -0
  37. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/build-mcpo-server-docker-image.sh +0 -0
  38. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/docker-compose.custom-db.yml +0 -0
  39. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/docker-compose.yml +0 -0
  40. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/MCP-Workflow-of-Quickstart-Tutorial.png +0 -0
  41. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-000.png +0 -0
  42. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-001.png +0 -0
  43. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-002.png +0 -0
  44. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-004.png +0 -0
  45. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-005.png +0 -0
  46. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-claude-desktop-airflow-connections-html.png +0 -0
  47. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-claude-desktop-mermaid-diagram.png +0 -0
  48. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-claude-desktop-question-001.png +0 -0
  49. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/img/screenshot-swagger-api.png +0 -0
  50. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/mcp-config.json.http +0 -0
  51. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/mcp-config.json.stdio +0 -0
  52. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/pyproject.toml +0 -0
  53. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/run-mcp-inspector-local.sh +0 -0
  54. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/run-mcp-inspector-pypi.sh +0 -0
  55. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/scripts/create-test-data.sh +0 -0
  56. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/scripts/create-test-data.sql +0 -0
  57. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/scripts/enable-pgsql-extensions.sh +0 -0
  58. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/scripts/mcp-server-docker-cmd.sh +0 -0
  59. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/setup.cfg +0 -0
  60. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/__init__.py +0 -0
  61. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/__main__.py +0 -0
  62. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/functions.py +0 -0
  63. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/mcp_main.py +0 -0
  64. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/prompt_template.md +0 -0
  65. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops/version_compat.py +0 -0
  66. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/dependency_links.txt +0 -0
  67. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/entry_points.txt +0 -0
  68. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/requires.txt +0 -0
  69. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/src/mcp_postgresql_ops.egg-info/top_level.txt +0 -0
  70. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/__init__.py +0 -0
  71. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/conftest.py +0 -0
  72. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/docker/docker-compose.test.yml +0 -0
  73. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/docker/init-test-db.sql +0 -0
  74. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/test_tool_schema_null_defaults.py +0 -0
  75. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/test_tools_integration.py +0 -0
  76. {mcp_postgresql_ops-3.4.0 → mcp_postgresql_ops-3.4.1}/tests/test_version_compat.py +0 -0
@@ -1,7 +1,4 @@
1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
-
4
- name: Publish to PyPI on tag
1
+ name: Publish Packages and GitHub Release on Tag
5
2
 
6
3
  on:
7
4
  push:
@@ -9,7 +6,6 @@ on:
9
6
 
10
7
  permissions:
11
8
  contents: read
12
- id-token: write
13
9
 
14
10
  jobs:
15
11
  build:
@@ -26,10 +22,15 @@ jobs:
26
22
  run: pip install --upgrade build
27
23
  - name: Build distributions
28
24
  run: python -m build
25
+ - name: Verify tag and distribution versions
26
+ env:
27
+ RELEASE_TAG: ${{ github.ref_name }}
28
+ run: python -m scripts.check_release "$RELEASE_TAG" dist
29
29
  - uses: actions/upload-artifact@v7
30
30
  with:
31
31
  name: dist
32
32
  path: dist/
33
+ if-no-files-found: error
33
34
 
34
35
  publish-to-testpypi:
35
36
  name: Publish to TestPyPI
@@ -55,8 +56,7 @@ jobs:
55
56
  name: Publish to PyPI
56
57
  if: startsWith(github.ref, 'refs/tags/')
57
58
  runs-on: ubuntu-latest
58
- needs: build
59
- #needs: publish-to-testpypi
59
+ needs: publish-to-testpypi
60
60
  permissions:
61
61
  id-token: write
62
62
  environment:
@@ -70,4 +70,29 @@ jobs:
70
70
  - name: Publish to PyPI
71
71
  uses: pypa/gh-action-pypi-publish@release/v1
72
72
  with:
73
- repository-url: https://upload.pypi.org/legacy/
73
+ repository-url: https://upload.pypi.org/legacy/
74
+
75
+ release:
76
+ name: Publish GitHub Release
77
+ needs: publish-to-pypi
78
+ runs-on: ubuntu-latest
79
+ timeout-minutes: 5
80
+ permissions:
81
+ contents: write
82
+ concurrency:
83
+ group: github-release-${{ github.repository }}
84
+ cancel-in-progress: false
85
+ queue: max
86
+ env:
87
+ GH_TOKEN: ${{ github.token }}
88
+ RELEASE_TAG: ${{ github.ref_name }}
89
+ steps:
90
+ - uses: actions/checkout@v7
91
+ with:
92
+ persist-credentials: false
93
+ fetch-depth: 0
94
+ - uses: actions/setup-python@v7
95
+ with:
96
+ python-version: "3.12.x"
97
+ - name: Publish release with commit messages
98
+ run: python -m scripts.publish_release "$RELEASE_TAG"
@@ -32,7 +32,7 @@ jobs:
32
32
  run: uv sync --extra dev
33
33
 
34
34
  - name: Run unit tests
35
- run: uv run pytest tests/test_version_compat.py tests/test_tool_schema_null_defaults.py -v --tb=short
35
+ run: uv run pytest tests/test_version_compat.py tests/test_tool_schema_null_defaults.py tests/test_release.py -v --tb=short
36
36
  integration-tests:
37
37
  name: Integration Tests (PG 12-18)
38
38
  runs-on: ubuntu-latest
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-postgresql-ops
3
- Version: 3.4.0
3
+ Version: 3.4.1
4
4
  Summary: Add your description here
5
5
  Author-email: JungJungIn <call518@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -34,7 +34,7 @@ Dynamic: license-file
34
34
 
35
35
  ## Architecture & Internal (DeepWiki)
36
36
 
37
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
37
+ [![Ask DeepWiki](https://img.shields.io/badge/Ask-DeepWiki-blue)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
38
38
 
39
39
  ---
40
40
 
@@ -71,7 +71,7 @@ Dynamic: license-file
71
71
 
72
72
  ## Tool Usage Examples
73
73
 
74
- ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)**
74
+ ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)**
75
75
 
76
76
  ---
77
77
 
@@ -181,7 +181,7 @@ http://localhost:3003/
181
181
 
182
182
  #### 📖 **Next Steps:**
183
183
  - Browse the **[Example Queries section](#usage-examples)** below for more query examples
184
- - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)** for visual guides
184
+ - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)** for visual guides
185
185
  - Explore the **[Tool Compatibility Matrix](#tool-compatibility-matrix)** to understand available features
186
186
 
187
187
  ---
@@ -309,6 +309,20 @@ The `create-test-data.sql` script is executed by the `postgres-init-extensions`
309
309
 
310
310
  ---
311
311
 
312
+ ## Tagged Releases
313
+
314
+ The GitHub Actions workflow publishes a pushed version tag (for example,
315
+ `v1.2.3`, `1.2.3`, or `1.2.3rc1`) to TestPyPI, then PyPI, and finally creates
316
+ a GitHub Release with the tag as its title. Both distribution versions must match
317
+ the tag. The existing `testpypi` and `pypi` GitHub environments must have Trusted
318
+ Publishing configured on their respective package indexes.
319
+
320
+ Release notes include full commit messages since the most recently published
321
+ GitHub Release, or all commits for the first release. The previous release tag
322
+ must be an ancestor of the new tag. Alpha, beta, and release candidate tags create
323
+ prereleases. Existing published releases are preserved; an existing draft requires
324
+ manual review. A failed publication prevents subsequent publication jobs.
325
+
312
326
  ## Installation
313
327
 
314
328
  ### From PyPI (Recommended)
@@ -1,21 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: mcp-postgresql-ops
3
- Version: 3.4.0
4
- Summary: Add your description here
5
- Author-email: JungJungIn <call518@gmail.com>
6
- Requires-Python: >=3.12
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: fastmcp>=2.12.3
10
- Requires-Dist: asyncpg>=0.29.0
11
- Requires-Dist: psycopg2-binary>=2.9.7
12
- Requires-Dist: setuptools-scm>=10.0.5
13
- Requires-Dist: pre-commit>=4.6.0
14
- Provides-Extra: dev
15
- Requires-Dist: pytest>=7.0.0; extra == "dev"
16
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
17
- Dynamic: license-file
18
-
19
1
  # MCP Server for PostgreSQL Operations and Monitoring
20
2
 
21
3
  [![MCP Toplist](https://mcptoplist.com/badge/smithery%2Fcall518%2Fmcp-postgresql-ops.svg)](https://mcptoplist.com/server/smithery%2Fcall518%2Fmcp-postgresql-ops)
@@ -34,7 +16,7 @@ Dynamic: license-file
34
16
 
35
17
  ## Architecture & Internal (DeepWiki)
36
18
 
37
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
19
+ [![Ask DeepWiki](https://img.shields.io/badge/Ask-DeepWiki-blue)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
38
20
 
39
21
  ---
40
22
 
@@ -71,7 +53,7 @@ Dynamic: license-file
71
53
 
72
54
  ## Tool Usage Examples
73
55
 
74
- ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)**
56
+ ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)**
75
57
 
76
58
  ---
77
59
 
@@ -181,7 +163,7 @@ http://localhost:3003/
181
163
 
182
164
  #### 📖 **Next Steps:**
183
165
  - Browse the **[Example Queries section](#usage-examples)** below for more query examples
184
- - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)** for visual guides
166
+ - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)** for visual guides
185
167
  - Explore the **[Tool Compatibility Matrix](#tool-compatibility-matrix)** to understand available features
186
168
 
187
169
  ---
@@ -309,6 +291,20 @@ The `create-test-data.sql` script is executed by the `postgres-init-extensions`
309
291
 
310
292
  ---
311
293
 
294
+ ## Tagged Releases
295
+
296
+ The GitHub Actions workflow publishes a pushed version tag (for example,
297
+ `v1.2.3`, `1.2.3`, or `1.2.3rc1`) to TestPyPI, then PyPI, and finally creates
298
+ a GitHub Release with the tag as its title. Both distribution versions must match
299
+ the tag. The existing `testpypi` and `pypi` GitHub environments must have Trusted
300
+ Publishing configured on their respective package indexes.
301
+
302
+ Release notes include full commit messages since the most recently published
303
+ GitHub Release, or all commits for the first release. The previous release tag
304
+ must be an ancestor of the new tag. Alpha, beta, and release candidate tags create
305
+ prereleases. Existing published releases are preserved; an existing draft requires
306
+ manual review. A failed publication prevents subsequent publication jobs.
307
+
312
308
  ## Installation
313
309
 
314
310
  ### From PyPI (Recommended)
@@ -0,0 +1,72 @@
1
+ """Require both distribution metadata versions to match the release tag."""
2
+
3
+ import argparse
4
+ import re
5
+ import tarfile
6
+ import zipfile
7
+ from email.parser import BytesParser
8
+ from pathlib import Path
9
+
10
+
11
+ def release_version(tag: str) -> str:
12
+ """Validate a canonical release tag and return its package version."""
13
+ version = tag.removeprefix("v")
14
+ number = r"(?:0|[1-9][0-9]*)"
15
+ if not re.fullmatch(
16
+ rf"{number}\.{number}\.{number}(?:(?:a|b|rc){number})?", version
17
+ ):
18
+ raise ValueError("Use a tag such as 0.5.7, v0.5.7, or 0.5.7rc1")
19
+ return version
20
+
21
+
22
+ def check_release(tag: str, directory: Path) -> None:
23
+ """Validate a canonical release tag and the wheel/sdist prepared for upload."""
24
+ version = release_version(tag)
25
+ wheels = list(directory.glob("*.whl"))
26
+ sdists = list(directory.glob("*.tar.gz"))
27
+ if len(wheels) != 1 or len(sdists) != 1:
28
+ raise ValueError("Expected exactly one wheel and one source distribution")
29
+
30
+ with zipfile.ZipFile(wheels[0]) as archive:
31
+ metadata_files = [
32
+ name for name in archive.namelist() if name.endswith(".dist-info/METADATA")
33
+ ]
34
+ if len(metadata_files) != 1:
35
+ raise ValueError("Expected one wheel metadata file")
36
+ wheel_metadata = archive.read(metadata_files[0])
37
+ with tarfile.open(sdists[0], "r:gz") as archive:
38
+ metadata_files = [
39
+ item
40
+ for item in archive.getmembers()
41
+ if len(Path(item.name).parts) == 2 and item.name.endswith("/PKG-INFO")
42
+ ]
43
+ if len(metadata_files) != 1:
44
+ raise ValueError("Expected one source distribution metadata file")
45
+ stream = archive.extractfile(metadata_files[0])
46
+ if stream is None:
47
+ raise ValueError("Source distribution metadata is not a file")
48
+ with stream:
49
+ sdist_metadata = stream.read()
50
+
51
+ for path, raw in zip((wheels[0], sdists[0]), (wheel_metadata, sdist_metadata)):
52
+ metadata = BytesParser().parsebytes(raw)
53
+ if metadata.get("Name") != "mcp-postgresql-ops" or metadata.get("Version") != version:
54
+ raise ValueError(f"{path.name}: expected mcp-postgresql-ops {version}")
55
+ print(f"Verified {path.name}: mcp-postgresql-ops {version}")
56
+
57
+
58
+ def main() -> None:
59
+ """Check release artifacts without uploading or modifying them."""
60
+ parser = argparse.ArgumentParser(description=__doc__)
61
+ parser.add_argument("tag")
62
+ parser.add_argument("directory", type=Path)
63
+ args = parser.parse_args()
64
+ try:
65
+ check_release(args.tag, args.directory)
66
+ except ValueError as exc:
67
+ parser.exit(1, f"Release validation failed: {exc}\n")
68
+
69
+
70
+ if __name__ == "__main__":
71
+ main()
72
+
@@ -0,0 +1,141 @@
1
+ """Publish a tag's GitHub Release after package publication has succeeded."""
2
+
3
+ import argparse
4
+ import json
5
+ import os
6
+ import re
7
+ import subprocess
8
+ import tempfile
9
+ from pathlib import Path
10
+ from typing import Any
11
+ from urllib.parse import quote
12
+
13
+ from scripts.check_release import release_version
14
+
15
+
16
+ def command(*args: str) -> str:
17
+ """Run an argument list without interpreting commit messages as shell code."""
18
+ return subprocess.run(
19
+ args, check=True, capture_output=True, text=True
20
+ ).stdout.strip()
21
+
22
+
23
+ def release_notes(repository: str, tag: str, previous: str | None) -> str:
24
+ """Collect full commit messages in oldest-first topological order."""
25
+ current = command("git", "rev-parse", "--verify", f"refs/tags/{tag}^{{commit}}")
26
+ revision = current
27
+ if previous:
28
+ base = command(
29
+ "git", "rev-parse", "--verify", f"refs/tags/{previous}^{{commit}}"
30
+ )
31
+ command("git", "merge-base", "--is-ancestor", base, current)
32
+ revision = f"{base}..{current}"
33
+ raw = command(
34
+ "git",
35
+ "log",
36
+ "--reverse",
37
+ "--topo-order",
38
+ "--format=%H%x00%B%x00",
39
+ revision,
40
+ "--",
41
+ )
42
+ parts = raw.split("\0")
43
+ notes = [
44
+ f"## {tag}",
45
+ f"Changes since {previous}." if previous else "Initial release.",
46
+ "",
47
+ ]
48
+ for index in range(0, len(parts) - 1, 2):
49
+ sha, message = parts[index].strip(), parts[index + 1].strip()
50
+ # A longer fence preserves messages containing Markdown code fences.
51
+ fence = "`" * max(
52
+ 3, max((len(m) + 1 for m in re.findall(r"`+", message)), default=3)
53
+ )
54
+ notes.extend(
55
+ [
56
+ f"### [{sha[:7]}](https://github.com/{repository}/commit/{sha})",
57
+ f"{fence}text",
58
+ message,
59
+ fence,
60
+ "",
61
+ ]
62
+ )
63
+ if previous:
64
+ notes.append(
65
+ f"[Full Changelog](https://github.com/{repository}/compare/{quote(previous, safe='')}...{quote(tag, safe='')})"
66
+ )
67
+ return "\n".join(notes) + "\n"
68
+
69
+
70
+ def publish_release(repository: str, tag: str) -> None:
71
+ """Create a release once, using the last published release as the baseline."""
72
+ version = release_version(tag)
73
+ current = command("git", "rev-parse", "--verify", f"refs/tags/{tag}^{{commit}}")
74
+ remote = command("gh", "api", f"repos/{repository}/commits/{tag}", "--jq", ".sha")
75
+ if current != remote or current != command("git", "rev-parse", "HEAD"):
76
+ raise ValueError(
77
+ "The remote tag, local tag, and checked-out commit must match."
78
+ )
79
+ pages = json.loads(
80
+ command(
81
+ "gh",
82
+ "api",
83
+ "--paginate",
84
+ "--slurp",
85
+ f"repos/{repository}/releases?per_page=100",
86
+ )
87
+ )
88
+ releases: list[dict[str, Any]] = [release for page in pages for release in page]
89
+ existing = next(
90
+ (release for release in releases if release["tag_name"] == tag), None
91
+ )
92
+ if existing:
93
+ if existing["draft"]:
94
+ raise ValueError("A draft already exists for this tag; review it manually.")
95
+ print(f"Release {tag} already exists; leaving its content unchanged.")
96
+ return
97
+ published = [release for release in releases if not release["draft"]]
98
+ previous = (
99
+ max(published, key=lambda release: release["published_at"])["tag_name"]
100
+ if published
101
+ else None
102
+ )
103
+ notes = release_notes(repository, tag, previous)
104
+ with tempfile.TemporaryDirectory(prefix="mcp-postgresql-ops-release-") as temporary:
105
+ path = Path(temporary) / "release-notes.md"
106
+ path.write_text(notes, encoding="utf-8")
107
+ args = [
108
+ "gh",
109
+ "release",
110
+ "create",
111
+ tag,
112
+ "--repo",
113
+ repository,
114
+ "--verify-tag",
115
+ "--title",
116
+ tag,
117
+ "--notes-file",
118
+ str(path),
119
+ ]
120
+ if re.search(r"(?:a|b|rc)\d+$", version):
121
+ args.extend(["--prerelease", "--latest=false"])
122
+ command(*args)
123
+ print(f"Published GitHub Release {tag} (previous release: {previous or 'none'}).")
124
+
125
+
126
+ def main() -> None:
127
+ """Publish only when explicitly called by the final release job."""
128
+ parser = argparse.ArgumentParser(description=__doc__)
129
+ parser.add_argument("tag")
130
+ args = parser.parse_args()
131
+ try:
132
+ publish_release(os.environ["GITHUB_REPOSITORY"], args.tag)
133
+ except subprocess.CalledProcessError as error:
134
+ parser.exit(1, f"Release command failed: {error.stderr or error}\n")
135
+ except (ValueError, KeyError, OSError) as error:
136
+ parser.exit(1, f"GitHub Release failed: {error}\n")
137
+
138
+
139
+ if __name__ == "__main__":
140
+ main()
141
+
@@ -1,3 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-postgresql-ops
3
+ Version: 3.4.1
4
+ Summary: Add your description here
5
+ Author-email: JungJungIn <call518@gmail.com>
6
+ Requires-Python: >=3.12
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: fastmcp>=2.12.3
10
+ Requires-Dist: asyncpg>=0.29.0
11
+ Requires-Dist: psycopg2-binary>=2.9.7
12
+ Requires-Dist: setuptools-scm>=10.0.5
13
+ Requires-Dist: pre-commit>=4.6.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
16
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
17
+ Dynamic: license-file
18
+
1
19
  # MCP Server for PostgreSQL Operations and Monitoring
2
20
 
3
21
  [![MCP Toplist](https://mcptoplist.com/badge/smithery%2Fcall518%2Fmcp-postgresql-ops.svg)](https://mcptoplist.com/server/smithery%2Fcall518%2Fmcp-postgresql-ops)
@@ -16,7 +34,7 @@
16
34
 
17
35
  ## Architecture & Internal (DeepWiki)
18
36
 
19
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
37
+ [![Ask DeepWiki](https://img.shields.io/badge/Ask-DeepWiki-blue)](https://deepwiki.com/call518/MCP-PostgreSQL-Ops)
20
38
 
21
39
  ---
22
40
 
@@ -53,7 +71,7 @@
53
71
 
54
72
  ## Tool Usage Examples
55
73
 
56
- ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)**
74
+ ### 📸 **[More Examples with Screenshots →](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)**
57
75
 
58
76
  ---
59
77
 
@@ -163,7 +181,7 @@ http://localhost:3003/
163
181
 
164
182
  #### 📖 **Next Steps:**
165
183
  - Browse the **[Example Queries section](#usage-examples)** below for more query examples
166
- - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki/Tool-Usage-Example)** for visual guides
184
+ - Check out **[Tool Usage Examples with Screenshots](https://github.com/call518/MCP-PostgreSQL-Ops/wiki)** for visual guides
167
185
  - Explore the **[Tool Compatibility Matrix](#tool-compatibility-matrix)** to understand available features
168
186
 
169
187
  ---
@@ -291,6 +309,20 @@ The `create-test-data.sql` script is executed by the `postgres-init-extensions`
291
309
 
292
310
  ---
293
311
 
312
+ ## Tagged Releases
313
+
314
+ The GitHub Actions workflow publishes a pushed version tag (for example,
315
+ `v1.2.3`, `1.2.3`, or `1.2.3rc1`) to TestPyPI, then PyPI, and finally creates
316
+ a GitHub Release with the tag as its title. Both distribution versions must match
317
+ the tag. The existing `testpypi` and `pypi` GitHub environments must have Trusted
318
+ Publishing configured on their respective package indexes.
319
+
320
+ Release notes include full commit messages since the most recently published
321
+ GitHub Release, or all commits for the first release. The previous release tag
322
+ must be an ancestor of the new tag. Alpha, beta, and release candidate tags create
323
+ prereleases. Existing published releases are preserved; an existing draft requires
324
+ manual review. A failed publication prevents subsequent publication jobs.
325
+
294
326
  ## Installation
295
327
 
296
328
  ### From PyPI (Recommended)
@@ -43,10 +43,12 @@ img/screenshot-claude-desktop-airflow-connections-html.png
43
43
  img/screenshot-claude-desktop-mermaid-diagram.png
44
44
  img/screenshot-claude-desktop-question-001.png
45
45
  img/screenshot-swagger-api.png
46
+ scripts/check_release.py
46
47
  scripts/create-test-data.sh
47
48
  scripts/create-test-data.sql
48
49
  scripts/enable-pgsql-extensions.sh
49
50
  scripts/mcp-server-docker-cmd.sh
51
+ scripts/publish_release.py
50
52
  src/mcp_postgresql_ops/__init__.py
51
53
  src/mcp_postgresql_ops/__main__.py
52
54
  src/mcp_postgresql_ops/functions.py
@@ -63,6 +65,7 @@ src/mcp_postgresql_ops.egg-info/scm_version.json
63
65
  src/mcp_postgresql_ops.egg-info/top_level.txt
64
66
  tests/__init__.py
65
67
  tests/conftest.py
68
+ tests/test_release.py
66
69
  tests/test_tool_schema_null_defaults.py
67
70
  tests/test_tools_integration.py
68
71
  tests/test_version_compat.py
@@ -44,10 +44,12 @@
44
44
  "pyproject.toml",
45
45
  "run-mcp-inspector-local.sh",
46
46
  "run-mcp-inspector-pypi.sh",
47
+ "scripts/check_release.py",
47
48
  "scripts/create-test-data.sh",
48
49
  "scripts/create-test-data.sql",
49
50
  "scripts/enable-pgsql-extensions.sh",
50
51
  "scripts/mcp-server-docker-cmd.sh",
52
+ "scripts/publish_release.py",
51
53
  "src/mcp_postgresql_ops/__init__.py",
52
54
  "src/mcp_postgresql_ops/__main__.py",
53
55
  "src/mcp_postgresql_ops/functions.py",
@@ -58,6 +60,7 @@
58
60
  "tests/conftest.py",
59
61
  "tests/docker/docker-compose.test.yml",
60
62
  "tests/docker/init-test-db.sql",
63
+ "tests/test_release.py",
61
64
  "tests/test_tool_schema_null_defaults.py",
62
65
  "tests/test_tools_integration.py",
63
66
  "tests/test_version_compat.py",
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "3.4.1",
3
+ "distance": 0,
4
+ "node": "g040ffedb6a319f1cd3ceec18f5ec489bac8a41e1",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-24"
8
+ }
@@ -0,0 +1,86 @@
1
+ """Release validation and publication checks without GitHub writes."""
2
+
3
+ import io
4
+ import json
5
+ import sys
6
+ import tarfile
7
+ import zipfile
8
+ from pathlib import Path
9
+ from unittest.mock import patch
10
+
11
+ import pytest
12
+
13
+ sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
14
+
15
+ from scripts.check_release import check_release, release_version
16
+ from scripts.publish_release import publish_release, release_notes
17
+
18
+
19
+ @pytest.mark.parametrize("tag", ["1.2.3", "v1.2.3", "1.2.3rc1"])
20
+ def test_release_version(tag):
21
+ assert release_version(tag) == tag.removeprefix("v")
22
+
23
+
24
+ @pytest.mark.parametrize("tag", ["latest", "1.2", "v01.2.3", "1.2.3+local"])
25
+ def test_invalid_release_version(tag):
26
+ with pytest.raises(ValueError):
27
+ release_version(tag)
28
+
29
+
30
+ @pytest.mark.parametrize("version", ["1.2.3", "1.2.4"])
31
+ def test_distribution_versions(tmp_path, version):
32
+ metadata = f"Name: mcp-postgresql-ops\nVersion: {version}\n".encode()
33
+ with zipfile.ZipFile(tmp_path / "package.whl", "w") as archive:
34
+ archive.writestr("package.dist-info/METADATA", metadata)
35
+ with tarfile.open(tmp_path / "package.tar.gz", "w:gz") as archive:
36
+ info = tarfile.TarInfo("package/PKG-INFO")
37
+ info.size = len(metadata)
38
+ archive.addfile(info, io.BytesIO(metadata))
39
+ if version == "1.2.3":
40
+ check_release("v1.2.3", tmp_path)
41
+ else:
42
+ with pytest.raises(ValueError, match="expected"):
43
+ check_release("v1.2.3", tmp_path)
44
+
45
+
46
+ def test_notes_use_previous_release_and_preserve_messages():
47
+ message = "Fix issue\n\n```\n$(touch unwanted)\n```"
48
+ with patch("scripts.publish_release.command") as command:
49
+ command.side_effect = ["new", "old", "", f"abcdef123\0{message}\0"]
50
+ notes = release_notes("owner/repo", "v1.2.3", "v1.2.2")
51
+ assert message in notes
52
+ assert "````text" in notes
53
+ assert "compare/v1.2.2...v1.2.3" in notes
54
+ assert command.call_args.args[-2:] == ("old..new", "--")
55
+
56
+
57
+ @pytest.mark.parametrize("draft", [False, True])
58
+ def test_existing_release_is_not_overwritten(draft):
59
+ with patch("scripts.publish_release.command") as command:
60
+ command.side_effect = [
61
+ "sha", "sha", "sha",
62
+ json.dumps([[{"tag_name": "v1.2.3", "draft": draft}]]),
63
+ ]
64
+ if draft:
65
+ with pytest.raises(ValueError, match="draft"):
66
+ publish_release("owner/repo", "v1.2.3")
67
+ else:
68
+ publish_release("owner/repo", "v1.2.3")
69
+ assert command.call_count == 4
70
+
71
+
72
+ def test_first_prerelease_creation():
73
+ with patch("scripts.publish_release.command") as command:
74
+ command.side_effect = ["sha", "sha", "sha", "[[]]", "sha", "", ""]
75
+ publish_release("owner/repo", "v1.2.3rc1")
76
+ args = command.call_args.args
77
+ assert args[:3] == ("gh", "release", "create")
78
+ assert args[-2:] == ("--prerelease", "--latest=false")
79
+
80
+
81
+ def test_remote_tag_mismatch_stops_publication():
82
+ with patch("scripts.publish_release.command") as command:
83
+ command.side_effect = ["local", "remote"]
84
+ with pytest.raises(ValueError, match="must match"):
85
+ publish_release("owner/repo", "v1.2.3")
86
+ assert command.call_count == 2
@@ -641,7 +641,7 @@ wheels = [
641
641
 
642
642
  [[package]]
643
643
  name = "mcp"
644
- version = "1.28.1"
644
+ version = "1.30.0"
645
645
  source = { registry = "https://pypi.org/simple" }
646
646
  dependencies = [
647
647
  { name = "anyio" },
@@ -661,9 +661,9 @@ dependencies = [
661
661
  { name = "typing-inspection", version = "0.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
662
662
  { name = "uvicorn", marker = "sys_platform != 'emscripten'" },
663
663
  ]
664
- sdist = { url = "https://files.pythonhosted.org/packages/6e/77/9450b8f251a13affb6281997d0523c4615f8a8b35d0b21ff30db3a5aac9d/mcp-1.28.1.tar.gz", hash = "sha256:d51e36a5f5644faea4f85ea649bfffa6bc6c26770d42798ad6a3de3d2ba69683", size = 638501, upload-time = "2026-06-26T12:57:29.093Z" }
664
+ sdist = { url = "https://files.pythonhosted.org/packages/ba/93/0142dc84a666daf8ad51a34268f34c12fd6fda4f3810c4be2504eecc8212/mcp-1.30.0.tar.gz", hash = "sha256:445414625fce5c295faa505bb11bacece661ab6f4028d57c935db57820b7a3e4", size = 680511, upload-time = "2026-09-07T14:34:15.845Z" }
665
665
  wheels = [
666
- { url = "https://files.pythonhosted.org/packages/e2/5e/d118fce19f87a2e7d8101c35c8ae0ec289098a4df0ff244cec23e415aca0/mcp-1.28.1-py3-none-any.whl", hash = "sha256:2726bca5e7193f61c5dde8b12500a6de2d9acf6d1a1c0be9e8c2e706437991df", size = 222620, upload-time = "2026-06-26T12:57:27.218Z" },
666
+ { url = "https://files.pythonhosted.org/packages/f5/f4/e58bc33317c92a0203664daaf00bf6f41166cc0149e5d6870a03f7cd004a/mcp-1.30.0-py3-none-any.whl", hash = "sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0", size = 234581, upload-time = "2026-09-07T14:34:14.266Z" },
667
667
  ]
668
668
 
669
669
  [[package]]
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "3.4.0",
3
- "distance": 0,
4
- "node": "g290b364e43b7b9174f1b4b7969e48af8ab3dc3f6",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-10-09"
8
- }