MCP server for reading and writing .env variables (email/SMTP and custom keys)
Project description
nlp2env
AI Cost Tracking
- 🤖 LLM usage: $0.4415 (2 commits)
- 👤 Human dev: ~$300 (3.0h @ $100/h, 30min dedup)
Generated on 2026-06-08 using openrouter/qwen/qwen3-coder-next
MCP server do odczytu i zapisu pliku .env — w tym profilu SMTP/email dla workflow send_email (nlp2dsl-worker).
Instalacja
cd ~/github/semcod/nlp2env
pip install -e ".[mcp]"
Uruchomienie MCP
export NLP2ENV_ENV_FILE=~/github/wronai/todomat/.env # opcjonalnie
nlp2env-mcp
Narzędzia MCP
| Tool | Opis |
|---|---|
nlp2env_interfaces |
Metadane, ścieżka .env, profile |
nlp2env_list |
Lista kluczy (sekrety zamaskowane) |
nlp2env_get |
Odczyt kluczy (comma-separated) |
nlp2env_set |
Zapis z JSON {"SMTP_HOST":"..."} |
nlp2env_set_email |
Zapis profilu SMTP (host, user, password, …) |
nlp2env_apply_text |
Parsuj bloki KEY=value z tekstu |
nlp2env_backup |
Kopia .env → .nlp2env/backups/ |
nlp2env_email_status |
Czy SMTP jest kompletny |
Profil email (nlp2dsl)
Klucze zgodne z nlp2dsl worker:
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, SMTP_TLS, SMTP_FROM, SMTP_TIMEOUT
Po zapisie zrestartuj worker:
docker compose -f ~/github/wronai/nlp2dsl/docker-compose.yml restart worker
Cursor (mcp.json)
{
"mcpServers": {
"nlp2env": {
"command": "nlp2env-mcp",
"env": {
"NLP2ENV_ENV_FILE": "/home/tom/github/wronai/todomat/.env"
}
}
}
}
uri2env
Pakiet uri2env (w src/uri2env/) mapuje URI env:// na plik .env — używany przez nlp2uri do adresowania konfiguracji:
pip install -e ".[mcp,nlp2uri]"
uri2env materialize --uri 'env://nlp2env/smtp?dest=./.env'
W nlp2uri: resolve_env() → env://… → materialize_env().
Testy
pip install -e ".[dev]"
pytest
make examples # szybkie e2e
make examples-multilang # 26 promptów LLM/Ollama (16 języków)
make examples-all # oba
prompts-multilang.txt (examples/write/smtp-email/) — 26 wielojęzycznych promptów NL testujących ścieżkę LLM → MCP → .env; uruchamiane przez make examples-multilang. Opis: examples/write/smtp-email/README.md.
Przykłady NL → .env (Docker + README): examples/README.md.
License
Licensed under Apache-2.0.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 nlp2env-0.1.3.tar.gz.
File metadata
- Download URL: nlp2env-0.1.3.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b7335379654ffe56c91640bc22dd7a183be48e868d89e874a40544cfca2969
|
|
| MD5 |
6d96eb2b6247244fd42fc8b341a3ac14
|
|
| BLAKE2b-256 |
9a51806d8b868878dcd67b7c327f5e973f9cc3fdca3c139cab01223b6f75c020
|
File details
Details for the file nlp2env-0.1.3-py3-none-any.whl.
File metadata
- Download URL: nlp2env-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.5 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 |
6762235bd73fb3eabd2ec0b577e6bb2fca32f79eeba0c303a6fcd21d807b42dc
|
|
| MD5 |
1ba240fbd8ac3c6f7bac075ec8b811d8
|
|
| BLAKE2b-256 |
efecac8c4b86c1b5af63795842f908888a579364d12a3ac847ee7a752c21ab00
|