8000 Use FastMCP instructions to advertise official ClickHouse Agent Skills by Copilot · Pull Request #193 · ClickHouse/mcp-clickhouse · GitHub
[go: up one dir, main page]

Skip to content

Use FastMCP instructions to advertise official ClickHouse Agent Skills - #193

Merged
peter-leonov-ch merged 11 commits into
mainfrom
copilot/add-clickhouse-skills-tool
Jun 9, 2026
Merged

peter-leonov-ch merged 11 commits into
mainfrom
copilot/add-clickhouse-skills-tool

Conversation

Copilot AI commented Jun 5, 2026 •
Copy link
Copy Markdown
Contributor

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 — replaced CLICKHOUSE_SKILLS_ADVISORY with CLICKHOUSE_SERVER_INSTRUCTIONS, a static (offline, no network fetch) instruction snapshot with skills guidance and install command.
  • mcp_server.py — removed clickhouse_skills_advisor() and its unconditional tool registration; wired CLICKHOUSE_SERVER_INSTRUCTIONS into FastMCP(..., instructions=...).
  • __init__.py — removed export of clickhouse_skills_advisor.
  • tests/test_skills_advisor.py — updated coverage to verify:
    • server instructions are configured,
    • install guidance text is present.
  • 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:

self.assertIn("skills add clickhouse/agent-skills", mcp.instructions)

@CLAassistant
CLAassistant commented Jun 5, 2026 •
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ peter-leonov-ch
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title Add clickhouse_skills_advisor tool advertising the official ClickHouse Agent Skills Add clickhouse_skills_advisor tool advertising official ClickHouse Agent Skills Jun 8, 2026
Copilot AI requested a review from peter-leonov-ch June 8, 2026 18:57
@peter-leonov-ch
peter-leonov-ch marked this pull request as ready for review June 8, 2026 19:01
@peter-leonov-ch
peter-leonov-ch requested a review from Copilot June 9, 2026 11:48
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_advisor unconditionally 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.

Comment thread mcp_clickhouse/skills_advisor.py Resolved
Comment thread mcp_clickhouse/mcp_server.py Resolved
Comment thread tests/test_skills_advisor.py Resolved
peter-leonov-ch and others added 2 commits June 9, 2026 14:22
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>
@joe-clickhouse
Copy link
Copy Markdown
Collaborator

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 instructions=. So something like:

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.

@peter-leonov-ch
Copy link
Copy Markdown
Contributor

@copilot address the review comments

Copilot AI commented Jun 9, 2026
Copy link
Copy Markdown
Contributor Author

@copilot address the review comments

Addressed in commit 3bfe6a7. I switched from the clickhouse_skills_advisor tool to FastMCP instructions=, removed the tool/export, and updated tests and README to validate/document the instruction-based guidance.

Copilot AI changed the title Add clickhouse_skills_advisor tool advertising official ClickHouse Agent Skills Use FastMCP instructions to advertise official ClickHouse Agent Skills Jun 9, 2026
@peter-leonov-ch
Copy link
Copy Markdown
Contributor

@joe-clickhouse done, pls re-review.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread tests/test_skills_advisor.py Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@joe-clickhouse
Copy link
Copy Markdown
Collaborator

@copilot can you drop the test_skills_advisor_tool_not_registered test and then update the changelog with a short concise note.

Copilot AI commented Jun 9, 2026
Copy link
Copy Markdown
Contributor Author

@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 test_skills_advisor_tool_not_registered from tests/test_skills_advisor.py and added a concise changelog entry under ## Unreleased in CHANGELOG.md.

@joe-clickhouse joe-clickhouse left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

Copilot AI requested a review from joe-clickhouse June 9, 2026 16:42
@peter-leonov-ch
peter-leonov-ch merged commit ccef141 into main Jun 9, 2026
2 checks passed
@peter-leonov-ch
peter-leonov-ch deleted the copilot/add-clickhouse-skills-tool branch June 9, 2026 17:37
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.

5 participants

0