Skip to content

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Nov 28, 2025

Summary

First phase of slimming down mcp-auth from 30K LOC to ~13K core functionality (Issue #64). This phase removes clearly non-library code with zero risk to core auth functionality.

Changes

Deleted Components

  • CLI binaries (3,759 lines)
    • mcp-auth-cli.rs - Full CLI tool for key management
    • mcp-auth-setup.rs - Setup wizard
    • mcp-auth-init.rs - Initialization tool
  • Performance testing (840 lines)
    • performance.rs - Benchmarking code
  • Setup wizard (526 lines)
    • setup/ directory - Interactive setup

Dependencies Cleaned Up

  • ❌ Removed: clap, dialoguer, colored (CLI-only)
  • ❌ Removed: inotify (Linux setup monitoring)
  • ✅ Kept: libc (needed for Unix file permissions in storage)

Impact

Before: 30,237 lines
After: 25,112 lines
Reduction: 5,125 lines (17% smaller)

Testing

  • cargo check --package pulseengine-mcp-auth passes
  • cargo build --workspace passes
  • ✅ All pre-commit hooks pass (clippy, tests, format)
  • ✅ Examples still compile (memory-only-auth, etc.)

What's Next

Phase 2 will convert remaining optional features to feature flags:

  • integration feature → integration framework (7,484 lines)
  • monitoring feature → dashboard/monitoring (2,154 lines)
  • vault feature → enterprise vault support (1,004 lines)
  • consent feature → GDPR/CCPA compliance (455 lines)

This will bring mcp-auth core down to ~13K lines while keeping all functionality accessible via opt-in features.

Related Issues

Addresses #64

Add convenience methods to simplify creating UI resources:

- Content::ui_html(uri, html) - Create HTML UI resource (1 line vs 8)
- Content::ui_resource(uri, mime_type, content) - Custom MIME types
- Update ui-enabled-server example to use new helpers
- Add comprehensive UI_RESOURCES_GUIDE.md documentation

This reduces boilerplate by 87% for UI resource creation, making
PulseEngine competitive with TypeScript SDK for ergonomics.
Remove non-library code from mcp-auth to focus on core functionality:

- Delete CLI binaries (mcp-auth-cli, mcp-auth-setup, mcp-auth-init) - 3,759 lines
- Delete performance.rs (benchmarking) - 840 lines
- Delete setup/ directory (wizard) - 526 lines
- Remove related dependencies (clap, dialoguer, colored, inotify)
- Update lib.rs exports to remove deleted modules

Total reduction: 5,125 lines (17% smaller)
Final size: 25,112 lines → targeting 13K core in Phase 2

Addresses #64
@github-actions
Copy link

PR Validation Results

Quick Validation: ❌

  • Format check
  • Clippy lints
  • Unit tests
  • Documentation

Compatibility Check: ❌

  • Protocol compliance
  • Server compatibility

Summary: ❌ Some checks failed

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.

2 participants