Repository navigation
Client config override support via MCP Context Session states - #115
Conversation
There was a problem hiding this comment.
Will need some merge conflict resolution, but otherwise looks good to me! Thanks for the contribution.
ae3b981 to
9a819d5
Compare
|
@joe-clickhouse , the conflicts are fixed now. Thank you |
|
Thanks @andrei-katkov! I'll give this another review by tomorrow. |
|
Tests are failing. Looks like try:
ctx = get_context()
session_config_overrides = ctx.get_state("clickhouse_client_config_overrides")
if session_config_overrides:
logger.info(f"Applying session-specific ClickHouse client config overrides {session_config_overrides}")
client_config.update(session_config_overrides)
except RuntimeError:
pass # No active context...direct calls, health checks, tests, etc.
.... |
6e24918 to
5f7c4ba
Compare
…guaranteed to be present
5f7c4ba to
15d0ae7
Compare
|
Hello, @joe-clickhouse . Thank you for you suggestion, indeed seems like wrapping this thing in try-catch is the best we can do in this situation. So, I've implemented that. Can you please check again? Thanks |
|
Hi @andrei-katkov I hope you don't mind but I made a few updates.
Take a look when you have a few minutes! |
|
@joe-clickhouse , your changes make total sense to me. Your test code is definitely an improvement over my version, since I do not know how to use mocks in Python. |
|
@andrei-katkov my pleasure! Happy to help. |
|
Hello, @joe-clickhouse . I don't know about your release cycle, so can I ask you for an approximate timeline when this can be merged? Thank you |
|
Hi @andrei-katkov! Just merged this PR. We don't really have a defined release schedule but I'll try and get one out Monday morning pacific time if that works for you. |
|
Hi, @joe-clickhouse , that works perfectly for me, thank you |
|
Hey @andrei-katkov just wanted to let you know I haven't forgot about getting a release out. We're jest trying to get a few more important things wrapped into the next one and the needed approvals. |
Adds support for middleware-driven ClickHouse client configuration overrides using FastMCP's context state management. This enables per-request customization of connection parameters without modifying environment variables.