|
| 1 | +# PostgreSQL MCP Server - MCP Registry Publishing Guide |
| 2 | + |
| 3 | +*Last Updated October 13, 2025* |
| 4 | + |
| 5 | +This document outlines how the PostgreSQL MCP Server is configured for publication to the [MCP Registry](https://registry.modelcontextprotocol.io/). |
| 6 | + |
| 7 | +## 📋 Overview |
| 8 | + |
| 9 | +The PostgreSQL MCP Server is configured for **hybrid deployment** with multiple package types: |
| 10 | + |
| 11 | +- **PyPI Package**: `postgres-mcp-enhanced` v1.1.1 |
| 12 | +- **Docker Image**: `writenotenow/postgres-mcp-enhanced` v1.1.1 |
| 13 | +- **MCP Registry**: `io.github.neverinfamous/postgres-mcp-server` |
| 14 | + |
| 15 | +## ✅ Configuration Complete |
| 16 | + |
| 17 | +All necessary configuration for MCP Registry publishing has been completed: |
| 18 | + |
| 19 | +### 1. Server Configuration (`server.json`) |
| 20 | +- ✅ Created with MCP registry schema validation |
| 21 | +- ✅ Defines both PyPI and Docker packages |
| 22 | +- ✅ Version: 1.1.1 |
| 23 | +- ✅ Namespace: `io.github.neverinfamous/postgres-mcp-server` |
| 24 | + |
| 25 | +### 2. Validation Markers |
| 26 | + |
| 27 | +**PyPI Validation:** |
| 28 | +- ✅ README.md contains: `<!-- mcp-name: io.github.neverinfamous/postgres-mcp-server -->` |
| 29 | +- Location: Line 5 of README.md |
| 30 | +- Purpose: MCP Registry validates ownership via PyPI package description |
| 31 | + |
| 32 | +**Docker Validation:** |
| 33 | +- ✅ Dockerfile contains: `LABEL io.modelcontextprotocol.server.name="io.github.neverinfamous/postgres-mcp-server"` |
| 34 | +- Location: Line 57 of Dockerfile |
| 35 | +- Purpose: MCP Registry validates ownership via Docker image labels |
| 36 | + |
| 37 | +### 3. GitHub Actions Workflow |
| 38 | + |
| 39 | +The existing `publish-pypi.yml` workflow has been enhanced with MCP Registry publishing: |
| 40 | + |
| 41 | +**Workflow Structure:** |
| 42 | +1. **Job 1: build-and-publish** - Publishes to PyPI |
| 43 | +2. **Job 2: publish-to-mcp-registry** - Publishes to MCP Registry (depends on Job 1) |
| 44 | + |
| 45 | +**Workflow Features:** |
| 46 | +- ✅ Validates server.json version matches release version |
| 47 | +- ✅ Verifies MCP validation markers in README and Dockerfile |
| 48 | +- ✅ Checks PyPI package availability before MCP publishing |
| 49 | +- ✅ Uses GitHub OIDC authentication (no manual token needed) |
| 50 | +- ✅ Provides comprehensive publication summary |
| 51 | + |
| 52 | +### 4. README Corrections |
| 53 | + |
| 54 | +Fixed inconsistent Docker image references: |
| 55 | +- ❌ Old: `neverinfamous/postgres-mcp:latest` |
| 56 | +- ✅ New: `writenotenow/postgres-mcp-enhanced:latest` |
| 57 | + |
| 58 | +## 🚀 Publishing Process |
| 59 | + |
| 60 | +### Automated Publishing (Recommended) |
| 61 | + |
| 62 | +The complete publishing process is automated via GitHub Actions: |
| 63 | + |
| 64 | +```bash |
| 65 | +# 1. Update version in pyproject.toml |
| 66 | +# Current: version = "1.1.1" |
| 67 | + |
| 68 | +# 2. Update version in server.json |
| 69 | +# Current: "version": "1.1.1" |
| 70 | + |
| 71 | +# 3. Commit and push changes |
| 72 | +git add pyproject.toml server.json |
| 73 | +git commit -m "chore: Bump version to 1.1.2" |
| 74 | +git push origin main |
| 75 | + |
| 76 | +# 4. Create and push version tag |
| 77 | +git tag v1.1.2 |
| 78 | +git push origin v1.1.2 |
| 79 | + |
| 80 | +# 5. Create GitHub Release |
| 81 | +gh release create v1.1.2 --title "v1.1.2" --notes "Release notes here" |
| 82 | +``` |
| 83 | + |
| 84 | +### What the Workflow Does |
| 85 | + |
| 86 | +When you create a GitHub release: |
| 87 | + |
| 88 | +1. **PyPI Publishing:** |
| 89 | + - Builds Python package |
| 90 | + - Publishes to PyPI as `postgres-mcp-enhanced` |
| 91 | + - Verifies publication |
| 92 | + |
| 93 | +2. **MCP Registry Publishing:** |
| 94 | + - Waits for PyPI package availability |
| 95 | + - Validates server.json schema |
| 96 | + - Verifies MCP markers in README and Dockerfile |
| 97 | + - Installs MCP Publisher CLI |
| 98 | + - Publishes to MCP Registry using GitHub OIDC |
| 99 | + - Verifies publication in registry |
| 100 | + |
| 101 | +### Manual Publishing (Alternative) |
| 102 | + |
| 103 | +If you need to publish manually: |
| 104 | + |
| 105 | +```bash |
| 106 | +# 1. Ensure you're on the correct version |
| 107 | +grep version pyproject.toml |
| 108 | +jq .version server.json |
| 109 | + |
| 110 | +# 2. Install MCP Publisher CLI |
| 111 | +curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_windows_amd64.tar.gz" | tar xz |
| 112 | +mv mcp-publisher.exe C:\Windows\System32\ # or add to PATH |
| 113 | + |
| 114 | +# 3. Authenticate with GitHub |
| 115 | +mcp-publisher login github |
| 116 | + |
| 117 | +# 4. Publish to registry |
| 118 | +mcp-publisher publish --verbose |
| 119 | +``` |
| 120 | + |
| 121 | +## 📦 Package Information |
| 122 | + |
| 123 | +### PyPI Package: `postgres-mcp-enhanced` |
| 124 | +- **Current Version**: 1.1.1 |
| 125 | +- **Registry**: https://pypi.org/project/postgres-mcp-enhanced/ |
| 126 | +- **Installation**: `pip install postgres-mcp-enhanced` |
| 127 | + |
| 128 | +### Docker Image: `writenotenow/postgres-mcp-enhanced` |
| 129 | +- **Current Version**: v1.1.1, latest |
| 130 | +- **Registry**: https://hub.docker.com/r/writenotenow/postgres-mcp-enhanced |
| 131 | +- **Usage**: `docker pull writenotenow/postgres-mcp-enhanced:latest` |
| 132 | + |
| 133 | +### MCP Registry: `io.github.neverinfamous/postgres-mcp-server` |
| 134 | +- **Registry**: https://registry.modelcontextprotocol.io/ |
| 135 | +- **Search**: `io.github.neverinfamous/postgres-mcp-server` |
| 136 | + |
| 137 | +## 🔍 Verification |
| 138 | + |
| 139 | +### Check PyPI Package |
| 140 | +```bash |
| 141 | +pip index versions postgres-mcp-enhanced |
| 142 | +curl -s "https://pypi.org/pypi/postgres-mcp-enhanced/json" | jq '.info.version' |
| 143 | +``` |
| 144 | + |
| 145 | +### Check Docker Image |
| 146 | +```bash |
| 147 | +docker pull writenotenow/postgres-mcp-enhanced:latest |
| 148 | +docker inspect writenotenow/postgres-mcp-enhanced:latest | jq '.[0].Config.Labels' |
| 149 | +``` |
| 150 | + |
| 151 | +### Check MCP Registry |
| 152 | +```bash |
| 153 | +curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.neverinfamous/postgres-mcp-server" | jq . |
| 154 | +``` |
| 155 | + |
| 156 | +## 🐛 Troubleshooting |
| 157 | + |
| 158 | +### Common Issues |
| 159 | + |
| 160 | +**"Package validation failed"** |
| 161 | +- Verify PyPI package contains MCP name in README |
| 162 | +- Verify Docker image has correct label |
| 163 | +- Check package versions match server.json |
| 164 | + |
| 165 | +**"Authentication failed"** |
| 166 | +- Ensure GitHub Actions has `id-token: write` permission |
| 167 | +- Verify repository is under `neverinfamous` namespace |
| 168 | +- Check GitHub OIDC token is available |
| 169 | + |
| 170 | +**"Version already exists"** |
| 171 | +- MCP Registry doesn't allow version overwrites |
| 172 | +- Increment version in both pyproject.toml and server.json |
| 173 | +- Create new release tag |
| 174 | + |
| 175 | +**"PyPI package not found"** |
| 176 | +- Wait 30-60 seconds for PyPI to index |
| 177 | +- Workflow includes automatic retry logic |
| 178 | +- Verify PyPI publishing succeeded first |
| 179 | + |
| 180 | +### Verification Commands |
| 181 | + |
| 182 | +```bash |
| 183 | +# Validate server.json |
| 184 | +python -m json.tool server.json |
| 185 | + |
| 186 | +# Check MCP markers |
| 187 | +grep "mcp-name:" README.md |
| 188 | +grep "io.modelcontextprotocol.server.name" Dockerfile |
| 189 | + |
| 190 | +# Test workflow locally (requires act) |
| 191 | +gh act release -e .github/workflows/test-release.json |
| 192 | +``` |
| 193 | + |
| 194 | +## 📚 Resources |
| 195 | + |
| 196 | +- **MCP Registry**: https://registry.modelcontextprotocol.io/ |
| 197 | +- **MCP Documentation**: https://modelcontextprotocol.io/docs/ |
| 198 | +- **Publishing Guide**: https://github.com/modelcontextprotocol/registry/blob/main/docs/guides/publishing/publish-server.md |
| 199 | +- **GitHub Actions Guide**: https://github.com/modelcontextprotocol/registry/blob/main/docs/guides/publishing/github-actions.md |
| 200 | +- **Server Schema**: https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json |
| 201 | + |
| 202 | +## 🎯 Next Steps |
| 203 | + |
| 204 | +The configuration is complete and ready for publishing. To publish: |
| 205 | + |
| 206 | +1. **Test First**: Create a test release with workflow_dispatch |
| 207 | +2. **Verify**: Check all three registries (PyPI, Docker Hub, MCP) |
| 208 | +3. **Document**: Update changelog and release notes |
| 209 | +4. **Announce**: Share on social media, Reddit, HN, etc. |
| 210 | + |
| 211 | +## 📝 Notes |
| 212 | + |
| 213 | +- The MCP Registry publishing is integrated into the existing PyPI workflow |
| 214 | +- No separate workflow needed - everything runs on release creation |
| 215 | +- GitHub OIDC authentication is automatic in GitHub Actions |
| 216 | +- All validation checks run before attempting to publish |
| 217 | +- Comprehensive summary provided in GitHub Actions output |
| 218 | + |
| 219 | +--- |
| 220 | + |
| 221 | +*Configuration completed October 13, 2025* |
| 222 | + |
0 commit comments