Skip to content

feat(mcp): expose Tencent tools over MCP#182

Open
rephapeng wants to merge 1 commit into
bgdnvk:masterfrom
rephapeng:pr/tencent-mcp
Open

feat(mcp): expose Tencent tools over MCP#182
rephapeng wants to merge 1 commit into
bgdnvk:masterfrom
rephapeng:pr/tencent-mcp

Conversation

@rephapeng
Copy link
Copy Markdown
Contributor

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.

  • New cmd/mcp_tencent.go registers ten Tencent tools on the shared MCP server.
  • One-line wiring: registerTencentMCPTools(server) in newClankerMCPServer() (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 / history

So 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 explicit human_approved=true.

Test plan

  • go build ./... against master (Docker, golang:1.25, -mod=mod)
  • go vet ./cmd/...
  • gofmt -s -l clean
  • Manual: run clanker mcp + clanker-api, exercise a read tool (clanker_tencent_list) and confirm it returns the same JSON as GET /api/v1/tencent/resources/{type}

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

1 participant