Skip to content

feat: dynamic command generation from MCP tools/list - #5

Merged
nictuku merged 1 commit into
mainfrom
nictuku/real-commands
Mar 26, 2026
Merged

nictuku merged 1 commit into
mainfrom
nictuku/real-commands

Conversation

@nictuku

@nictuku nictuku commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds pipeboard refresh command that fetches tool definitions from all Pipeboard MCP servers (google-ads-mcp, meta-ads-mcp) and caches them locally at ~/.pipeboard/tools-cache.json
  • On startup, loads the cache and auto-generates Cobra subcommands: pipeboard google-ads <tool> and pipeboard meta-ads <tool> with typed flags derived from each tool JSON Schema
  • Tool names are mapped to CLI-friendly kebab-case (e.g. get_google_ads_campaigns -> pipeboard google-ads get-campaigns), required flags are enforced, and enum values are shown in help text

Test plan

  • make build && make test && make lint pass
  • Unit tests for tool name conversion, flag generation, union types, and schema parsing
  • pipeboard refresh with valid auth token populates cache
  • pipeboard google-ads --help lists all generated subcommands
  • pipeboard google-ads get-campaigns --customer-id <id> calls the MCP server and returns formatted JSON
  • Required flags produce clear error messages when missing

Auto-generate CLI commands from cached MCP tool definitions so every
Pipeboard tool is available as `pipeboard <platform> <command> --flags`.

- `pipeboard refresh` fetches tools from all MCP servers and caches to
  ~/.pipeboard/tools-cache.json
- On startup, loads cache and registers Cobra subcommands per platform
  (google-ads, meta-ads) with per-tool subcommands
- Tool name mapping: strips platform prefix, converts to kebab-case
  (e.g. get_google_ads_campaigns → get-campaigns)
- JSON Schema inputSchema → typed CLI flags with descriptions, enum
  hints, and required enforcement
- MCP text content is extracted and pretty-printed as JSON
@nictuku
nictuku merged commit 708f076 into main Mar 26, 2026
2 checks passed
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