Skip to content

MCP server and tool handlers should be split into smaller focused modules #3382

Description

@Widthdom

Found while dogfooding the current source with cdidx symbols and hotspots.

src/CodeIndex/Mcp/McpServer.cs and src/CodeIndex/Mcp/McpToolHandlers.cs remain large, high-reference files. McpToolHandlers.cs is around 5k lines, and the main server file is around 4k lines.

This makes it harder to audit request dispatch, cancellation, error sanitization, indexing, and tool-specific behavior independently.

Expected: split MCP request loop, dispatch/cancellation, error/log formatting, and individual tool handlers into narrower modules with focused tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions