@@ -226,7 +226,7 @@ def find_function(node):
226226 func_node = find_function (tree .root_node )
227227
228228 if not func_node :
229- return {"error" : f"Function '{ function_name } ' not found in { file_path } " }
229+ return {"error" : f"Function '{ function_name } ' not found in { path_or_url } " }
230230
231231 # Extract the function code
232232 source_bytes = source .encode ('utf-8' ) if isinstance (source , str ) else source
@@ -327,7 +327,7 @@ def find_class(node):
327327 class_node = find_class (tree .root_node )
328328
329329 if not class_node :
330- return {"error" : f"Class '{ class_name } ' not found in { file_path } " }
330+ return {"error" : f"Class '{ class_name } ' not found in { path_or_url } " }
331331
332332 # Extract the class code
333333 source_bytes = source .encode ('utf-8' ) if isinstance (source , str ) else source
@@ -437,6 +437,23 @@ def get_signature(path_or_url: str, function_name: str, git_revision: Optional[s
437437
438438def main ():
439439 """Main entry point for the MCP server."""
440+ import argparse
441+ import sys
442+
443+ # Parse command line arguments
444+ parser = argparse .ArgumentParser (
445+ description = "MCP Server Code Extractor - Precise code extraction using tree-sitter" ,
446+ prog = "mcp-server-code-extractor"
447+ )
448+ parser .add_argument (
449+ "--version" ,
450+ action = "version" ,
451+ version = "mcp-server-code-extractor 0.2.3"
452+ )
453+
454+ # Parse args but ignore them for MCP server mode
455+ args = parser .parse_args ()
456+
440457 # Initialize FastMCP server
441458 mcp = FastMCP ("extract" )
442459
0 commit comments