1717from .common import normalize_file_path
1818from .git_query import get_current_commit_hash
1919from .tools .chmod import chmod
20- from .tools .edit_file import edit_file_content
21- from .tools .glob import glob_files
22- from .tools .grep import grep_files
20+ from .tools .edit_file import edit_file
21+ from .tools .glob import glob
22+ from .tools .grep import grep
2323from .tools .init_project import init_project
24- from .tools .ls import ls_directory
25- from .tools .mv import mv_file
26- from .tools .read_file import read_file_content
27- from .tools .rm import rm_file
24+ from .tools .ls import ls
25+ from .tools .mv import mv
26+ from .tools .read_file import read_file
27+ from .tools .rm import rm
2828from .tools .run_command import run_command
2929from .tools .think import think
30- from .tools .write_file import write_file_content
30+ from .tools .write_file import write_file
3131
3232# Initialize FastMCP server
3333mcp = FastMCP ("codemcp" )
@@ -182,7 +182,7 @@ async def codemcp(
182182 if path is None :
183183 raise ValueError ("path is required for ReadFile subtool" )
184184
185- result = await read_file_content (path , offset , limit , chat_id , commit_hash )
185+ result = await read_file (path , offset , limit , chat_id , commit_hash )
186186 return result
187187
188188 if subtool == "WriteFile" :
@@ -193,9 +193,7 @@ async def codemcp(
193193 if chat_id is None :
194194 raise ValueError ("chat_id is required for WriteFile subtool" )
195195
196- result = await write_file_content (
197- path , content , description , chat_id , commit_hash
198- )
196+ result = await write_file (path , content , description , chat_id , commit_hash )
199197 return result
200198
201199 if subtool == "EditFile" :
@@ -216,16 +214,14 @@ async def codemcp(
216214 # Accept either new_string or new_str (prefer new_string if both are provided)
217215 new_content = new_string or new_str
218216
219- result = await edit_file_content (
220- path , old_content , new_content , None , description , chat_id , commit_hash
221- )
217+ result = await edit_file (path , old_content , new_content , None , description , chat_id , commit_hash )
222218 return result
223219
224220 if subtool == "LS" :
225221 if path is None :
226222 raise ValueError ("path is required for LS subtool" )
227223
228- result = await ls_directory (path , chat_id , commit_hash )
224+ result = await ls (path , chat_id , commit_hash )
229225 return result
230226
231227 if subtool == "InitProject" :
@@ -267,9 +263,7 @@ async def codemcp(
267263 raise ValueError ("path is required for Grep subtool" )
268264
269265 try :
270- result_string = await grep_files (
271- pattern , path , include , chat_id , commit_hash
272- )
266+ result_string = await grep (pattern , path , include , chat_id , commit_hash )
273267 return result_string
274268 except Exception as e :
275269 logging .error (f"Error in Grep subtool: { e } " , exc_info = True )
@@ -282,9 +276,7 @@ async def codemcp(
282276 raise ValueError ("path is required for Glob subtool" )
283277
284278 try :
285- result_string = await glob_files (
286- pattern , path , limit , offset , chat_id , commit_hash
287- )
279+ result_string = await glob (pattern , path , limit , offset , chat_id , commit_hash )
288280 return result_string
289281 except Exception as e :
290282 logging .error (f"Error in Glob subtool: { e } " , exc_info = True )
@@ -298,7 +290,7 @@ async def codemcp(
298290 if chat_id is None :
299291 raise ValueError ("chat_id is required for RM subtool" )
300292
301- result = await rm_file (path , description , chat_id , commit_hash )
293+ result = await rm (path , description , chat_id , commit_hash )
302294 return result
303295
304296 if subtool == "MV" :
@@ -315,9 +307,7 @@ async def codemcp(
315307 if chat_id is None :
316308 raise ValueError ("chat_id is required for MV subtool" )
317309
318- result = await mv_file (
319- source_path , target_path , description , chat_id , commit_hash
320- )
310+ result = await mv (source_path , target_path , description , chat_id , commit_hash )
321311 return result
322312
323313 if subtool == "Think" :
0 commit comments