Skip to content

feat: display MCP servers in profile Statistics panel - #675

Merged
junhoyeo merged 2 commits into
junhoyeo:mainfrom
leecoder:feat/profile-mcp-servers
Jun 8, 2026
Merged

feat: display MCP servers in profile Statistics panel#675
junhoyeo merged 2 commits into
junhoyeo:mainfrom
leecoder:feat/profile-mcp-servers

Conversation

@leecoder

@leecoder leecoder commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Collect MCP server names from local config during CLI submit and display them as badges in the Statistics panel on user profile pages, below the existing Clients section.

Changes

CLI (Rust)

  • Add mcp module to tokscale-core that discovers MCP server names from Claude, Cursor, and OpenCode configs
  • Include mcp_servers field in the submit payload

Backend (Next.js API)

  • Add mcp_servers JSONB column to submissions table (migration 0013)
  • Parse and store MCP servers on submit (always updates column so stale data can be cleared)
  • Return mcpServers in the user profile API response

Frontend

  • Display MCPs as badges in the Statistics panel (below Clients)
  • Thread mcpServers prop through ProfileActivity → GraphContainer → StatsPanel

Misc

  • Fix leaderboard hydration issue (mounted check)
  • Fix profile Last Updated timezone to UTC

Summary by cubic

Show MCP servers on profile pages by collecting server names during CLI submit and storing them on the backend. Users see MCP badges under Clients in the Statistics panel.

  • New Features

    • CLI: Discover MCP server names (names only) from Claude (incl. Desktop on macOS), Cursor, Kiro, and OpenCode skills via new mcp module in @tokscale-core; send mcp_servers in submit payload using @tokscale-cli.
    • Backend: Add mcp_servers JSONB column on submissions; persist on submit with null-safe extraction and array sanitization; return mcpServers in profile API.
    • Frontend: Thread mcpServers through ProfileActivity → GraphContainer → StatsPanel and render MCP badges below Clients via shared BadgeList. Also fixes leaderboard hydration and sets profile “Last Updated” to UTC.
  • Migration

    • Run DB migration 0013 to add the mcp_servers column.
    • Update to the latest @tokscale-cli; existing profiles will show MCPs after the next submit.

Written for commit 875d8f8. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment Jun 5, 2026 5:37pm

Request Review

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/frontend/src/app/api/submit/route.ts Outdated
Comment thread packages/frontend/src/components/StatsPanel.tsx
leecoder and others added 2 commits June 5, 2026 10:36
- Add mcp module to tokscale-core that discovers MCP server names from Claude, Cursor, Kiro, and OpenCode configs
- Include mcp_servers field in the CLI submit payload
- Add mcp_servers JSONB column to submissions table (migration 0013)
- Parse and store MCP servers on submit with null safety guard
- Return mcpServers in the user profile API response
- Display MCPs as badges via shared BadgeList component in Statistics panel
Validation
* Validation tier: Tier 2R - post-review test-only correction for submit MCP payload coverage; no runtime files changed by this commit.
* git diff --check: PASS.
* git diff --cached --check: PASS.
* bun install --frozen-lockfile: PASS.
* bun --cwd packages/frontend test __tests__/api/submitAuth.test.ts: PASS, 12 tests.
* bun --cwd packages/frontend test: PASS, 48 test files and 392 tests.
* bun run lint __tests__/api/submitAuth.test.ts (cwd packages/frontend): PASS.
* cargo fmt --all -- --check: PASS.
* cargo test -p tokscale-core mcp: PASS, 8 tests.
* cargo test -p tokscale-core: PASS, 850 passed, 1 ignored; codebuff/hermes integration tests and doc-tests passed.
* cargo test -p tokscale-cli: PASS, unit tests 589 passed/1 ignored and cli_tests 115 passed.
* cargo test --workspace --all-features: PASS.
* /opt/homebrew/Cellar/rust/1.94.0/bin/cargo-clippy clippy --locked --workspace --all-features -- -D warnings: PASS.
* bash scripts/test-calculate-release-version.sh && bash scripts/test-check-version-coherence.sh && bash scripts/test-npm-release-state.sh && bash scripts/test-prepare-release-provenance.sh: PASS.
* bash scripts/check-version-coherence.sh: PASS, Version coherence OK: 3.0.0.
* Ledger: not applicable - not required for selected validation tier/change family.
* Version: PASS, bash scripts/check-version-coherence.sh; no version bump required for this test-only correction.
* Not run: local Frontend Migration Replay - DATABASE_URL is not set locally; mandatory GitHub Frontend Migration Replay will run on the final PR SHA.

Rollback
* git revert HEAD
@IvGolovach

Copy link
Copy Markdown
Collaborator

Thanks so much for putting this together, @leecoder. This is a useful addition because it gives profile pages more context about the local workflow behind the usage data, not just the client/model totals.

I took a careful pass over the branch, updated it against the latest main, checked the review feedback, and added regression coverage around the submit payload handling so the MCP server field is stored safely and invalid/null bodies keep returning validation errors instead of reaching the transaction path. The final SHA is green across CI now.

Since this is not only a fix but also introduces new profile metadata and a small schema addition, I’d still prefer to give @junhoyeo a chance to weigh in on the product direction. From my side, I don’t see a technical reason not to merge. Thanks again for the thoughtful contribution!

@junhoyeo junhoyeo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The new crates/tokscale-core/src/mcp.rs module collects MCP server NAMES only (no secrets, no paths, no args), BTreeSet-deduplicated, with 8 unit tests including a full integration test. Migration 0013 is sequential and clean. The submitAuth.test.ts case filtering invalid entries (["github", "", "slack", 123, null] → ["github", "slack"]) covers the validation path nicely.

@junhoyeo
junhoyeo merged commit e644f96 into junhoyeo:main Jun 8, 2026
16 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.

3 participants