feat(pypi): add username-based package discovery - #10
Merged
Conversation
Previously the PyPI generator only accepted explicit comma-separated package names (e.g. `pypi: requests,flask`), unlike npm, RubyGems and Docker Hub which all look up packages by username. Changes: - Add `fetchPyPIUserPackages(username)` that calls the PyPI XMLRPC `user_packages` method to auto-discover all packages owned or maintained by a given username - When a single value with no commas is provided, first attempt a username lookup; if that returns packages, use them — otherwise fall back to treating the value as a single package name (backwards- compatible) - When multiple comma-separated values are provided, keep existing behaviour (explicit package names) - Include the user's PyPI profile URL in `identity.contact.social` when resolved by username (mirrors behaviour of npm/dockerhub) - Update `templates/.mcp-me.yaml` to document both usage modes Now both forms work: pypi: your-username # auto-discovers all your packages pypi: package1,package2 # explicit package names (unchanged) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gusbepapi
pushed a commit
to gusbepapi/mcp-me
that referenced
this pull request
Jul 11, 2026
Previously the PyPI generator only accepted explicit comma-separated package names (e.g. `pypi: requests,flask`), unlike npm, RubyGems and Docker Hub which all look up packages by username. Changes: - Add `fetchPyPIUserPackages(username)` that calls the PyPI XMLRPC `user_packages` method to auto-discover all packages owned or maintained by a given username - When a single value with no commas is provided, first attempt a username lookup; if that returns packages, use them — otherwise fall back to treating the value as a single package name (backwards- compatible) - When multiple comma-separated values are provided, keep existing behaviour (explicit package names) - Include the user's PyPI profile URL in `identity.contact.social` when resolved by username (mirrors behaviour of npm/dockerhub) - Update `templates/.mcp-me.yaml` to document both usage modes Now both forms work: pypi: your-username # auto-discovers all your packages pypi: package1,package2 # explicit package names (unchanged) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The PyPI generator previously only accepted explicit comma-separated package names:
```yaml
pypi: requests,flask,django
```
Unlike npm, RubyGems and Docker Hub — which all accept a username and auto-discover your packages — PyPI required users to know and list every package name upfront. This was inconsistent and inconvenient.
Solution
When a single value (no commas) is passed to `pypi:`, the generator now first attempts a username lookup via the PyPI XMLRPC `user_packages` API. If the user owns packages, those are fetched automatically. If no user is found, it falls back to treating the value as a single package name (backwards-compatible).
```yaml
New: by username — auto-discovers all your packages
pypi: your-username
Existing: explicit package names (unchanged)
pypi: package1,package2
```
Changes
`src/generators/npm.ts`
`templates/.mcp-me.yaml`
Verified working (smoke tests)
DockerHub — already implemented, confirmed end-to-end:
```
[DockerHub] Fetching repos for paladini...
[DockerHub] Found 3 repositories.
Projects found: 3
```
PyPI by username — new feature, confirmed end-to-end:
```
[PyPI] Looking up packages for user "paladini"...
[PyPI] Found 2 package(s) owned by "paladini".
[PyPI] ✔ faker-job-brazil v0.0.1.dev0
[PyPI] ✔ pySpark-connector-kairosdb v0.1.0
Projects found: 2
```
PyPI by package names — existing behaviour, unchanged:
```yaml
pypi: requests,flask # still works as before
```
Test plan
🤖 Generated with Claude Code