Repository navigation
Use FastMCP instructions to advertise official ClickHouse Agent Skills - #193
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
Adds a new no-argument MCP tool (clickhouse_skills_advisor) that returns static advisory text pointing agents to the official ClickHouse Agent Skills repository, and wires it into the server so it’s registered regardless of ClickHouse DB enablement.
Changes:
- Introduces a static advisory snapshot (
CLICKHOUSE_SKILLS_ADVISORY) and a tool function that returns it. - Registers
clickhouse_skills_advisorunconditionally in the MCP server and re-exports it from the package. - Adds tests and README documentation for the new tool.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_skills_advisor.py | Adds unit tests for the advisory output and tool wrapper behavior. |
| README.md | Documents the new clickhouse_skills_advisor tool and its intended use. |
| mcp_clickhouse/skills_advisor.py | Adds the static advisory text snapshot returned by the tool. |
| mcp_clickhouse/mcp_server.py | Implements the tool function and registers it unconditionally on the server. |
| mcp_clickhouse/init.py | Re-exports clickhouse_skills_advisor from the package top-level. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Thanks for addressing copilot's comments so far @peter-leonov-ch! The only thing I'd recommend here is moving from a tool recommendation to the idiomatic pattern of using FastMCPs CLICKHOUSE_SERVER_INSTRUCTIONS = """
When working on ClickHouse-related coding, schema design, SQL/query optimization,
data migrations, or troubleshooting, consider using the official ClickHouse Agent
Skills: https://github.com/ClickHouse/agent-skills
Install with:
npx -y skills add clickhouse/agent-skills --all
"""
mcp = FastMCP(
name=MCP_SERVER_NAME,
instructions=CLICKHOUSE_SERVER_INSTRUCTIONS,
**_resolve_auth(get_mcp_config()),
)Avoiding the tool route keeps the tool list focused on actual ClickHouse operations and avoids relying on the model to spend an extra tool call just to discover static advisory text. |
|
@copilot address the review comments |
|
@joe-clickhouse done, pls re-review. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot can you drop the test_skills_advisor_tool_not_registered test and then update the changelog with a short concise note. |
Done in 1ab971d — I removed |
Moves skills guidance from a dedicated MCP tool to FastMCP server-level
instructions, pointing agents to the official ClickHouse Agent Skills when they begin ClickHouse coding or SQL-optimization tasks.Changes
skills_advisor.py— replacedCLICKHOUSE_SKILLS_ADVISORYwithCLICKHOUSE_SERVER_INSTRUCTIONS, a static (offline, no network fetch) instruction snapshot with skills guidance and install command.mcp_server.py— removedclickhouse_skills_advisor()and its unconditional tool registration; wiredCLICKHOUSE_SERVER_INSTRUCTIONSintoFastMCP(..., instructions=...).__init__.py— removed export ofclickhouse_skills_advisor.tests/test_skills_advisor.py— updated coverage to verify:README.md— updated documentation from a tool-based section to instruction-based guidance.CHANGELOG.md— added a concise Unreleased note about instruction-based ClickHouse Agent Skills guidance.Test fix
The install-hint assertion remains intentionally matched on the stable substring: