env2mcp
Environment configuration manager for MCP projects. Provides utilities to manage .env files and integrate with GitHub CLI (gh) for authentication.
Installation
# From project root
pip install -e ./env2mcp
# Or with pipx
pipx install ./env2mcp
Quick Start
GitHub Setup Wizard
# Interactive setup - checks gh CLI, prompts for auth, saves to .env
env2mcp setup-github
# Or use the github command group
env2mcp github login
Environment Management
# Show all environment variables
env2mcp env show
# Set a variable
env2mcp env set OPENROUTER_API_KEY "sk-or-v1-..."
# Get a variable (masked by default)
env2mcp env get OPENROUTER_API_KEY
env2mcp env get OPENROUTER_API_KEY --show # Show full value
GitHub Commands
# Check auth status
env2mcp github status
# Login (interactive)
env2mcp github login
# List your repos
env2mcp github repos --limit 10
# List repos for specific user/org
env2mcp github repos --owner microsoft --limit 5
# Logout
env2mcp github logout
Python API
from env2mcp import EnvConfig, GitHubCLI, get_github_token
# Load .env file
config = EnvConfig(".env")
# Get/set values
api_key = config.get("OPENROUTER_API_KEY")
config["GITHUB_PAT"] = "ghp_xxx"
config.save()
# GitHub CLI integration
gh = GitHubCLI()
if gh.is_available():
token = gh.get_token()
user = gh.get_user()
repos = gh.list_repos(limit=10)
How It Works
- GitHub Authentication: Checks for
ghCLI and uses it to get tokens securely - Token Storage: Saves
GITHUB_PATto.envfile with backup creation - Environment Loading: Loads variables from both
.envfile and actual environment (env takes precedence)
Integration with MCP
The package is used across the MCP project:
mcp-git-proxyusesGITHUB_PATfor authenticated git operationsllm-agentloads configuration via env2mcpmcp-webuiprovides UI for GitHub repo configuration
License
Licensed under Apache-2.0.
Metadata
Release files for env2mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| env2mcp-0.1.4.tar.gz | 8.4 kB | Without provenance | Details for env2mcp-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| env2mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for env2mcp-0.1.4-py3-none-any.whl |
Total release size: 17.5 kB
Release files / env2mcp-0.1.4.tar.gz
| Download URL | env2mcp-0.1.4.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c97f911f877c431a57b28d29c321b7cc8b5a72f42dcb63edf02eff910014f112
|
|
BLAKE2b-256 checksum How to use checksums |
f819a0deb5bd84cf4923b36c3a118715a23ec8ba2165f9ac49a5e3956e6c9f50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / env2mcp-0.1.4-py3-none-any.whl
| Download URL | env2mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
135f88d9024ce400e1f51388c61161a48f693b1f9d330a578984d852d51b0e7d
|
|
BLAKE2b-256 checksum How to use checksums |
3812461e3fc94a98f010d51320406d9fdfe998242b9a1f824b1f972ea280af17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for env2mcp 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.