Environment configuration manager for MCP projects
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
env2mcp-0.1.3.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file env2mcp-0.1.3.tar.gz.
File metadata
- Download URL: env2mcp-0.1.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce3b85747db3d4660805455fa85ccda5a7a1edffd64ed193609e9cb690f99c83
|
|
| MD5 |
43728651ea1dc77ec706d33c4583937b
|
|
| BLAKE2b-256 |
d88d52f7ae6859f8036bd3f4bf3ff25496d8839001c86c3042a8d2db9040ee66
|
File details
Details for the file env2mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: env2mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
613a8cafff9efb4cd5b6ab376ab9d70b7c755c0412aaa6de78e261d2c722e844
|
|
| MD5 |
c2e29ed60f9ad8a430d304b2eb5edbd7
|
|
| BLAKE2b-256 |
e7ed6bf9052659d234eee336bd76ff2eeba925a3a282130112f02231f410cfb8
|