serverdex 0.1.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,32 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes the package to PyPI when you cut a GitHub Release.
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API token/secret needed.
5
+ # One-time setup on PyPI: pypi.org -> your account -> Publishing ->
6
+ # "Add a pending publisher": project "serverdex", owner "hellolistifyai",
7
+ # repo "serverdex-py", workflow "publish.yml", environment "pypi".
8
+
9
+ on:
10
+ release:
11
+ types: [published]
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ build-and-publish:
18
+ runs-on: ubuntu-latest
19
+ environment: pypi
20
+ permissions:
21
+ id-token: write # required for Trusted Publishing
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+ - name: Build
28
+ run: |
29
+ python -m pip install --upgrade build
30
+ python -m build
31
+ - name: Publish to PyPI
32
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,5 @@
1
+ dist/
2
+ build/
3
+ *.egg-info/
4
+ __pycache__/
5
+ *.pyc
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Serverdex
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.
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.5
2
+ Name: serverdex
3
+ Version: 0.1.0
4
+ Summary: Tiny Python client for Serverdex — search 60,000+ MCP servers from the official registry.
5
+ Project-URL: Homepage, https://serverdex.io
6
+ Project-URL: Documentation, https://serverdex.io/developers
7
+ Project-URL: Source, https://github.com/hellolistifyai/serverdex-py
8
+ Author-email: Serverdex <hello@serverdex.io>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,ai,claude,cursor,directory,llm,mcp,model-context-protocol,serverdex
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+
21
+ # serverdex
22
+
23
+ A tiny Python client for [Serverdex](https://serverdex.io) — the directory of Model Context Protocol (MCP) servers. Serverdex indexes 60,000+ MCP servers from the official registry, with install configs, GitHub signals and category rankings.
24
+
25
+ No API key, no dependencies (standard library only).
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ pip install serverdex
31
+ ```
32
+
33
+ ## Use
34
+
35
+ ```python
36
+ import serverdex
37
+
38
+ # Search the directory
39
+ for s in serverdex.search("postgres", limit=5):
40
+ print(s["name"], "—", s["url"])
41
+
42
+ # Filter by category and sort by stars
43
+ serverdex.search(category="databases", sort="stars", limit=10)
44
+
45
+ # Get one server by slug (from a serverdex.io/server/<slug> URL)
46
+ server = serverdex.get("io-github-ccxt-ccxt-mcp")
47
+ print(server["description"], server["repository_url"])
48
+
49
+ # List categories with live server counts
50
+ for c in serverdex.categories():
51
+ print(c["name"], c["servers"])
52
+ ```
53
+
54
+ Or with an explicit client:
55
+
56
+ ```python
57
+ from serverdex import Client
58
+
59
+ client = Client()
60
+ results = client.search("calendar", sort="new", limit=20)
61
+ ```
62
+
63
+ ## API
64
+
65
+ - `search(query=None, *, category=None, sort=None, limit=10, page=1)` — list of server dicts.
66
+ - `get(slug)` — one server's full details.
67
+ - `categories()` — categories with live counts.
68
+
69
+ Backed by the public Serverdex API at `https://serverdex.io/api/v1`. Browse the directory at [serverdex.io](https://serverdex.io).
70
+
71
+ ## License
72
+
73
+ MIT
@@ -0,0 +1,53 @@
1
+ # serverdex
2
+
3
+ A tiny Python client for [Serverdex](https://serverdex.io) — the directory of Model Context Protocol (MCP) servers. Serverdex indexes 60,000+ MCP servers from the official registry, with install configs, GitHub signals and category rankings.
4
+
5
+ No API key, no dependencies (standard library only).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install serverdex
11
+ ```
12
+
13
+ ## Use
14
+
15
+ ```python
16
+ import serverdex
17
+
18
+ # Search the directory
19
+ for s in serverdex.search("postgres", limit=5):
20
+ print(s["name"], "—", s["url"])
21
+
22
+ # Filter by category and sort by stars
23
+ serverdex.search(category="databases", sort="stars", limit=10)
24
+
25
+ # Get one server by slug (from a serverdex.io/server/<slug> URL)
26
+ server = serverdex.get("io-github-ccxt-ccxt-mcp")
27
+ print(server["description"], server["repository_url"])
28
+
29
+ # List categories with live server counts
30
+ for c in serverdex.categories():
31
+ print(c["name"], c["servers"])
32
+ ```
33
+
34
+ Or with an explicit client:
35
+
36
+ ```python
37
+ from serverdex import Client
38
+
39
+ client = Client()
40
+ results = client.search("calendar", sort="new", limit=20)
41
+ ```
42
+
43
+ ## API
44
+
45
+ - `search(query=None, *, category=None, sort=None, limit=10, page=1)` — list of server dicts.
46
+ - `get(slug)` — one server's full details.
47
+ - `categories()` — categories with live counts.
48
+
49
+ Backed by the public Serverdex API at `https://serverdex.io/api/v1`. Browse the directory at [serverdex.io](https://serverdex.io).
50
+
51
+ ## License
52
+
53
+ MIT
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "serverdex"
7
+ version = "0.1.0"
8
+ description = "Tiny Python client for Serverdex — search 60,000+ MCP servers from the official registry."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Serverdex", email = "hello@serverdex.io" }]
13
+ keywords = ["mcp", "model-context-protocol", "serverdex", "directory", "ai", "llm", "claude", "cursor", "agents"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ ]
22
+ dependencies = []
23
+
24
+ [project.urls]
25
+ Homepage = "https://serverdex.io"
26
+ Documentation = "https://serverdex.io/developers"
27
+ Source = "https://github.com/hellolistifyai/serverdex-py"
28
+
29
+ [tool.hatch.build.targets.wheel]
30
+ packages = ["src/serverdex"]
@@ -0,0 +1,100 @@
1
+ """Serverdex — a tiny Python client for the Serverdex directory of MCP servers.
2
+
3
+ Serverdex (https://serverdex.io) indexes the official Model Context Protocol
4
+ registry: 60,000+ MCP servers, searchable, with install configs, GitHub signals
5
+ and category rankings. This client wraps the public JSON API — no API key, no
6
+ dependencies (standard library only).
7
+
8
+ import serverdex
9
+ serverdex.search("postgres", limit=5)
10
+ serverdex.get("io-github-ccxt-ccxt-mcp")
11
+ serverdex.categories()
12
+ """
13
+ from __future__ import annotations
14
+
15
+ import json
16
+ import urllib.error
17
+ import urllib.parse
18
+ import urllib.request
19
+ from typing import Any, Optional
20
+
21
+ __all__ = ["Client", "ServerdexError", "search", "get", "categories", "__version__"]
22
+ __version__ = "0.1.0"
23
+
24
+ _BASE = "https://serverdex.io/api/v1"
25
+ _UA = f"serverdex-python/{__version__} (+https://serverdex.io)"
26
+
27
+
28
+ class ServerdexError(RuntimeError):
29
+ """Raised when the Serverdex API returns an error or is unreachable."""
30
+
31
+
32
+ class Client:
33
+ """Client for the Serverdex public API (https://serverdex.io).
34
+
35
+ All methods return plain Python dicts/lists parsed from the JSON API.
36
+ """
37
+
38
+ def __init__(self, base_url: str = _BASE, timeout: float = 20.0) -> None:
39
+ self.base_url = base_url.rstrip("/")
40
+ self.timeout = timeout
41
+
42
+ def _get(self, path: str, params: Optional[dict] = None) -> Any:
43
+ url = self.base_url + path
44
+ if params:
45
+ clean = {k: v for k, v in params.items() if v is not None}
46
+ if clean:
47
+ url += "?" + urllib.parse.urlencode(clean)
48
+ req = urllib.request.Request(url, headers={"User-Agent": _UA, "Accept": "application/json"})
49
+ try:
50
+ with urllib.request.urlopen(req, timeout=self.timeout) as resp:
51
+ return json.loads(resp.read().decode("utf-8"))
52
+ except urllib.error.HTTPError as exc: # pragma: no cover - network
53
+ raise ServerdexError(f"Serverdex API returned HTTP {exc.code} for {url}") from exc
54
+ except urllib.error.URLError as exc: # pragma: no cover - network
55
+ raise ServerdexError(f"Could not reach the Serverdex API: {exc.reason}") from exc
56
+
57
+ def search(
58
+ self,
59
+ query: Optional[str] = None,
60
+ *,
61
+ category: Optional[str] = None,
62
+ sort: Optional[str] = None,
63
+ limit: int = 10,
64
+ page: int = 1,
65
+ ) -> list:
66
+ """Search MCP servers. Returns a list of server dicts.
67
+
68
+ query: words to search for (omit to browse). category: a category slug
69
+ (see categories()). sort: "new" (default), "name" or "stars".
70
+ """
71
+ data = self._get("/servers", {"q": query, "category": category, "sort": sort, "limit": limit, "page": page})
72
+ return data.get("data", [])
73
+
74
+ def get(self, slug: str) -> dict:
75
+ """Get everything about one server by slug (from a serverdex.io/server/<slug> URL)."""
76
+ data = self._get("/servers/" + urllib.parse.quote(slug, safe=""))
77
+ return data.get("data", {})
78
+
79
+ def categories(self) -> list:
80
+ """List the directory's categories with live server counts."""
81
+ data = self._get("/categories")
82
+ return data.get("data", [])
83
+
84
+
85
+ _default = Client()
86
+
87
+
88
+ def search(query: Optional[str] = None, **kwargs) -> list:
89
+ """Module-level shortcut for Client().search()."""
90
+ return _default.search(query, **kwargs)
91
+
92
+
93
+ def get(slug: str) -> dict:
94
+ """Module-level shortcut for Client().get()."""
95
+ return _default.get(slug)
96
+
97
+
98
+ def categories() -> list:
99
+ """Module-level shortcut for Client().categories()."""
100
+ return _default.categories()