-
Notifications
You must be signed in to change notification settings - Fork 240
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)pythonPython / backend development (FastAPI)Python / backend development (FastAPI)triageIssues / Features awaiting triageIssues / Features awaiting triage
Milestone
Description
Fix Version Endpoint to Include Semantic Version (Not Just Git Revision)
Priority: Medium (API/Operations)
Description:
The /version
endpoint currently only returns git revision information and is missing the semantic version number of the application. The version is already available via from mcpgateway import __version__
but is not being included in the version endpoint response.
Current Behavior:
/version
endpoint returns app name, MCP protocol version, and git revision- No semantic version (e.g., "0.3.1") is displayed
- Version information is incomplete for deployment tracking
Current Code in version.py:
"app": {
"name": settings.app_name,
"mcp_protocol_version": settings.protocol_version,
"git_revision": _git_revision(),
},
Expected Behavior:
/version
endpoint should include the semantic version from__version__
- Version should be displayed in both JSON API responses and the Admin UI
Simple Implementation:
- Update version.py - Add import and include version in payload:
# Add to imports at top of version.py
from mcpgateway import __version__
# Update the app section in _build_payload function
"app": {
"name": settings.app_name,
"version": __version__,
"mcp_protocol_version": settings.protocol_version,
"git_revision": _git_revision(),
},
- Update the HTML template (
templates/version_info_partial.html
) to display the version:
<!-- Add to the app section of the template -->
<tr>
<th>Version</th>
<td>{{ payload.app.version }}</td>
</tr>
- Update the admin.js to properly display version in the UI:
// In the version info display section
if (data.app && data.app.version) {
// Display the semantic version prominently
const versionElement = document.createElement('div');
versionElement.className = 'text-lg font-semibold mb-2';
versionElement.textContent = `Version: ${data.app.version}`;
// Insert at top of version panel
}
Complete Expected Response:
{
"timestamp": "2025-01-11T12:00:00Z",
"host": "hostname",
"uptime_seconds": 3600,
"app": {
"name": "MCP_Gateway",
"version": "0.3.1", // Added from __version__
"mcp_protocol_version": "2024-11-20",
"git_revision": "abc123def"
},
"platform": {...},
"database": {...},
"redis": {...},
"settings": {...},
"env": {...},
"system": {...}
}
Testing Requirements:
- Verify
/version
endpoint returns the version from__version__
- Test that version appears in JSON response
- Verify version displays correctly in Admin UI version tab
- Ensure version matches what's in
mcpgateway/__init__.py
Benefits:
- Clear version tracking for deployments using existing
__version__
- No need for complex version management systems
- Minimal code changes required
- Consistent with Python packaging best practices
Acceptance Criteria:
- Version endpoint includes
version
field from__version__
- Version displays in JSON API response
- Version displays in Admin UI version tab
- No breaking changes to existing version endpoint structure
Files to Modify:
mcpgateway/version.py
- Add import and version fieldtemplates/version_info_partial.html
- Display version in HTML (if it exists)admin.js
(optional) - Enhance version display in UI if needed
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)pythonPython / backend development (FastAPI)Python / backend development (FastAPI)triageIssues / Features awaiting triageIssues / Features awaiting triage