Initial project structure for MCP interceptors (#3)
Establishes a multi-language monorepo structure for MCP interceptors with Python and TypeScript SDKs alongside the existing Go implementation. Implements an efficient CI/CD system that only tests what changes. #### 🏗️ SDK Scaffolding - **Python SDK** (`python/sdk/`): Modern Python package using `pyproject.toml`, aligned with official MCP Python SDK patterns - **TypeScript SDK** (`typescript/sdk/`): ESM-based package structure, compatible with official MCP TypeScript SDK - **Monorepo structure**: Consistent `{language}/sdk/` pattern across all implementations #### 🚀 CI/CD Pipeline - **Path-based workflow triggering**: Only runs CI for languages that actually changed - Change Python → only Python CI runs - Change multiple languages → only those CIs run - **Status check workflow**: Single required check that dynamically validates based on changes - **Comment triggers**: Maintainers can run all checks with `/test all` PR comment
This commit is contained in:
parent
dd925ba134
commit
20974b6fa0
1 changed files with 900 additions and 3 deletions
67
.github/workflows/python.yml
vendored
Normal file
67
.github/workflows/python.yml
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
name: Python CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'python/**'
|
||||
- '.github/workflows/python.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'python/**'
|
||||
- '.github/workflows/python.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
python-lint:
|
||||
name: "Linting"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd python/sdk
|
||||
pip install -e .
|
||||
pip install ruff mypy
|
||||
- name: Run Ruff formatter check
|
||||
run: |
|
||||
cd python/sdk
|
||||
ruff format --check .
|
||||
- name: Run Ruff linter
|
||||
run: |
|
||||
cd python/sdk
|
||||
ruff check .
|
||||
- name: Run mypy
|
||||
run: |
|
||||
cd python/sdk
|
||||
mypy src/mcp_ext_interceptors --ignore-missing-imports
|
||||
|
||||
python-test:
|
||||
name: "Unit Tests"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12"]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd python/sdk
|
||||
pip install -e .
|
||||
pip install pytest pytest-cov
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd python/sdk
|
||||
pytest -v --cov=src/mcp_ext_interceptors
|
||||
Loading…
Reference in a new issue