Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

evgenii-baev
Copy link

@evgenii-baev evgenii-baev commented Mar 3, 2025

  • Added detailed descriptions for MCP tools
  • Added get_table_sample tool with rand() sampling, filtering, and error handling
  • Improved logging and parameter validation

evgenii-baev and others added 5 commits February 28, 2025 05:08
…nality

- Added detailed descriptions for MCP tools
- Enhanced `get_table_sample` with rand() sampling, filtering, and error handling
- Improved logging and parameter validation
@CLAassistant
Copy link

CLAassistant commented Mar 3, 2025

CLA assistant check
All committers have signed the CLA.

- Add `.specstory/history/*` to .gitignore
- Remove previously tracked SpecStory history markdown files
@iskakaushik iskakaushik requested a review from serprex March 4, 2025 03:04
@serprex
Copy link
Member

serprex commented Mar 4, 2025

Why disable TLS by default?

raise ValueError(
f"Missing required environment variables: {', '.join(missing_vars)}"
)
os.environ[var] = default_value
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cap at 10?

Copy link
Author

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?

Copy link
Member

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?

@evgenii-baev
Copy link
Author

evgenii-baev commented Mar 4, 2025

Why disable TLS by default?

Local development artifact

@serprex
Copy link
Member

serprex commented Mar 4, 2025

Why disable TLS by default?

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants