Skip to content

Commit 0c8ed5b

Browse files
Ajit Pratap SinghAjit Pratap Singh
authored andcommitted
docs: add MCP server environment variables to configuration guide
1 parent 8122805 commit 0c8ed5b

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/CONFIGURATION.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,5 +495,38 @@ git commit -m "config: update GoSQLX settings"
495495

496496
---
497497

498+
## MCP Server Environment Variables
499+
500+
The `gosqlx-mcp` server is configured exclusively via environment variables. No YAML config file is used or read. All variables are optional with safe defaults for local development.
501+
502+
| Variable | Default | Type | Validation |
503+
|----------|---------|------|-----------|
504+
| `GOSQLX_MCP_HOST` | `127.0.0.1` | string | Any valid bind address |
505+
| `GOSQLX_MCP_PORT` | `8080` | integer | 1–65535 |
506+
| `GOSQLX_MCP_AUTH_TOKEN` | *(empty)* | string | Empty = auth disabled; whitespace-trimmed |
507+
508+
### Examples
509+
510+
```bash
511+
# Local development (all defaults)
512+
gosqlx-mcp
513+
514+
# Custom port
515+
GOSQLX_MCP_PORT=9090 gosqlx-mcp
516+
517+
# Expose to network with auth
518+
GOSQLX_MCP_HOST=0.0.0.0 GOSQLX_MCP_PORT=8080 GOSQLX_MCP_AUTH_TOKEN=my-secret gosqlx-mcp
519+
```
520+
521+
### Notes
522+
523+
- `GOSQLX_MCP_AUTH_TOKEN` enables bearer token authentication. When set, all requests must include `Authorization: Bearer <token>`.
524+
- `GOSQLX_MCP_PORT` rejects out-of-range or non-integer values at startup with a descriptive error.
525+
- MCP server configuration is independent of `.gosqlx.yml` — the YAML config file is not read by `gosqlx-mcp`.
526+
527+
See [MCP Server Guide](MCP_GUIDE.md) for the full startup and auth reference.
528+
529+
---
530+
498531
**Last Updated**: December 2025
499532
**Version**: v1.6.0

0 commit comments

Comments
 (0)