cedar-mcp 1.0.0__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.
@@ -0,0 +1,8 @@
1
+ # CEDAR API Configuration
2
+ # Copy this file to .env and add your actual API key
3
+
4
+ # CEDAR API Key for accessing CEDAR metadata repository
5
+ CEDAR_API_KEY=your-cedar-api-key-here
6
+
7
+ # BioPortal API Key for fetching vocabulary terms
8
+ BIOPORTAL_API_KEY=your-bioportal-api-key-here
@@ -0,0 +1,112 @@
1
+ # CI/CD Deployment Guide
2
+
3
+ This repository is configured with a comprehensive CI/CD pipeline using GitHub Actions.
4
+
5
+ ## ๐Ÿš€ Quick Setup
6
+
7
+ ### 1. Configure Repository Secrets
8
+ Go to **Settings โ†’ Secrets and variables โ†’ Actions** and add:
9
+
10
+ **Optional for Integration Tests:**
11
+ - `CEDAR_API_KEY` - CEDAR repository API key
12
+ - `BIOPORTAL_API_KEY` - BioPortal API key
13
+
14
+ ### 2. Enable Branch Protection
15
+ Go to **Settings โ†’ Branches** and add rules for `main`:
16
+ - โœ… Require status checks to pass before merging
17
+ - โœ… Require branches to be up to date before merging
18
+ - โœ… Include administrators
19
+
20
+ ### 3. Enable Security Features
21
+ Go to **Settings โ†’ Code security and analysis**:
22
+ - โœ… Dependency graph
23
+ - โœ… Dependabot alerts
24
+ - โœ… Dependabot security updates
25
+ - โœ… Code scanning (CodeQL)
26
+ - โœ… Secret scanning
27
+
28
+ ## ๐Ÿ“‹ Workflows Overview
29
+
30
+ | Workflow | Triggers | Purpose |
31
+ |----------|----------|---------|
32
+ | **CI** | Push/PR to `main`/`develop` | Code quality, testing, security |
33
+ | **Release** | Git tags (`v*`) | Build package and create GitHub release |
34
+ | **CodeQL** | Push/PR + weekly | Advanced security scanning |
35
+ | **Dependabot** | Weekly | Automated dependency updates |
36
+
37
+ ## ๐Ÿ”„ CI Pipeline
38
+
39
+ ### On Pull Request / Push
40
+ 1. **Code Quality**: ruff linting, mypy type checking
41
+ 2. **Testing**: Unit tests on Python 3.10, 3.11, 3.12
42
+ 3. **Integration Tests**: Run if API keys available
43
+ 4. **Security**: Dependency and code security scanning
44
+ 5. **Build**: Package verification
45
+
46
+ ### On Release Tag
47
+ 1. **Build**: Create distribution packages
48
+ 2. **Verify**: Check package integrity
49
+ 3. **Release**: Create GitHub release with distribution artifacts
50
+
51
+ ## ๐Ÿ“ฆ Creating a Release
52
+
53
+ 1. Update version in `pyproject.toml`
54
+ 2. Commit and push changes
55
+ 3. Create and push a tag:
56
+ ```bash
57
+ git tag v0.1.1
58
+ git push origin v0.1.1
59
+ ```
60
+ 4. GitHub Actions will automatically:
61
+ - Build the package
62
+ - Create a GitHub release with installation instructions
63
+
64
+ ## ๐Ÿงช Local Testing
65
+
66
+ Simulate CI checks locally:
67
+ ```bash
68
+ # Code quality
69
+ ruff check .
70
+ ruff format --check .
71
+ mypy src/
72
+
73
+ # Testing
74
+ python run_tests.py --unit
75
+ python run_tests.py --integration # if API keys configured
76
+
77
+ # CLI verification
78
+ python -m cedar_mcp.server --help
79
+ ```
80
+
81
+ ## ๐Ÿ”ง Troubleshooting
82
+
83
+ ### Integration Tests Skip
84
+ If integration tests are skipped, ensure API keys are configured in repository secrets.
85
+
86
+ ### Release Creation Fails
87
+ 1. Ensure version number in `pyproject.toml` is incremented
88
+ 2. Check that the git tag follows the `v*` pattern (e.g., v0.1.0)
89
+ 3. Verify package builds successfully locally
90
+
91
+ ### Code Quality Failures
92
+ Run locally to reproduce:
93
+ ```bash
94
+ ruff check . # Fix linting issues
95
+ ruff format . # Auto-format code
96
+ mypy src/ # Fix type hints
97
+ ```
98
+
99
+ ## ๐Ÿ“Š Monitoring
100
+
101
+ - **GitHub Actions**: Monitor workflow runs in Actions tab
102
+ - **Security**: Review security advisories and Dependabot PRs
103
+ - **Coverage**: Check coverage reports from CI runs
104
+ - **GitHub Releases**: Monitor release downloads and user feedback
105
+
106
+ ## ๐ŸŽฏ Success Indicators
107
+
108
+ - โœ… All CI workflows passing
109
+ - โœ… Automated releases working
110
+ - โœ… Security scanning active
111
+ - โœ… Dependencies automatically updated
112
+ - โœ… Package successfully installable from source via uvx
@@ -0,0 +1,33 @@
1
+ version: 2
2
+ updates:
3
+ # Python dependencies
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "monday"
9
+ time: "09:00"
10
+ open-pull-requests-limit: 10
11
+ reviewers:
12
+ - "musen-lab/maintainers"
13
+ assignees:
14
+ - "musen-lab/maintainers"
15
+ commit-message:
16
+ prefix: "deps"
17
+ include: "scope"
18
+
19
+ # GitHub Actions dependencies
20
+ - package-ecosystem: "github-actions"
21
+ directory: "/"
22
+ schedule:
23
+ interval: "weekly"
24
+ day: "monday"
25
+ time: "09:00"
26
+ open-pull-requests-limit: 5
27
+ reviewers:
28
+ - "musen-lab/maintainers"
29
+ assignees:
30
+ - "musen-lab/maintainers"
31
+ commit-message:
32
+ prefix: "ci"
33
+ include: "scope"
@@ -0,0 +1,140 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ code-quality:
11
+ runs-on: ubuntu-latest
12
+ name: Code Quality
13
+
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v6
19
+ with:
20
+ python-version: '3.10'
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install -r requirements-dev.txt
26
+
27
+ - name: Lint with ruff
28
+ run: ruff check .
29
+
30
+ - name: Format check with ruff
31
+ run: ruff format --check .
32
+
33
+ - name: Type check with mypy
34
+ run: mypy src/
35
+
36
+ test:
37
+ runs-on: ubuntu-latest
38
+ strategy:
39
+ matrix:
40
+ python-version: ['3.10', '3.11', '3.12']
41
+
42
+ name: Test Python ${{ matrix.python-version }}
43
+
44
+ steps:
45
+ - uses: actions/checkout@v6
46
+
47
+ - name: Set up Python ${{ matrix.python-version }}
48
+ uses: actions/setup-python@v6
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+
52
+ - name: Install dependencies
53
+ run: |
54
+ python -m pip install --upgrade pip
55
+ pip install -r requirements-dev.txt
56
+ pip install -e .
57
+
58
+ - name: Run unit tests
59
+ run: python run_tests.py --unit --coverage --no-warnings
60
+
61
+ - name: Run integration tests (if API keys available)
62
+ env:
63
+ CEDAR_API_KEY: ${{ secrets.CEDAR_API_KEY }}
64
+ BIOPORTAL_API_KEY: ${{ secrets.BIOPORTAL_API_KEY }}
65
+ run: |
66
+ if [ -n "$CEDAR_API_KEY" ] && [ -n "$BIOPORTAL_API_KEY" ]; then
67
+ echo "CEDAR_API_KEY=${CEDAR_API_KEY}" > .env.test
68
+ echo "BIOPORTAL_API_KEY=${BIOPORTAL_API_KEY}" >> .env.test
69
+ python run_tests.py --integration
70
+ else
71
+ echo "Skipping integration tests - API keys not available"
72
+ fi
73
+
74
+ - name: Upload coverage reports to Codecov
75
+ if: matrix.python-version == '3.10'
76
+ uses: codecov/codecov-action@v5
77
+ with:
78
+ file: ./coverage.xml
79
+ fail_ci_if_error: false
80
+
81
+ build:
82
+ runs-on: ubuntu-latest
83
+ name: Build Package
84
+
85
+ steps:
86
+ - uses: actions/checkout@v6
87
+
88
+ - name: Set up Python
89
+ uses: actions/setup-python@v6
90
+ with:
91
+ python-version: '3.10'
92
+
93
+ - name: Install build dependencies
94
+ run: |
95
+ python -m pip install --upgrade pip
96
+ pip install build
97
+
98
+ - name: Build package
99
+ run: python -m build
100
+
101
+ - name: Verify package
102
+ run: |
103
+ pip install twine
104
+ twine check dist/*
105
+
106
+ - name: Test installation
107
+ run: |
108
+ pip install dist/*.whl
109
+ cedar-mcp --help
110
+
111
+ security:
112
+ runs-on: ubuntu-latest
113
+ name: Security Scan
114
+
115
+ steps:
116
+ - uses: actions/checkout@v6
117
+
118
+ - name: Set up Python
119
+ uses: actions/setup-python@v6
120
+ with:
121
+ python-version: '3.10'
122
+
123
+ - name: Install dependencies
124
+ run: |
125
+ python -m pip install --upgrade pip
126
+ pip install -r requirements-dev.txt
127
+ pip install safety bandit[toml]
128
+
129
+ - name: Run safety check
130
+ run: safety check
131
+
132
+ - name: Run bandit security scan
133
+ run: bandit -r src/ -f json -o bandit-report.json || true
134
+
135
+ - name: Upload bandit report
136
+ uses: actions/upload-artifact@v6
137
+ if: always()
138
+ with:
139
+ name: bandit-report
140
+ path: bandit-report.json
@@ -0,0 +1,48 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+ schedule:
9
+ - cron: '32 6 * * 1' # Run weekly on Mondays at 6:32 AM UTC
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ actions: read
17
+ contents: read
18
+ security-events: write
19
+
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ language: [ 'python' ]
24
+
25
+ steps:
26
+ - name: Checkout repository
27
+ uses: actions/checkout@v6
28
+
29
+ - name: Initialize CodeQL
30
+ uses: github/codeql-action/init@v4
31
+ with:
32
+ languages: ${{ matrix.language }}
33
+ queries: security-extended,security-and-quality
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v6
37
+ with:
38
+ python-version: '3.10'
39
+
40
+ - name: Install dependencies
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install -r requirements.txt
44
+
45
+ - name: Perform CodeQL Analysis
46
+ uses: github/codeql-action/analyze@v4
47
+ with:
48
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,105 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Trigger on version tags like v0.1.0, v1.0.0, etc.
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ name: Build Package
12
+
13
+ steps:
14
+ - uses: actions/checkout@v6
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v6
18
+ with:
19
+ python-version: '3.10'
20
+
21
+ - name: Install build dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install build twine
25
+
26
+ - name: Build package
27
+ run: python -m build
28
+
29
+ - name: Verify package
30
+ run: twine check dist/*
31
+
32
+ - name: Upload build artifacts
33
+ uses: actions/upload-artifact@v6
34
+ with:
35
+ name: dist-packages
36
+ path: dist/
37
+
38
+ create-github-release:
39
+ runs-on: ubuntu-latest
40
+ name: Create GitHub Release
41
+ needs: build
42
+
43
+ steps:
44
+ - uses: actions/checkout@v6
45
+
46
+ - name: Download build artifacts
47
+ uses: actions/download-artifact@v7
48
+ with:
49
+ name: dist-packages
50
+ path: dist/
51
+
52
+ - name: Get tag name
53
+ id: tag
54
+ run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
55
+
56
+ - name: Create GitHub Release
57
+ id: create-release
58
+ uses: actions/create-release@v1
59
+ env:
60
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61
+ with:
62
+ tag_name: ${{ steps.tag.outputs.tag }}
63
+ release_name: Release ${{ steps.tag.outputs.tag }}
64
+ body: |
65
+ ## Changes in ${{ steps.tag.outputs.tag }}
66
+
67
+ ### Installation
68
+
69
+ Install from PyPI:
70
+ ```bash
71
+ pip install cedar-mcp
72
+ ```
73
+
74
+ Or with uvx:
75
+ ```bash
76
+ uvx cedar-mcp
77
+ ```
78
+
79
+ ### Usage
80
+
81
+ See the [README](https://github.com/${{ github.repository }}/blob/${{ steps.tag.outputs.tag }}/README.md) for usage instructions.
82
+
83
+ ### What's New
84
+
85
+ Please see the commit history for detailed changes in this release.
86
+ draft: false
87
+ prerelease: false
88
+
89
+ publish:
90
+ runs-on: ubuntu-latest
91
+ name: Publish to PyPI
92
+ needs: build
93
+ environment: pypi
94
+ permissions:
95
+ id-token: write
96
+
97
+ steps:
98
+ - name: Download build artifacts
99
+ uses: actions/download-artifact@v7
100
+ with:
101
+ name: dist-packages
102
+ path: dist/
103
+
104
+ - name: Publish to PyPI
105
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,64 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ env/
8
+ venv/
9
+ ENV/
10
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+
26
+ # Virtual Environment
27
+ .venv/
28
+ venv/
29
+
30
+ # IDE
31
+ .vscode/
32
+ .idea/
33
+ *.swp
34
+ *.swo
35
+ *~
36
+
37
+ # OS
38
+ .DS_Store
39
+ Thumbs.db
40
+
41
+ # Project specific
42
+ *.log
43
+ .env
44
+ .env.test
45
+ .env.local
46
+ .env.development
47
+ .env.staging
48
+ .env.production
49
+ .claude
50
+ .obsidian
51
+ .serena
52
+
53
+ # Test artifacts
54
+ .pytest_cache/
55
+ .coverage
56
+ htmlcov/
57
+ .tox/
58
+ .nox/
59
+ coverage.xml
60
+ *.cover
61
+
62
+ # Temporary files
63
+ *.tmp
64
+ *.temp
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stanford Division of Computational Medicine
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.