Skip to content

Commit 2dea0f1

Browse files
committed
refactor(server): remove unused resource handlers for cleaner code
1 parent 6617daa commit 2dea0f1

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/code_index_mcp/server.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
from .services.index_management_service import IndexManagementService
3232
from .services.code_intelligence_service import CodeIntelligenceService
3333
from .services.system_management_service import SystemManagementService
34-
from .utils import (
35-
handle_mcp_resource_errors, handle_mcp_tool_errors
36-
)
34+
from .utils import handle_mcp_tool_errors
3735

3836
# Setup logging without writing to files
3937
def setup_indexing_performance_logging():
@@ -126,25 +124,6 @@ async def indexer_lifespan(_server: FastMCP) -> AsyncIterator[CodeIndexerContext
126124
# Create the MCP server with lifespan manager
127125
mcp = FastMCP("CodeIndexer", lifespan=indexer_lifespan, dependencies=["pathlib"])
128126

129-
# ----- RESOURCES -----
130-
131-
@mcp.resource("config://code-indexer")
132-
@handle_mcp_resource_errors
133-
def get_config(ctx: Context) -> str:
134-
"""Get the current configuration of the Code Indexer."""
135-
return ProjectManagementService(ctx).get_project_config()
136-
137-
@mcp.resource("files://{file_path}")
138-
@handle_mcp_resource_errors
139-
def get_file_content(file_path: str, ctx: Context) -> str:
140-
"""Get the content of a specific file."""
141-
# Use FileService for simple file reading - this is appropriate for a resource
142-
return FileService(ctx).get_file_content(file_path)
143-
144-
# Removed: structure://project resource - not necessary for most workflows
145-
# Removed: settings://stats resource - this information is available via get_settings_info() tool
146-
# and is more of a debugging/technical detail rather than context AI needs
147-
148127
# ----- TOOLS -----
149128

150129
@mcp.tool()

0 commit comments

Comments
 (0)