You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/130-version-management.mdc
+25-2Lines changed: 25 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,47 @@ alwaysApply: false
5
5
---
6
6
# MCP Server Version Management Rule
7
7
8
-
## When updating the version of the MCP server, update the following files:
8
+
## When updating the version of the MCP server, update the following files
9
9
10
10
1. **`pyproject.toml`** - Update the `version` field in the `[project]` section:
11
+
11
12
```toml
12
13
[project]
13
14
name = "blockscout-mcp-server"
14
15
version = "X.Y.Z" # <-- Update this line
15
16
```
16
17
17
18
2. **`blockscout_mcp_server/__init__.py`** - Update the `__version__` variable:
19
+
18
20
```python
19
21
"""Blockscout MCP Server package."""
20
22
21
23
__version__ = "X.Y.Z" # <-- Update this line
22
24
```
23
25
24
-
## Important Notes:
26
+
## Important Notes
25
27
26
28
- **Use the exact same version string** in both locations (e.g., "1.2.3")
27
29
- **Follow semantic versioning** (MAJOR.MINOR.PATCH) when choosing version numbers
28
30
- **Update both files simultaneously** to maintain consistency across the codebase
31
+
32
+
## Why Dual-Location Approach?
33
+
34
+
While modern Python packaging suggests using `importlib.metadata.version(__name__)` to make `pyproject.toml` the single source of truth, **we deliberately use the dual-location approach** for the following reasons:
35
+
36
+
### **Reliability Across Environments**
37
+
38
+
- **Local Development**: Works when running directly from source without installation
39
+
- **Docker Containers**: Functions regardless of installation method
40
+
- **Testing**: Reliable in various test environments and CI/CD pipelines
41
+
- **Multiple Installation Methods**: Compatible with pip, uv, and other package managers
42
+
43
+
### **Deployment Scenarios**
44
+
45
+
For an MCP server that needs to work in various environments (local development, Docker, different installation methods), the dual-location approach ensures version information is always accessible without runtime dependencies or potential import failures.
46
+
47
+
### **Trade-offs**
48
+
49
+
- **Slight Maintenance Overhead**: Requires updating two files instead of one
50
+
- **Drift Risk**: Mitigated by this rule ensuring both locations are updated simultaneously
51
+
- **Consistency**: The version management rule ensures both locations stay in sync
0 commit comments