@@ -79,8 +79,8 @@ async def ingest_repository(
79
79
return response_content
80
80
81
81
except Exception as e :
82
- logger .error ( f "Error during ingestion: { e } " , exc_info = True )
83
- return f "Error ingesting repository: { e !s } "
82
+ logger .exception ( "Error during ingestion: %s " , e )
83
+ return "Error ingesting repository: An internal error occurred "
84
84
85
85
86
86
async def start_mcp_server_tcp (host : str = "0.0.0.0" , port : int = 8001 ):
@@ -142,7 +142,10 @@ async def handle_message(message: dict):
142
142
"tools" : [
143
143
{
144
144
"name" : "ingest_repository" ,
145
- "description" : "Ingest a Git repository or local directory and return a structured digest for LLMs" ,
145
+ "description" : (
146
+ "Ingest a Git repository or local directory "
147
+ "and return a structured digest for LLMs"
148
+ ),
146
149
"inputSchema" : {
147
150
"type" : "object" ,
148
151
"properties" : {
@@ -181,13 +184,14 @@ async def handle_message(message: dict):
181
184
},
182
185
)
183
186
except Exception as e :
187
+ logger .exception ("Tool execution failed: %s" , e )
184
188
return JSONResponse (
185
189
{
186
190
"jsonrpc" : "2.0" ,
187
191
"id" : message .get ("id" ),
188
192
"error" : {
189
193
"code" : - 32603 ,
190
- "message" : f "Tool execution failed: { e !s } " ,
194
+ "message" : "Tool execution failed" ,
191
195
},
192
196
},
193
197
)
@@ -217,14 +221,14 @@ async def handle_message(message: dict):
217
221
)
218
222
219
223
except Exception as e :
220
- logger .error ( f "Error handling MCP message: { e } " , exc_info = True )
224
+ logger .exception ( "Error handling MCP message: %s " , e )
221
225
return JSONResponse (
222
226
{
223
227
"jsonrpc" : "2.0" ,
224
228
"id" : message .get ("id" ) if "message" in locals () else None ,
225
229
"error" : {
226
230
"code" : - 32603 ,
227
- "message" : f "Internal error: { e !s } " ,
231
+ "message" : "Internal server error " ,
228
232
},
229
233
},
230
234
)
0 commit comments