Skip to content

feat: MCP efficiency profiles and token-aware recommendations #72

Closed as not planned

Description

@admarble

Summary

Add efficiency profiles for MCP integrations so users can balance thoroughness vs. token cost based on their project type and preferences.

Background

Sequant supports three optional MCP servers that enhance workflows:

MCP Token Cost Setup Cost Best For
Chrome DevTools Low (text snapshots) High (browser extension) UI-heavy projects
Context7 Medium (doc fetches) Low (one command) Projects using fast-moving libraries
Sequential Thinking High (extended chains) Low (one command) Complex architectural decisions

Currently, all three are "optional" but we don't provide guidance on:

  1. Which MCPs make sense for different project types
  2. Token efficiency trade-offs
  3. When to skip MCPs entirely for simple tasks

Proposed Solution

1. Efficiency Profiles

Add a --profile flag to sequant run:

sequant run 123 --profile=minimal    # No MCPs, fastest, lowest cost
sequant run 123 --profile=balanced   # Context7 only (most bang for buck)
sequant run 123 --profile=thorough   # All available MCPs
sequant run 123                      # Auto-detect based on project + issue

Profile definitions:

Profile MCPs Used Best For
minimal None Simple fixes, docs changes, CLI tools
balanced Context7 Most development work
thorough All configured Complex features, UI work, architectural changes
auto (default) Smart detection Adapts per-issue

2. Smart Auto-Detection

When --profile is not specified, auto-detect based on:

Project-level signals:

  • Has app/ or pages/ directory → likely needs Chrome DevTools
  • Has package.json with many dependencies → likely benefits from Context7
  • Is CLI tool (no UI directories) → skip Chrome DevTools

Issue-level signals:

  • Labels: ui, frontend, admin → enable Chrome DevTools
  • Labels: complex, refactor, architecture → enable Sequential Thinking
  • Labels: bug, fix, hotfix → use minimal profile
  • Mentions specific libraries in issue body → enable Context7

3. Settings Configuration

Add to .sequant/settings.json:

{
  "run": {
    "mcpProfile": "auto",
    "mcpOverrides": {
      "chrome-devtools": "always",
      "context7": "auto",
      "sequential-thinking": "never"
    }
  }
}

4. Enhanced Doctor Output

Improve sequant doctor to show recommendations:

MCP Recommendations for this project:
  ✓ chrome-devtools: Recommended (app/ directory detected)
  ✓ context7: Recommended (15 npm dependencies)
  ○ sequential-thinking: Optional (enable for complex refactors)

Current status:
  ✓ chrome-devtools: Configured
  ⚠ context7: Not configured
  ⚠ sequential-thinking: Not configured

Quick install:
  npx -y @anthropic/mcp-cli add upstash/context7

5. Token Usage Tracking (Future)

Add to /reflect skill or new /stats command:

Session Token Usage:
  Base workflow: ~50K tokens
  Context7 lookups: +12K tokens (3 doc fetches)
  Sequential thinking: +25K tokens (extended reasoning)
  Chrome DevTools: +8K tokens (5 snapshots)
  Total: ~95K tokens

Recommendation: This issue could use "balanced" profile (-25K tokens)

Acceptance Criteria

Phase 1: Profile System

  • Add --profile flag to sequant run command
  • Implement minimal, balanced, thorough, auto profiles
  • Add mcpProfile setting to settings.json schema
  • Document profiles in README and mcp-integrations.md

Phase 2: Smart Detection

  • Detect project type from directory structure
  • Parse issue labels for profile hints
  • Add mcpOverrides setting for per-MCP control
  • Log which profile/MCPs are being used in run output

Phase 3: Enhanced Doctor

  • Show project-specific MCP recommendations
  • Add quick install commands for missing MCPs
  • Show which profiles would use which MCPs

Phase 4: Token Awareness (Optional/Future)

  • Track MCP-related token usage during runs
  • Add efficiency recommendations to /reflect output
  • Show cost comparison between profiles

Implementation Notes

Skills that need updates:

  • /fullsolve - Currently uses all three MCPs, should respect profile
  • /exec - Uses Context7, should respect profile
  • /test, /testgen, /loop - Use Chrome DevTools, should respect profile

Graceful degradation:

  • If profile requests an MCP that isn't configured, log warning and continue
  • Never fail a run due to missing optional MCP

User communication:

  • Show active profile at start of sequant run
  • Log when MCPs are skipped due to profile settings

Questions to Resolve

  1. Should profiles be issue-specific or session-wide?
  2. Should we track actual token usage or estimate based on MCP calls?
  3. Should auto profile lean toward efficiency or thoroughness by default?

Related

  • Current MCP docs: docs/mcp-integrations.md
  • MCP definitions: src/lib/system.ts
  • Doctor command: src/commands/doctor.ts

This issue was created based on discussion about efficiency trade-offs in the original execute-issues script that inspired Sequant.

Activity

  1. admarble commented on Jan 21, 2026

    @admarble
    ContributorAuthor

    Closing as won't fix.

    Rationale:

    • Existing auto-detection via labels + /spec workflow already provides intelligent phase selection
    • MCPs already have graceful degradation (skills work without them)
    • Token tracking (Phase 4) isn't feasible with current SDK limitations
    • 4-phase implementation scope is heavy for marginal user value

    The current system adapts well to different issue types through label detection and spec recommendations. If explicit MCP control becomes a real user need, we can revisit with a simpler approach (e.g., a single --minimal flag).

  2. added
    wontfix
    on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions