-
Notifications
You must be signed in to change notification settings - Fork 67
Add Schema Retrieval to MySQL MCP server #73 #76
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
Signed-off-by: fsavva <[email protected]>
| return json.dumps({"error": f"Error with NL_SQL: {set_response}"}) | ||
|
|
||
| if db_connection.database is not None: | ||
| call_nl_sql = f"CALL sys.NL_SQL(%s, @response, JSON_OBJECT('schemas', JSON_ARRAY(\"{db_connection.database}\"), 'execute', FALSE, 'model_id', 'meta.llama-4-maverick-17b-128e-instruct-fp8'))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we put the llama4-maverick into constants, also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now removed. The SP in the backend automatically identifies the right model to use
ay0407
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the hard-coded model name. Other than that, looks good to me. Thank you!
- Modified the ask_nl_sql tool and added test cases - Modified the retrieve_relevant_schema_information to use new SP and added test cases - Adapted README.md to highlight issue with uv in Windows environments
| """ | ||
| Load and validate the MySQL MCP server configuration file. | ||
| Resolution: | ||
| 1) If MYSQL_MCP_CONFIG is set, load that absolute path. | ||
| 2) Otherwise, load <module_dir>/local_config.json. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was intentional to not pin the config file to a specific path. this makes it easier if someone wants to simultaneously use multiple MCP servers for MySQL that use different configs, e.g., one for one customer and another for a different customer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this behavior is still honored through the use of MYSQL_MCP_CONFIG . I removed config_path as an input parameter as it was not being used.
| This tool analyzes the input question and, from the provided list of schema and/or table names, | ||
| identifies only those that are relevant with respect to the question. | ||
| It can optionally consider table and column comments for improved semantic matching. The results contain only the relevant schemas and tables in a JSON object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: length of this row looks off
Description
This PR adds support for a Schema Retrieval tool in the MySQL MCP server. It also makes changes to the project structure to be in-line with the Best Practises
Fixes #73
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: