-
Notifications
You must be signed in to change notification settings - Fork 131
Multi-Databases Support #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Implements feature from issue Does it support multiple database connections? and is it possible to connect to two different databases? with multiple http endpoint. |
|
Thanks for the PR, could you please share how you would like to use this feature from the MCP client side (e.g. Claude / Cursor / VSCode etc)? I am thinking of supporting this scenairo in a more scalable way |
|
Thanks for the question. Our project utilizes multiple databases, and we query these databases through the MCP server's HTTP endpoint using a workflow like Dify provide. Current Scenario & Problem: How We Intend to Use the Feature:
Benefit (Scalability & Efficiency): By the way, would you please to share your thoughts about the more scalable way? |
|
@petergithub I am considering provide a configuration file in the TOML format to allow user to configure multiple databases. |
It is great with a configuration file in TOML format. If multiple endpoints are fine, I'll switch the config to TOML. Let me know the desired schema/format definition. |
|
TOML format offers greater flexibility. |
DBHub supports connecting to multiple databases simultaneously:
Configuration
DSNenvironment variable or--dsncommand line argumentDSN_dev,DSN_test, etc. environment variablesUsage Examples
HTTP Transport Endpoints
When using HTTP transport (
--transport=http), multiple endpoints are available:http://localhost:8080/message- Default database (first configured)http://localhost:8080/message/{databaseId}- Specific database (e.g.,http://localhost:8080/message/dev)STDIO Transport
Database Context
All MCP tools, resources, and prompts support database-specific operations:
execute_sql_{databaseId}generate_sql_{databaseId},explain_db_{databaseId}