-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor ClickHouse MCP tools with improved documentation and functionality #18
base: main
Are you sure you want to change the base?
Conversation
…nality - Added detailed descriptions for MCP tools - Enhanced `get_table_sample` with rand() sampling, filtering, and error handling - Improved logging and parameter validation
- Add `.specstory/history/*` to .gitignore - Remove previously tracked SpecStory history markdown files
Why disable TLS by default? |
raise ValueError( | ||
f"Missing required environment variables: {', '.join(missing_vars)}" | ||
) | ||
os.environ[var] = default_value |
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 ends up calling putenv
underneath. Ideally we wouldn't mutate process environment variables. Especially since this changes getenv to always be used with a default, it seems unnecessary
ClickHouseError: If there's an error executing the query | ||
""" | ||
# Validate limit | ||
if limit > 10: |
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.
Why cap at 10?
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.
Since this is an MCP and the package is meant to work with AI agents, I had to set this limit to avoid overflowing the language model’s context window. I deal with huge tables, and the AI kept trying to grab a way too large sample. Do you think I should increase the cap?
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.
10 seems low, have you checked how other MCP servers handle this?
Local development artifact |
I guess TLS off by default is fair when the default host is localhost. Could have TLS default be off when host is localhost & on otherwise, but having static defaults is nice. At least TLS verification should be on by default (which won't matter when TLS is disabled) |
get_table_sample
tool with rand() sampling, filtering, and error handling