Skip to content

feat(mcp-cli): add tools command listing stdio tool descriptors - #4225

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/mcp-cli-tools-list
Jul 8, 2026
Merged

feat(mcp-cli): add tools command listing stdio tool descriptors#4225
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/mcp-cli-tools-list

Conversation

@jsdevninja

Copy link
Copy Markdown
Contributor

Summary

  • Add gittensory-mcp tools [--json] so contributors can list every local stdio MCP tool name + one-line description without starting --stdio and speaking MCP.
  • Refactor stdio tool descriptors into STDIO_TOOL_DESCRIPTORS as the single source of truth used by both server.registerTool and the new command (behavior unchanged).
  • Wire tools into CLI_COMMAND_SPEC (shell completion), printHelp(), and the package README; assert CLI tool count/descriptions match the live registered stdio tools.

Closes #2233.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • MCP-package-only change under packages/gittensory-mcp/** + test/unit/mcp-cli-*.test.ts (Codecov ignores packages/** and test/**). Ran focused MCP CLI tests (mcp-cli-tools, mcp-cli-basics) and npm run build:mcp after rebasing onto current main. Remaining full-gate jobs left to CI path filters / validate.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — CLI/MCP packaging change only; no visible UI.

Notes

@jsdevninja
jsdevninja requested a review from JSONbored as a code owner July 8, 2026 15:23
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 8, 2026
@loopover-orb

loopover-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-08 15:35:00 UTC

4 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR refactors the 31 hardcoded stdio tool description strings into a single STDIO_TOOL_DESCRIPTORS array consumed by both server.registerTool and a new `gittensory-mcp tools [--json]` CLI command, and wires the new command into shell completion, --help, and the README. The refactor is mechanical and low-risk: stdioToolDescription() throws immediately at module load if a registerTool call references a name missing from the array, and the added test asserts the CLI's tool list has the same count, names, and description text as the live MCP-registered tools (via listTools()), which also catches an array entry that isn't registered anywhere. It closes the linked issue #2233 directly, is narrowly scoped to the MCP CLI package, and CI is green.

Nits — 5 non-blocking
  • gittensory-mcp.js:352-491 — STDIO_TOOL_DESCRIPTORS duplicates 31 tool names as a literal array that must stay hand-in-sync with each registerTool call; nothing enforces this at the definition site itself (only the runtime throw catches a missing entry, and the test catches an unregistered extra) — consider generating the CLI listing from the registerTool calls' returned metadata instead of a parallel list, though I recognize that's a bigger structural change than this PR's scope.
  • toolsCommand() (gittensory-mcp.js:2164) lists tools in declaration order rather than sorted alphabetically — worth sorting for a more scannable `tools` output, similar to how `completion` lists commands.
  • The file is now ~2325 lines (flagged by size heuristics); this PR isn't the place to split it, but it's worth a follow-up to move STDIO_TOOL_DESCRIPTORS + toolsCommand into a separate module now that they're decoupled from individual registerTool call sites.
  • Consider deriving `tools --json` output directly from the McpServer's registered tool metadata (if the SDK exposes it) rather than maintaining STDIO_TOOL_DESCRIPTORS as a hand-kept parallel list, to close the last gap where the two could drift without a test catching it until CI runs.
  • Sort STDIO_TOOL_DESCRIPTORS or the toolsCommand() output alphabetically by name for readability.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2233
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 223 registered-repo PR(s), 138 merged, 39 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jsdevninja; Gittensor profile; 223 PR(s), 39 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The diff refactors all stdio tool descriptions into a single STDIO_TOOL_DESCRIPTORS array used by both server.registerTool and a new toolsCommand, adds the `tools` command with --json wired into CLI_COMMAND_SPEC and printHelp, and adds a CLI test that compares the tools output count/descriptions against the live registered stdio tools. All four listed deliverables are visibly implemented in the di

Review context
  • Author: jsdevninja
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Swift, C, CSS, MDX, Python, Vue
  • Official Gittensor activity: 223 PR(s), 39 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.76%. Comparing base (07207a7) to head (3b8d341).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4225   +/-   ##
=======================================
  Coverage   93.76%   93.76%           
=======================================
  Files         390      390           
  Lines       36553    36553           
  Branches    13389    13389           
=======================================
  Hits        34274    34274           
  Misses       1623     1623           
  Partials      656      656           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot 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.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 54dc362 into JSONbored:main Jul 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp-cli): add a gittensory-mcp tools command that lists every stdio tool + description

1 participant