refactor: split mcp-server.ts into focused modules (ARC-7)#1706
Merged
OneStepAt4time merged 2 commits intodevelopfrom Apr 12, 2026
Merged
refactor: split mcp-server.ts into focused modules (ARC-7)#1706OneStepAt4time merged 2 commits intodevelopfrom
OneStepAt4time merged 2 commits intodevelopfrom
Conversation
Decompose the 1228-line mcp-server.ts into 9 focused modules: - mcp/client.ts (296 lines) β AegisClient REST client + response types - mcp/auth.ts (100 lines) β RBAC withAuth wrapper + role maps - mcp/resources.ts (113 lines) β 4 MCP resource handlers - mcp/tools/session-tools.ts (296 lines) β 12 session lifecycle tools - mcp/tools/monitoring-tools.ts (142 lines) β 6 observability tools - mcp/tools/pipeline-tools.ts (86 lines) β 3 batch/pipeline tools - mcp/tools/management-tools.ts (81 lines) β 3 state management tools - mcp/prompts.ts (141 lines) β 3 MCP prompt templates - mcp/server.ts (50 lines) β createMcpServer orchestrator + stdio entry mcp-server.ts becomes a 10-line re-export facade for backward compatibility. All existing consumers (cli.ts, mcp-server.test.ts) continue to work unchanged. Closes #1700
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Decompose the 1228-line \mcp-server.ts\ into 9 focused modules under \src/mcp/, each under 300 lines:
\mcp-server.ts\ becomes a 10-line re-export facade. Existing consumers (\cli.ts, \mcp-server.test.ts) unchanged.
Quality gate
px tsc --noEmit\ β
pm run build\ β
pm test\ β (159 files, 2814 tests, 0 failures)
Aegis version
Developed with: v0.3.2-alpha
Closes #1700