From 43c356e5144f05bf219268b230241534141c1400 Mon Sep 17 00:00:00 2001 From: divyanshujethi Date: Wed, 25 Nov 2026 13:15:12 +0530 Subject: [PATCH 1/2] fix(python): fix CLI SyntaxError, modernize pyproject metadata, add PyPI workflow --- .github/workflows/publish-pypi.yml | 76 ++++++++++++++++++ sdks/python/pyproject.toml | 3 +- sdks/python/src/mcpshelf/cli.py | 16 +--- .../test_mcpshelf_sdk.cpython-315.pyc | Bin 0 -> 1119 bytes sdks/python/tests/test_mcpshelf_sdk.py | 15 ++++ 5 files changed, 93 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/publish-pypi.yml create mode 100644 sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc create mode 100644 sdks/python/tests/test_mcpshelf_sdk.py diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 00000000..f5d70928 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,76 @@ +name: Publish mcpshelf to PyPI + +on: + push: + branches: [main] + paths: + - "sdks/python/**" + - ".github/workflows/publish-pypi.yml" + tags: + - "python-v*" + - "v*" + pull_request: + branches: [main] + paths: + - "sdks/python/**" + - ".github/workflows/publish-pypi.yml" + workflow_dispatch: + +permissions: read-all + +jobs: + build-and-test: + name: Build & Test mcpshelf Python SDK + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: "3.11" + + - name: Install build, twine & test deps + run: | + python -m pip install --upgrade pip build twine + python -m pip install -e sdks/python + + - name: Run Python SDK smoke tests + run: | + python -m unittest discover -s sdks/python/tests -v + + - name: Build sdist/wheel and check with twine + run: | + cd sdks/python + python -m build + python -m twine check dist/* + + - name: Upload built distributions + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: mcpshelf-pypi-dist + path: sdks/python/dist/* + + publish-pypi: + name: Publish mcpshelf to PyPI + needs: [build-and-test] + if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/python-v') || startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - name: Download built distributions + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.0 + with: + name: mcpshelf-pypi-dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1 + with: + packages-dir: dist/ + password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 25292e49..b9d632f9 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" authors = [ { name = "RitualDev Lab", email = "developer@ritualdev.in" } ] -license = { text = "Apache-2.0" } +license = "Apache-2.0" keywords = [ "mcp", "model-context-protocol", @@ -24,7 +24,6 @@ keywords = [ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/sdks/python/src/mcpshelf/cli.py b/sdks/python/src/mcpshelf/cli.py index 3ae1759e..1fa069e0 100644 --- a/sdks/python/src/mcpshelf/cli.py +++ b/sdks/python/src/mcpshelf/cli.py @@ -54,21 +54,7 @@ def main(): run_server() return - if cmd == "list":CPShelf Python CLI - Open Registry for MCP Servers & Dev Tools (https://mcp.ritualdev.in) - -Usage: - mcpshelf explore Interactive terminal browser & installer - mcpshelf search Search 419+ verified MCP servers - mcpshelf tools Search 577+ free open-source dev tools (DevShelf) - mcpshelf get Inspect metadata & install configs - mcpshelf audit Run trust score & security check - mcpshelf-mcp Run stdio MCP server for AI agents -""") - return - - cmd = args[0] - - if cmd == "explore": + if cmd in ("list", "explore"): catalog = get_servers() print(f"\n⚡ MCPShelf Terminal Explorer ({len(catalog)} Verified Servers)") print("=" * 70) diff --git a/sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc b/sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e7cc736f4306066ed1c070f887a9c7befeb8a42 GIT binary patch literal 1119 zcma)5%}*0S6o32C?TUp4`49;NyihhlG>!3Kh%vzgJQS!} zL{D<`;DMuF{9gz}$Z*ialQ&37^yr)IRtSm4N#2|H`J4CN%slAo>;POhw~VTz0DPB9 zd!-Vg8KSU(vcFAMB z;MNx_Ua+=UuDWd?iDn>SwPy1(3L8jqk7}f>BG{}tqeSYA8fn8&g84MM&#i|S+J=%^ zRP)I!^2rJRk){15>tY-CbT28VxUJTxJkL^v<_5knm`9&^ROmIw4=qEOHMh=W%T)GA zW$~iJVHm}iXu}ifio+bvsmQjB_t{*;=c3TFbfGhuCwn_hW;&{4qobo@dHS|pLL6q# zI&RgY_PywN7(`B)*)u*T3p9G-xt!UB>4kXaHY-<|U0>&wD6~0V28%gq7f8@QSzi}J z(ntJSJ))cuCoB^$z zJ20_lUOV_>GCmr+1K0P=8)(`$hjz@N_bXq_u_orjC$Q4OBqVfd9wDNGkXlr31X9ir z^0eUui6=|Qnok)I{Ll*{LTDDVMIRxIJKT4PoVEYBfmLH_Hz96-b1(ZYcfBAW#8O1( z86&32M|78VA*XWmF_Qw5z`r)JwV$ey${hhR+TD(jwaOQOh$&$ Date: Wed, 25 Nov 2026 13:16:49 +0530 Subject: [PATCH 2/2] chore: drop tracked __pycache__ bytecode from PR --- .../test_mcpshelf_sdk.cpython-315.pyc | Bin 1119 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc diff --git a/sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc b/sdks/python/tests/__pycache__/test_mcpshelf_sdk.cpython-315.pyc deleted file mode 100644 index 4e7cc736f4306066ed1c070f887a9c7befeb8a42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1119 zcma)5%}*0S6o32C?TUp4`49;NyihhlG>!3Kh%vzgJQS!} zL{D<`;DMuF{9gz}$Z*ialQ&37^yr)IRtSm4N#2|H`J4CN%slAo>;POhw~VTz0DPB9 zd!-Vg8KSU(vcFAMB z;MNx_Ua+=UuDWd?iDn>SwPy1(3L8jqk7}f>BG{}tqeSYA8fn8&g84MM&#i|S+J=%^ zRP)I!^2rJRk){15>tY-CbT28VxUJTxJkL^v<_5knm`9&^ROmIw4=qEOHMh=W%T)GA zW$~iJVHm}iXu}ifio+bvsmQjB_t{*;=c3TFbfGhuCwn_hW;&{4qobo@dHS|pLL6q# zI&RgY_PywN7(`B)*)u*T3p9G-xt!UB>4kXaHY-<|U0>&wD6~0V28%gq7f8@QSzi}J z(ntJSJ))cuCoB^$z zJ20_lUOV_>GCmr+1K0P=8)(`$hjz@N_bXq_u_orjC$Q4OBqVfd9wDNGkXlr31X9ir z^0eUui6=|Qnok)I{Ll*{LTDDVMIRxIJKT4PoVEYBfmLH_Hz96-b1(ZYcfBAW#8O1( z86&32M|78VA*XWmF_Qw5z`r)JwV$ey${hhR+TD(jwaOQOh$&$