Skip to content

Commit 1f51ad8

Browse files
authored
Merge pull request #25 from AlwaysSany/update-readme
Update the README with instructions to set the environment using .env
2 parents b7b9d3f + 30abfd2 commit 1f51ad8

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
REDIS_HOST=your_redis_host
2+
REDIS_PORT=6379
3+
REDIS_DB=0
4+
REDIS_USERNAME=default
5+
REDIS_PWD=your_password
6+
REDIS_SSL=False
7+
REDIS_CA_PATH=/path/to/ca.pem
8+
REDIS_SSL_KEYFILE=/path/to/key.pem
9+
REDIS_SSL_CERTFILE=/path/to/cert.pem
10+
REDIS_CERT_REQS=required
11+
REDIS_CA_CERTS=/path/to/ca_certs.pem
12+
REDIS_CLUSTER_MODE=False
13+
MCP_TRANSPORT=stdio

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ wheels/
88

99
# Virtual environments
1010
.venv
11+
.env
12+
env/
13+
ENV/
14+
env.bak/
15+
venv.bak/
1116

1217
# UV lock file
1318
uv.lock

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,31 @@ To configure this Redis MCP Server, consider the following environment variables
7373
| `MCP_TRANSPORT` | Use the `stdio` or `sse` transport | `stdio` |
7474

7575

76+
There are several ways to set environment variables:
77+
78+
1. **Using a `.env` File**:
79+
Place a `.env` file in your project directory with key-value pairs for each environment variable. Tools like `python-dotenv`, `pipenv`, and `uv` can automatically load these variables when running your application. This is a convenient and secure way to manage configuration, as it keeps sensitive data out of your shell history and version control (if `.env` is in `.gitignore`).
80+
81+
For example, create a `.env` file with the following content from the `.env.example` file provided in the repository:
82+
83+
```bash
84+
cp .env.example .env
85+
```
86+
87+
88+
Then edit the `.env` file to set your Redis configuration:
89+
90+
OR,
91+
92+
2. **Setting Variables in the Shell**:
93+
You can export environment variables directly in your shell before running your application. For example:
94+
```sh
95+
export REDIS_HOST=your_redis_host
96+
export REDIS_PORT=6379
97+
# Other variables will be set similarly...
98+
```
99+
This method is useful for temporary overrides or quick testing.
100+
76101
## Transports
77102

78103
This MCP server can be configured to handle requests locally, running as a process and communicating with the MCP client via `stdin` and `stdout`.

0 commit comments

Comments
 (0)