feat(mcp): expose Tencent tools over MCP#182
Merged
Merged
Conversation
Adds cmd/mcp_tencent.go, which registers ten Tencent tools on the shared MCP server, and wires registerTencentMCPTools into newClankerMCPServer. Each tool delegates to clanker-api's existing HTTP surface (/api/v1/tencent/* and /api/v1/maker/*) behind bearer auth rather than calling the Tencent SDK directly, so the MCP layer introduces no new Tencent credentials or provider code of its own — every endpoint it calls already ships in internal/api. Tools: list, scan (the ten security audits), metrics, expiry, cost, vouchers, topology, audit_history, maker_plan, maker_apply.
rafeegnash
approved these changes
Jun 1, 2026
Collaborator
rafeegnash
left a comment
There was a problem hiding this comment.
Thanks for this — really well thought out. A few things stood out:
- The architectural choice to delegate to clanker-api over HTTP instead of duplicating the Tencent SDK into the MCP layer is the right call. One set of creds in
.env, and every future endpoint becomes a one-function MCP exposure here. - I verified every endpoint you call against
internal/api/routes.go— all 27 land on real handlers (including the ten scan kinds, the two metric products, the three voucher paths, expiry, topology, and the three maker routes). - The schema work is more thorough than what's already in the tree. The footnote about
mcp.WithInputSchema[T]()reflecting empty schemas in this version of mark3labs/mcp-go is a useful catch — it tells us the existing Vercel/Fly/Railway/Verda tools (and the Sentry ones we just landed) probably need the same treatment in a follow-up. - The write-tool gating on
clanker_tencent_maker_applyis layered exactly the way it should be: hint annotations for MCP-aware clients, explicit policy in the description so the LLM sees it, requiredhuman_approved=trueschema gate, and a server-side backstop refusal. Combined with the existingdestroyer=truevalidator that's a solid four-layer guard.
CI is green across both Go 1.23 and 1.24 builds. Squash-merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an MCP (Model Context Protocol) surface for the Tencent Cloud provider, so the Tencent inventory/scan/cost/maker capabilities already in the tree are reachable from MCP clients — not just the CLI.
cmd/mcp_tencent.goregisters ten Tencent tools on the shared MCP server.registerTencentMCPTools(server)innewClankerMCPServer()(cmd/mcp.go).Design
Each tool delegates to clanker-api's existing HTTP surface behind bearer auth rather than calling the Tencent SDK directly:
/api/v1/tencent/*— resources, the ten security scans, metrics, cost, vouchers, topology, expiry/api/v1/maker/*— plan / apply / historySo the MCP layer introduces no new Tencent credentials and no new provider code — every endpoint it calls already ships in
internal/api. Adding a future tool is a one-function addition.Tools:
list,scan(the ten security audits),metrics,expiry,cost,vouchers,topology,audit_history,maker_plan,maker_apply. The write tools (maker_apply) require explicithuman_approved=true.Test plan
go build ./...againstmaster(Docker,golang:1.25,-mod=mod)go vet ./cmd/...gofmt -s -lcleanclanker mcp+ clanker-api, exercise a read tool (clanker_tencent_list) and confirm it returns the same JSON asGET /api/v1/tencent/resources/{type}