mirror of
https://github.com/executeautomation/mcp-database-server.git
synced 2025-12-09 21:12:57 +08:00
Add connection timeout support for PostgreSQL in MCP Database Server
Enhanced the PostgreSQL connection handling by introducing a `--connection-timeout` parameter, allowing users to specify a custom timeout in milliseconds. Updated relevant documentation in README and postgresql-setup.md to reflect this new option. Modified the PostgresqlAdapter to utilize the connection timeout setting during database connections.
This commit is contained in:
@@ -25,6 +25,9 @@ node dist/src/index.js --postgresql --host localhost --database yourdb --user po
|
||||
|
||||
# With SSL enabled
|
||||
node dist/src/index.js --postgresql --host localhost --database yourdb --user postgres --password yourpassword --ssl true
|
||||
|
||||
# With custom connection timeout (in milliseconds)
|
||||
node dist/src/index.js --postgresql --host localhost --database yourdb --user postgres --password yourpassword --connection-timeout 60000
|
||||
```
|
||||
|
||||
## Command Line Arguments
|
||||
@@ -36,6 +39,7 @@ node dist/src/index.js --postgresql --host localhost --database yourdb --user po
|
||||
- `--password`: The password for the PostgreSQL user.
|
||||
- `--port`: The port the PostgreSQL server is listening on (default: 5432).
|
||||
- `--ssl`: Whether to use SSL for the connection (true/false).
|
||||
- `--connection-timeout`: The connection timeout in milliseconds (default: 30000).
|
||||
|
||||
## Usage from MCP Client
|
||||
|
||||
|
||||
Reference in New Issue
Block a user