feat(mcp): expose Tencent tools over MCP#182
Open
rephapeng wants to merge 1 commit into
Open
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.
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}