Skip to content

Commit 8448f13

Browse files
authored
Merge pull request #2 from cloudera/dev
Release v1.0.0: Initial public release with security enhancements
2 parents bdb9adc + ce239a6 commit 8448f13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1743
-1165
lines changed

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [main, dev]
9+
10+
jobs:
11+
test:
12+
name: Tests
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Install uv
24+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
25+
26+
- name: Install dependencies
27+
run: |
28+
export PATH="$HOME/.cargo/bin:$PATH"
29+
uv sync
30+
31+
- name: Run tests
32+
run: |
33+
export PATH="$HOME/.cargo/bin:$PATH"
34+
uv run pytest tests/test_all_functions.py -v
35+
36+
- name: Security check
37+
run: |
38+
export PATH="$HOME/.cargo/bin:$PATH"
39+
uv run pytest tests/test_all_functions.py::test_no_subprocess_vulnerabilities -v
40+
41+
# Publish to PyPI on version tags (optional)
42+
publish:
43+
name: Publish
44+
runs-on: ubuntu-latest
45+
needs: test
46+
if: startsWith(github.ref, 'refs/tags/v')
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.10'
55+
56+
- name: Install uv
57+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
58+
59+
- name: Build and publish
60+
env:
61+
TWINE_USERNAME: __token__
62+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
63+
run: |
64+
export PATH="$HOME/.cargo/bin:$PATH"
65+
uv build
66+
uv pip install twine
67+
twine upload dist/* || echo "PyPI publish skipped (no token configured)"

β€Ž.gitignoreβ€Ž

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# Build artifacts
3+
__pycache__/
4+
*.pyc
5+
*.pyo
6+
*.pyd
7+
.Python
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
*.egg-info/
21+
.installed.cfg
22+
*.egg
23+
24+
# Environment and secrets
25+
.env
26+
secrets/
27+
28+
# IDE
29+
.DS_Store
30+
.vscode/
31+
.idea/
32+
33+
# Test cache
34+
.pytest_cache/
35+
.cache/

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 70 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,74 @@
11
# Changelog
22

3-
## Latest Cleanup and Documentation Update
3+
All notable changes to the CML MCP Server will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Comprehensive test suite (`test_all_functions.py`) with 11 unit tests
12+
- FastMCP integration tests (`test_cml_mcp_client.py`)
13+
- Security vulnerability detection tests
14+
- Comprehensive test documentation in `tests/README.md`
15+
16+
### Changed
17+
- **SECURITY**: Replaced all `subprocess.run` calls with secure `requests` library (46 files)
18+
- API keys now transmitted securely in HTTPS headers instead of process arguments
19+
- Updated all function error handling to use `requests.RequestException`
20+
- Improved timeout handling (30s timeout on all API calls)
21+
22+
### Fixed
23+
- **CRITICAL**: API key exposure vulnerability in process list (CVE-pending)
24+
- Error messages now properly report HTTP status codes
25+
- JSON parsing errors now provide better debugging information
26+
27+
### Security
28+
- Eliminated subprocess-based API calls that exposed credentials
29+
- All HTTP requests now use proper header-based authentication
30+
- Added comprehensive security testing in CI/CD pipeline
31+
32+
---
33+
34+
## [1.0.0] - 2025-10-22
35+
36+
### Added
37+
- Initial public release
38+
- Apache 2.0 license
39+
- NOTICE.txt with third-party attributions
40+
- 47+ MCP tools for Cloudera ML operations
41+
- Support for:
42+
- Project management
43+
- Job creation and management
44+
- Model building and deployment
45+
- Experiment tracking
46+
- File operations
47+
- Application management
48+
- FastMCP-based HTTP and stdio servers
49+
- OAuth 2.1 support
50+
- Comprehensive README documentation
451

552
### Changed
6-
- **Removed `server.py`**: Eliminated the legacy compatibility file entirely
7-
- **Updated Claude Desktop config**: Now uses `cml_mcp_server.stdio_server` directly
8-
- **Removed legacy entry point**: `cml-mcp-server` command no longer exists
9-
- **Cleaner documentation**: Removed all references to the old server.py approach
10-
- **Completed `stdio_server.py`**: Added all 47 tool definitions (was only 7)
11-
- **Fixed imports**: Added try/except for package vs direct execution
12-
13-
### Benefits
14-
- Cleaner codebase with no legacy code
15-
- Direct usage of appropriate server files (stdio_server.py or http_server.py)
16-
- Clear separation of concerns
17-
- Both server files are now complete and self-contained
18-
19-
## Major Refactoring (Previous Update)
20-
21-
### Code Organization
22-
- **Split server implementations**: Separated STDIO and HTTP into distinct files
23-
- `stdio_server.py` - Clean STDIO-only implementation
24-
- `http_server.py` - HTTP server with all endpoints
25-
- **Fixed HTTP issues**: Working `/mcp-api` endpoint with proper initialization
26-
- **Simplified imports**: Clear separation of concerns
27-
28-
### Server Improvements
29-
- Added `initialize` method to `/mcp-api` endpoint (fixes 404 errors)
30-
- All 47 tools now accessible via HTTP with working implementation
31-
- HTTP transport clearly marked as "development only" without authentication
32-
- Debug endpoints: `/test`, `/debug/tools`, `/debug/call` for easy testing
33-
34-
### Entry Points
35-
- `cml-mcp-stdio` - Runs stdio_server.py
36-
- `cml-mcp-http` - Runs http_server.py
37-
38-
### Documentation
39-
- Updated README with new server structure
40-
- Clear examples for both STDIO and HTTP modes
41-
- Removed OAuth sections (future feature)
42-
- Added troubleshooting section
43-
44-
### Key Fixes
45-
- Fixed "Tool not callable" errors by using direct function mappings
46-
- Fixed 404 errors by adding proper initialize method
47-
- Maintained backward compatibility while improving structure
48-
49-
### Usage
50-
```bash
51-
# STDIO (recommended)
52-
uv run -m cml_mcp_server.stdio_server
53-
54-
# HTTP (development)
55-
uv run -m cml_mcp_server.http_server
56-
```
53+
- Migrated from private to public repository
54+
- Updated all repository URLs to `github.com/cloudera/CML_MCP_Server`
55+
- Updated license from MIT to Apache 2.0
56+
- Added legal notices for third-party dependencies
57+
58+
---
59+
60+
## Types of Changes
61+
62+
- `Added` for new features
63+
- `Changed` for changes in existing functionality
64+
- `Deprecated` for soon-to-be removed features
65+
- `Removed` for now removed features
66+
- `Fixed` for any bug fixes
67+
- `Security` for vulnerability fixes
68+
69+
---
70+
71+
## Release Links
72+
73+
- [Unreleased](https://github.com/cloudera/CML_MCP_Server/compare/v1.0.0...HEAD)
74+
- [1.0.0](https://github.com/cloudera/CML_MCP_Server/releases/tag/v1.0.0)

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Contributing to CML MCP Server
2+
3+
Thanks for contributing! Keep it simple.
4+
5+
## πŸš€ Quick Start
6+
7+
```bash
8+
# 1. Fork and clone
9+
git clone https://github.com/YOUR_USERNAME/CML_MCP_Server.git
10+
cd CML_MCP_Server
11+
12+
# 2. Install
13+
pip install uv
14+
uv sync
15+
16+
# 3. Run tests
17+
uv run pytest tests/ -v
18+
```
19+
20+
---
21+
22+
## πŸ”„ Making Changes
23+
24+
### Branching Strategy
25+
26+
We use a simple two-branch strategy:
27+
- **`main`** - Stable, production-ready (default branch)
28+
- **`dev`** - Active development
29+
30+
**All contributions go to `dev` first, then released to `main`.**
31+
32+
### 1. Create Branch
33+
34+
```bash
35+
git checkout dev
36+
git pull origin dev
37+
git checkout -b feature/your-feature
38+
```
39+
40+
### 2. Make Changes
41+
42+
- Write code
43+
- Add tests
44+
- Run tests: `uv run pytest tests/ -v`
45+
46+
### 3. Commit
47+
48+
```bash
49+
git add .
50+
git commit -m "feat: your change"
51+
git push origin feature/your-feature
52+
```
53+
54+
**Commit format:** `type: description`
55+
56+
- `feat:` New feature
57+
- `fix:` Bug fix
58+
- `docs:` Documentation
59+
- `test:` Tests
60+
61+
### 4. Create PR
62+
63+
- **Target branch: `dev`** (not main!)
64+
- Fill in description
65+
- Wait for review
66+
67+
---
68+
69+
## βœ… Requirements
70+
71+
### All PRs Must:
72+
73+
- βœ… Pass all tests
74+
- βœ… Have no security vulnerabilities
75+
- βœ… Follow code style
76+
- βœ… Include documentation updates if needed
77+
78+
### Code Standards
79+
80+
```python
81+
# βœ… GOOD - Use requests library
82+
import requests
83+
84+
headers = {"Authorization": f"Bearer {api_key}"}
85+
response = requests.get(url, headers=headers, timeout=30)
86+
87+
# ❌ BAD - Never use subprocess with API keys
88+
import subprocess
89+
subprocess.run(["curl", "-H", f"Bearer {api_key}", url])
90+
```
91+
92+
**Key Rules:**
93+
- Never expose API keys in subprocess/logs
94+
- Always use `requests` library for HTTP
95+
- Add timeout to all requests (30s)
96+
- Use type hints
97+
- Write docstrings
98+
99+
---
100+
101+
## πŸ§ͺ Testing
102+
103+
### Run Tests
104+
105+
```bash
106+
# All tests
107+
uv run pytest tests/ -v
108+
109+
# Just security tests
110+
uv run pytest tests/test_all_functions.py::test_no_subprocess_vulnerabilities -v
111+
112+
# FastMCP test
113+
uv run python tests/test_cml_mcp_client.py --quick
114+
```
115+
116+
### Add Tests
117+
118+
Every new function needs tests in `tests/test_all_functions.py`:
119+
120+
```python
121+
def test_my_function(mock_config):
122+
"""Test my new function."""
123+
result = my_function(mock_config, {"param": "value"})
124+
assert isinstance(result, dict)
125+
assert "success" in result
126+
```
127+
128+
---
129+
130+
## πŸ”’ Security
131+
132+
**Critical:** Never expose API keys!
133+
134+
- ❌ Don't log them
135+
- ❌ Don't print them
136+
- ❌ Don't pass as subprocess args
137+
- βœ… Use HTTPS headers only
138+
139+
**Report vulnerabilities:** Email [email protected] (not GitHub issues!)
140+
141+
---
142+
143+
## πŸ“ Documentation
144+
145+
Update docs if you:
146+
- Add new function
147+
- Change behavior
148+
- Add dependencies
149+
150+
---
151+
152+
## 🎯 That's It!
153+
154+
Keep it simple:
155+
1. Fork β†’ Branch β†’ Code β†’ Test β†’ PR
156+
2. Target `dev` branch
157+
3. Pass tests
158+
4. Get approval
159+
5. Merge!
160+
161+
Questions? Open a GitHub Discussion.

0 commit comments

Comments
Β (0)