Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions sdks/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
16 changes: 1 addition & 15 deletions sdks/python/src/mcpshelf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <query> Search 419+ verified MCP servers
mcpshelf tools <query> Search 577+ free open-source dev tools (DevShelf)
mcpshelf get <serverId> Inspect metadata & install configs
mcpshelf audit <serverId> 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)
Expand Down
15 changes: 15 additions & 0 deletions sdks/python/tests/test_mcpshelf_sdk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest


class TestMcpShelfSdk(unittest.TestCase):
def test_imports_and_entrypoints(self):
import mcpshelf
from mcpshelf import cli, server

self.assertTrue(hasattr(cli, "main"))
self.assertTrue(hasattr(server, "main"))
self.assertIsNotNone(mcpshelf)


if __name__ == "__main__":
unittest.main()