Skip to content

P12-T1: Add MCP Client Identification#51

Merged
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T1-mcp-client-identification
Feb 15, 2026
Merged

P12-T1: Add MCP Client Identification#51
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T1-mcp-client-identification

Conversation

@SoundBlaster

Copy link
Copy Markdown
Owner

Description

Detects the MCP client identity from the initialize handshake and surfaces it in the dashboard. The clientInfo field (name, version) is extracted from the initialize request params, stored in both in-memory metrics and the SQLite shared store, and displayed in a new "Active Client" KPI card on the dashboard.

Changes:

  • schemas.py: Added MCPClientInfo, MCPInitializeParams models; added clientInfo field to MCPParams; added MCPRequest.get_client_info() method
  • __main__.py: In on_request(), capture clientInfo from initialize method; call metrics.set_client_info() (defaults to "unknown" if absent)
  • webui/metrics.py: Added set_client_info(), client_name/client_version in get_summary(), reset clears to "unknown"
  • webui/shared_metrics.py: Added client_info table (single-row upsert), set_client_info(), client fields in get_summary(), reset() clears client info
  • webui/static/index.html: Added "Active Client" KPI card (kpi-client)
  • webui/static/dashboard.js: updateKPIs() renders client_name + " " + client_version

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • CI/CD improvement

Quality Gates

  • make test - All tests pass with ≥90% coverage (413 passed, 5 skipped; 96.04% coverage)
  • make lint - No linting errors (ruff check src/ clean)
  • make format - Code is properly formatted
  • make typecheck - Type checking passes (mypy src/ clean, 13 files)
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

  • Documentation changes are synced with DocC catalog (or N/A) — no docs/ files changed

Testing

  • Added/updated tests for new functionality — 10 new tests across test_main.py, test_metrics.py, test_shared_metrics.py
  • All tests pass locally
  • Manually tested the changes

New tests cover:

  • test_main_captures_client_info_from_initialize — clientInfo extracted and forwarded to metrics
  • test_main_defaults_unknown_when_no_client_info — missing clientInfo defaults to "unknown"
  • TestMetricsCollectorClientInfo (4 tests) — set/overwrite/reset behavior in MetricsCollector
  • TestSharedMetricsStoreClientInfo (4 tests) — set/upsert/reset in SQLite SharedMetricsStore

Validation report: SPECS/ARCHIVE/P12-T1_Add_MCP_Client_Identification/P12-T1_Validation_Report.md

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated (if needed)
  • No new warnings generated
  • PR title is descriptive

@SoundBlaster SoundBlaster merged commit 1e88b60 into main Feb 15, 2026
9 checks passed
@SoundBlaster SoundBlaster deleted the feature/P12-T1-mcp-client-identification branch February 15, 2026 18:59
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