stravinsky 0.2.40__py3-none-any.whl → 0.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_bridge/__init__.py +1 -1
- mcp_bridge/auth/token_refresh.py +130 -0
- mcp_bridge/cli/__init__.py +6 -0
- mcp_bridge/cli/install_hooks.py +1265 -0
- mcp_bridge/cli/session_report.py +585 -0
- mcp_bridge/hooks/HOOKS_SETTINGS.json +175 -0
- mcp_bridge/hooks/README.md +215 -0
- mcp_bridge/hooks/__init__.py +119 -43
- mcp_bridge/hooks/edit_recovery.py +42 -37
- mcp_bridge/hooks/git_noninteractive.py +89 -0
- mcp_bridge/hooks/keyword_detector.py +30 -0
- mcp_bridge/hooks/manager.py +50 -0
- mcp_bridge/hooks/notification_hook.py +103 -0
- mcp_bridge/hooks/parallel_enforcer.py +127 -0
- mcp_bridge/hooks/parallel_execution.py +111 -0
- mcp_bridge/hooks/pre_compact.py +123 -0
- mcp_bridge/hooks/preemptive_compaction.py +81 -7
- mcp_bridge/hooks/rules_injector.py +507 -0
- mcp_bridge/hooks/session_idle.py +116 -0
- mcp_bridge/hooks/session_notifier.py +125 -0
- mcp_bridge/{native_hooks → hooks}/stravinsky_mode.py +51 -16
- mcp_bridge/hooks/subagent_stop.py +98 -0
- mcp_bridge/hooks/task_validator.py +73 -0
- mcp_bridge/hooks/tmux_manager.py +141 -0
- mcp_bridge/hooks/todo_continuation.py +90 -0
- mcp_bridge/hooks/todo_delegation.py +88 -0
- mcp_bridge/hooks/tool_messaging.py +164 -0
- mcp_bridge/hooks/truncator.py +21 -17
- mcp_bridge/notifications.py +151 -0
- mcp_bridge/prompts/__init__.py +3 -1
- mcp_bridge/prompts/dewey.py +30 -20
- mcp_bridge/prompts/explore.py +46 -8
- mcp_bridge/prompts/multimodal.py +24 -3
- mcp_bridge/prompts/planner.py +222 -0
- mcp_bridge/prompts/stravinsky.py +107 -28
- mcp_bridge/server.py +170 -10
- mcp_bridge/server_tools.py +554 -32
- mcp_bridge/tools/agent_manager.py +316 -106
- mcp_bridge/tools/background_tasks.py +2 -1
- mcp_bridge/tools/code_search.py +97 -11
- mcp_bridge/tools/lsp/__init__.py +7 -0
- mcp_bridge/tools/lsp/manager.py +448 -0
- mcp_bridge/tools/lsp/tools.py +637 -150
- mcp_bridge/tools/model_invoke.py +270 -47
- mcp_bridge/tools/semantic_search.py +2492 -0
- mcp_bridge/tools/templates.py +32 -18
- stravinsky-0.3.4.dist-info/METADATA +420 -0
- stravinsky-0.3.4.dist-info/RECORD +79 -0
- stravinsky-0.3.4.dist-info/entry_points.txt +5 -0
- mcp_bridge/native_hooks/edit_recovery.py +0 -46
- mcp_bridge/native_hooks/truncator.py +0 -23
- stravinsky-0.2.40.dist-info/METADATA +0 -204
- stravinsky-0.2.40.dist-info/RECORD +0 -57
- stravinsky-0.2.40.dist-info/entry_points.txt +0 -3
- /mcp_bridge/{native_hooks → hooks}/context.py +0 -0
- {stravinsky-0.2.40.dist-info → stravinsky-0.3.4.dist-info}/WHEEL +0 -0
mcp_bridge/server_tools.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from mcp.types import Tool, Prompt
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
def get_tool_definitions() -> List[Tool]:
|
|
5
6
|
"""Return all Tool definitions for the Stravinsky MCP server."""
|
|
6
7
|
return [
|
|
@@ -37,8 +38,8 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
37
38
|
},
|
|
38
39
|
"model": {
|
|
39
40
|
"type": "string",
|
|
40
|
-
"description": "Gemini model to use (default: gemini-
|
|
41
|
-
"default": "gemini-
|
|
41
|
+
"description": "Gemini model to use (default: gemini-3-flash)",
|
|
42
|
+
"default": "gemini-3-flash",
|
|
42
43
|
},
|
|
43
44
|
"temperature": {
|
|
44
45
|
"type": "number",
|
|
@@ -55,6 +56,24 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
55
56
|
"description": "Tokens reserved for internal reasoning (if model supports it)",
|
|
56
57
|
"default": 0,
|
|
57
58
|
},
|
|
59
|
+
"agent_context": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Optional agent metadata for logging (agent_type, task_id, description)",
|
|
62
|
+
"properties": {
|
|
63
|
+
"agent_type": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Type of agent (explore, delphi, frontend, etc.)",
|
|
66
|
+
},
|
|
67
|
+
"task_id": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Background task ID if running as agent",
|
|
70
|
+
},
|
|
71
|
+
"description": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Short description of what the agent is doing",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
58
77
|
},
|
|
59
78
|
"required": ["prompt"],
|
|
60
79
|
},
|
|
@@ -76,8 +95,8 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
76
95
|
},
|
|
77
96
|
"model": {
|
|
78
97
|
"type": "string",
|
|
79
|
-
"description": "OpenAI model to use (default: gpt-
|
|
80
|
-
"default": "gpt-
|
|
98
|
+
"description": "OpenAI model to use (default: gpt-5.2-codex)",
|
|
99
|
+
"default": "gpt-5.2-codex",
|
|
81
100
|
},
|
|
82
101
|
"temperature": {
|
|
83
102
|
"type": "number",
|
|
@@ -94,6 +113,24 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
94
113
|
"description": "Tokens reserved for internal reasoning (e.g. o1 / o3)",
|
|
95
114
|
"default": 0,
|
|
96
115
|
},
|
|
116
|
+
"agent_context": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"description": "Optional agent metadata for logging (agent_type, task_id, description)",
|
|
119
|
+
"properties": {
|
|
120
|
+
"agent_type": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "Type of agent (explore, delphi, frontend, etc.)",
|
|
123
|
+
},
|
|
124
|
+
"task_id": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "Background task ID if running as agent",
|
|
127
|
+
},
|
|
128
|
+
"description": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Short description of what the agent is doing",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
97
134
|
},
|
|
98
135
|
"required": ["prompt"],
|
|
99
136
|
},
|
|
@@ -123,7 +160,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
123
160
|
"type": "object",
|
|
124
161
|
"properties": {
|
|
125
162
|
"file_path": {"type": "string", "description": "Path to file to analyze"},
|
|
126
|
-
"severity": {
|
|
163
|
+
"severity": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"description": "Filter: error, warning, all",
|
|
166
|
+
"default": "all",
|
|
167
|
+
},
|
|
127
168
|
},
|
|
128
169
|
"required": ["file_path"],
|
|
129
170
|
},
|
|
@@ -135,7 +176,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
135
176
|
"type": "object",
|
|
136
177
|
"properties": {
|
|
137
178
|
"pattern": {"type": "string", "description": "ast-grep pattern"},
|
|
138
|
-
"directory": {
|
|
179
|
+
"directory": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"description": "Directory to search",
|
|
182
|
+
"default": ".",
|
|
183
|
+
},
|
|
139
184
|
"language": {"type": "string", "description": "Filter by language"},
|
|
140
185
|
},
|
|
141
186
|
"required": ["pattern"],
|
|
@@ -148,7 +193,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
148
193
|
"type": "object",
|
|
149
194
|
"properties": {
|
|
150
195
|
"pattern": {"type": "string", "description": "Search pattern (regex)"},
|
|
151
|
-
"directory": {
|
|
196
|
+
"directory": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"description": "Directory to search",
|
|
199
|
+
"default": ".",
|
|
200
|
+
},
|
|
152
201
|
"file_pattern": {"type": "string", "description": "Glob filter (e.g. *.py)"},
|
|
153
202
|
},
|
|
154
203
|
"required": ["pattern"],
|
|
@@ -161,7 +210,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
161
210
|
"type": "object",
|
|
162
211
|
"properties": {
|
|
163
212
|
"pattern": {"type": "string", "description": "Glob pattern (e.g. **/*.py)"},
|
|
164
|
-
"directory": {
|
|
213
|
+
"directory": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"description": "Base directory",
|
|
216
|
+
"default": ".",
|
|
217
|
+
},
|
|
165
218
|
},
|
|
166
219
|
"required": ["pattern"],
|
|
167
220
|
},
|
|
@@ -233,11 +286,14 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
233
286
|
inputSchema={
|
|
234
287
|
"type": "object",
|
|
235
288
|
"properties": {
|
|
236
|
-
"prompt": {
|
|
289
|
+
"prompt": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"description": "The prompt for the background agent",
|
|
292
|
+
},
|
|
237
293
|
"model": {
|
|
238
|
-
"type": "string",
|
|
294
|
+
"type": "string",
|
|
239
295
|
"description": "Model to use (gemini-3-flash or gpt-4o)",
|
|
240
|
-
"default": "gemini-3-flash"
|
|
296
|
+
"default": "gemini-3-flash",
|
|
241
297
|
},
|
|
242
298
|
},
|
|
243
299
|
"required": ["prompt"],
|
|
@@ -273,13 +329,19 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
273
329
|
inputSchema={
|
|
274
330
|
"type": "object",
|
|
275
331
|
"properties": {
|
|
276
|
-
"prompt": {
|
|
332
|
+
"prompt": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"description": "The task for the agent to perform",
|
|
335
|
+
},
|
|
277
336
|
"agent_type": {
|
|
278
337
|
"type": "string",
|
|
279
338
|
"description": "Agent type: explore, dewey, frontend (gemini-3-pro), delphi (gpt-5.2-medium), document_writer, multimodal",
|
|
280
339
|
"default": "explore",
|
|
281
340
|
},
|
|
282
|
-
"description": {
|
|
341
|
+
"description": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "Short description for status display",
|
|
344
|
+
},
|
|
283
345
|
"model": {
|
|
284
346
|
"type": "string",
|
|
285
347
|
"description": "Model: gemini-3-flash (default) or claude",
|
|
@@ -295,6 +357,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
295
357
|
"description": "Maximum execution time in seconds",
|
|
296
358
|
"default": 300,
|
|
297
359
|
},
|
|
360
|
+
"blocking": {
|
|
361
|
+
"type": "boolean",
|
|
362
|
+
"description": "If true, wait for agent completion and return result directly. Recommended for delphi consultations.",
|
|
363
|
+
"default": False,
|
|
364
|
+
},
|
|
298
365
|
},
|
|
299
366
|
"required": ["prompt"],
|
|
300
367
|
},
|
|
@@ -306,8 +373,14 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
306
373
|
"type": "object",
|
|
307
374
|
"properties": {
|
|
308
375
|
"task_id": {"type": "string", "description": "The ID of the task to retry"},
|
|
309
|
-
"new_prompt": {
|
|
310
|
-
|
|
376
|
+
"new_prompt": {
|
|
377
|
+
"type": "string",
|
|
378
|
+
"description": "Optional refined prompt for the retry",
|
|
379
|
+
},
|
|
380
|
+
"new_timeout": {
|
|
381
|
+
"type": "integer",
|
|
382
|
+
"description": "Optional new timeout in seconds",
|
|
383
|
+
},
|
|
311
384
|
},
|
|
312
385
|
"required": ["task_id"],
|
|
313
386
|
},
|
|
@@ -319,7 +392,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
319
392
|
"type": "object",
|
|
320
393
|
"properties": {
|
|
321
394
|
"task_id": {"type": "string", "description": "The agent task ID"},
|
|
322
|
-
"block": {
|
|
395
|
+
"block": {
|
|
396
|
+
"type": "boolean",
|
|
397
|
+
"description": "Wait for completion",
|
|
398
|
+
"default": False,
|
|
399
|
+
},
|
|
323
400
|
},
|
|
324
401
|
"required": ["task_id"],
|
|
325
402
|
},
|
|
@@ -350,7 +427,11 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
350
427
|
"type": "object",
|
|
351
428
|
"properties": {
|
|
352
429
|
"task_id": {"type": "string", "description": "The agent task ID"},
|
|
353
|
-
"lines": {
|
|
430
|
+
"lines": {
|
|
431
|
+
"type": "integer",
|
|
432
|
+
"description": "Number of recent lines to show",
|
|
433
|
+
"default": 20,
|
|
434
|
+
},
|
|
354
435
|
},
|
|
355
436
|
"required": ["task_id"],
|
|
356
437
|
},
|
|
@@ -363,7 +444,10 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
363
444
|
"properties": {
|
|
364
445
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
365
446
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
366
|
-
"character": {
|
|
447
|
+
"character": {
|
|
448
|
+
"type": "integer",
|
|
449
|
+
"description": "Character position (0-indexed)",
|
|
450
|
+
},
|
|
367
451
|
},
|
|
368
452
|
"required": ["file_path", "line", "character"],
|
|
369
453
|
},
|
|
@@ -376,7 +460,10 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
376
460
|
"properties": {
|
|
377
461
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
378
462
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
379
|
-
"character": {
|
|
463
|
+
"character": {
|
|
464
|
+
"type": "integer",
|
|
465
|
+
"description": "Character position (0-indexed)",
|
|
466
|
+
},
|
|
380
467
|
},
|
|
381
468
|
"required": ["file_path", "line", "character"],
|
|
382
469
|
},
|
|
@@ -389,8 +476,15 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
389
476
|
"properties": {
|
|
390
477
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
391
478
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
392
|
-
"character": {
|
|
393
|
-
|
|
479
|
+
"character": {
|
|
480
|
+
"type": "integer",
|
|
481
|
+
"description": "Character position (0-indexed)",
|
|
482
|
+
},
|
|
483
|
+
"include_declaration": {
|
|
484
|
+
"type": "boolean",
|
|
485
|
+
"description": "Include the declaration itself",
|
|
486
|
+
"default": True,
|
|
487
|
+
},
|
|
394
488
|
},
|
|
395
489
|
"required": ["file_path", "line", "character"],
|
|
396
490
|
},
|
|
@@ -412,8 +506,15 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
412
506
|
inputSchema={
|
|
413
507
|
"type": "object",
|
|
414
508
|
"properties": {
|
|
415
|
-
"query": {
|
|
416
|
-
|
|
509
|
+
"query": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"description": "Symbol name to search for (fuzzy match)",
|
|
512
|
+
},
|
|
513
|
+
"directory": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"description": "Workspace directory",
|
|
516
|
+
"default": ".",
|
|
517
|
+
},
|
|
417
518
|
},
|
|
418
519
|
"required": ["query"],
|
|
419
520
|
},
|
|
@@ -426,7 +527,10 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
426
527
|
"properties": {
|
|
427
528
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
428
529
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
429
|
-
"character": {
|
|
530
|
+
"character": {
|
|
531
|
+
"type": "integer",
|
|
532
|
+
"description": "Character position (0-indexed)",
|
|
533
|
+
},
|
|
430
534
|
},
|
|
431
535
|
"required": ["file_path", "line", "character"],
|
|
432
536
|
},
|
|
@@ -439,9 +543,16 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
439
543
|
"properties": {
|
|
440
544
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
441
545
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
442
|
-
"character": {
|
|
546
|
+
"character": {
|
|
547
|
+
"type": "integer",
|
|
548
|
+
"description": "Character position (0-indexed)",
|
|
549
|
+
},
|
|
443
550
|
"new_name": {"type": "string", "description": "New name for the symbol"},
|
|
444
|
-
"dry_run": {
|
|
551
|
+
"dry_run": {
|
|
552
|
+
"type": "boolean",
|
|
553
|
+
"description": "Preview changes without applying",
|
|
554
|
+
"default": True,
|
|
555
|
+
},
|
|
445
556
|
},
|
|
446
557
|
"required": ["file_path", "line", "character", "new_name"],
|
|
447
558
|
},
|
|
@@ -454,11 +565,63 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
454
565
|
"properties": {
|
|
455
566
|
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
456
567
|
"line": {"type": "integer", "description": "Line number (1-indexed)"},
|
|
457
|
-
"character": {
|
|
568
|
+
"character": {
|
|
569
|
+
"type": "integer",
|
|
570
|
+
"description": "Character position (0-indexed)",
|
|
571
|
+
},
|
|
458
572
|
},
|
|
459
573
|
"required": ["file_path", "line", "character"],
|
|
460
574
|
},
|
|
461
575
|
),
|
|
576
|
+
Tool(
|
|
577
|
+
name="lsp_code_action_resolve",
|
|
578
|
+
description="Apply a specific code action/fix to a file (e.g., fix F401 unused import).",
|
|
579
|
+
inputSchema={
|
|
580
|
+
"type": "object",
|
|
581
|
+
"properties": {
|
|
582
|
+
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
583
|
+
"action_code": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"description": "Code action ID to apply (e.g., 'F401', 'E501' for Python)",
|
|
586
|
+
},
|
|
587
|
+
"line": {
|
|
588
|
+
"type": "integer",
|
|
589
|
+
"description": "Optional line number filter (1-indexed)",
|
|
590
|
+
},
|
|
591
|
+
},
|
|
592
|
+
"required": ["file_path", "action_code"],
|
|
593
|
+
},
|
|
594
|
+
),
|
|
595
|
+
Tool(
|
|
596
|
+
name="lsp_extract_refactor",
|
|
597
|
+
description="Extract code to a function or variable (Python via jedi).",
|
|
598
|
+
inputSchema={
|
|
599
|
+
"type": "object",
|
|
600
|
+
"properties": {
|
|
601
|
+
"file_path": {"type": "string", "description": "Absolute path to the file"},
|
|
602
|
+
"start_line": {"type": "integer", "description": "Start line (1-indexed)"},
|
|
603
|
+
"start_char": {"type": "integer", "description": "Start character (0-indexed)"},
|
|
604
|
+
"end_line": {"type": "integer", "description": "End line (1-indexed)"},
|
|
605
|
+
"end_char": {"type": "integer", "description": "End character (0-indexed)"},
|
|
606
|
+
"new_name": {
|
|
607
|
+
"type": "string",
|
|
608
|
+
"description": "Name for extracted function/variable",
|
|
609
|
+
},
|
|
610
|
+
"kind": {
|
|
611
|
+
"type": "string",
|
|
612
|
+
"description": "'function' or 'variable' (default: function)",
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
"required": [
|
|
616
|
+
"file_path",
|
|
617
|
+
"start_line",
|
|
618
|
+
"start_char",
|
|
619
|
+
"end_line",
|
|
620
|
+
"end_char",
|
|
621
|
+
"new_name",
|
|
622
|
+
],
|
|
623
|
+
},
|
|
624
|
+
),
|
|
462
625
|
Tool(
|
|
463
626
|
name="lsp_servers",
|
|
464
627
|
description="List available LSP servers and their installation status.",
|
|
@@ -473,17 +636,376 @@ def get_tool_definitions() -> List[Tool]:
|
|
|
473
636
|
inputSchema={
|
|
474
637
|
"type": "object",
|
|
475
638
|
"properties": {
|
|
476
|
-
"pattern": {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"
|
|
639
|
+
"pattern": {
|
|
640
|
+
"type": "string",
|
|
641
|
+
"description": "ast-grep pattern to search (e.g., 'console.log($A)')",
|
|
642
|
+
},
|
|
643
|
+
"replacement": {
|
|
644
|
+
"type": "string",
|
|
645
|
+
"description": "Replacement pattern (e.g., 'logger.debug($A)')",
|
|
646
|
+
},
|
|
647
|
+
"directory": {
|
|
648
|
+
"type": "string",
|
|
649
|
+
"description": "Directory to search in",
|
|
650
|
+
"default": ".",
|
|
651
|
+
},
|
|
652
|
+
"language": {
|
|
653
|
+
"type": "string",
|
|
654
|
+
"description": "Filter by language (typescript, python, etc.)",
|
|
655
|
+
},
|
|
656
|
+
"dry_run": {
|
|
657
|
+
"type": "boolean",
|
|
658
|
+
"description": "Preview changes without applying",
|
|
659
|
+
"default": True,
|
|
660
|
+
},
|
|
481
661
|
},
|
|
482
662
|
"required": ["pattern", "replacement"],
|
|
483
663
|
},
|
|
484
664
|
),
|
|
665
|
+
# --- SEMANTIC SEARCH ---
|
|
666
|
+
Tool(
|
|
667
|
+
name="semantic_search",
|
|
668
|
+
description=(
|
|
669
|
+
"Search codebase using natural language queries. Uses vector embeddings to find "
|
|
670
|
+
"semantically related code even without exact pattern matches. "
|
|
671
|
+
"Supports filtering by language and node type. "
|
|
672
|
+
"Example: 'find authentication logic' or 'error handling patterns'."
|
|
673
|
+
),
|
|
674
|
+
inputSchema={
|
|
675
|
+
"type": "object",
|
|
676
|
+
"properties": {
|
|
677
|
+
"query": {
|
|
678
|
+
"type": "string",
|
|
679
|
+
"description": "Natural language search query (e.g., 'find authentication logic')",
|
|
680
|
+
},
|
|
681
|
+
"project_path": {
|
|
682
|
+
"type": "string",
|
|
683
|
+
"description": "Path to the project root",
|
|
684
|
+
"default": ".",
|
|
685
|
+
},
|
|
686
|
+
"n_results": {
|
|
687
|
+
"type": "integer",
|
|
688
|
+
"description": "Maximum number of results to return",
|
|
689
|
+
"default": 10,
|
|
690
|
+
},
|
|
691
|
+
"language": {
|
|
692
|
+
"type": "string",
|
|
693
|
+
"description": "Filter by language (e.g., 'py', 'ts', 'js')",
|
|
694
|
+
},
|
|
695
|
+
"node_type": {
|
|
696
|
+
"type": "string",
|
|
697
|
+
"description": "Filter by node type (e.g., 'function', 'class', 'method')",
|
|
698
|
+
},
|
|
699
|
+
"provider": {
|
|
700
|
+
"type": "string",
|
|
701
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
702
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
703
|
+
"default": "ollama",
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
"required": ["query"],
|
|
707
|
+
},
|
|
708
|
+
),
|
|
709
|
+
Tool(
|
|
710
|
+
name="hybrid_search",
|
|
711
|
+
description=(
|
|
712
|
+
"Hybrid search combining semantic similarity with structural AST matching. "
|
|
713
|
+
"Use when you need both natural language understanding AND structural patterns. "
|
|
714
|
+
"Example: query='find authentication logic' + pattern='def $FUNC($$$):'"
|
|
715
|
+
),
|
|
716
|
+
inputSchema={
|
|
717
|
+
"type": "object",
|
|
718
|
+
"properties": {
|
|
719
|
+
"query": {
|
|
720
|
+
"type": "string",
|
|
721
|
+
"description": "Natural language search query",
|
|
722
|
+
},
|
|
723
|
+
"pattern": {
|
|
724
|
+
"type": "string",
|
|
725
|
+
"description": "ast-grep pattern for structural matching (optional)",
|
|
726
|
+
},
|
|
727
|
+
"project_path": {
|
|
728
|
+
"type": "string",
|
|
729
|
+
"description": "Path to the project root",
|
|
730
|
+
"default": ".",
|
|
731
|
+
},
|
|
732
|
+
"n_results": {
|
|
733
|
+
"type": "integer",
|
|
734
|
+
"description": "Maximum number of results to return",
|
|
735
|
+
"default": 10,
|
|
736
|
+
},
|
|
737
|
+
"language": {
|
|
738
|
+
"type": "string",
|
|
739
|
+
"description": "Filter by language (e.g., 'py', 'ts', 'js')",
|
|
740
|
+
},
|
|
741
|
+
"node_type": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"description": "Filter by node type (e.g., 'function', 'class', 'method')",
|
|
744
|
+
},
|
|
745
|
+
"decorator": {
|
|
746
|
+
"type": "string",
|
|
747
|
+
"description": "Filter by decorator (e.g., '@property', '@staticmethod')",
|
|
748
|
+
},
|
|
749
|
+
"is_async": {
|
|
750
|
+
"type": "boolean",
|
|
751
|
+
"description": "Filter by async status (True = async only, False = sync only)",
|
|
752
|
+
},
|
|
753
|
+
"base_class": {
|
|
754
|
+
"type": "string",
|
|
755
|
+
"description": "Filter by base class (e.g., 'BaseClass')",
|
|
756
|
+
},
|
|
757
|
+
"provider": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
760
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
761
|
+
"default": "ollama",
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
"required": ["query"],
|
|
765
|
+
},
|
|
766
|
+
),
|
|
767
|
+
Tool(
|
|
768
|
+
name="semantic_index",
|
|
769
|
+
description=(
|
|
770
|
+
"Index a codebase for semantic search. Creates vector embeddings for all code files. "
|
|
771
|
+
"Run this before using semantic_search on a new project."
|
|
772
|
+
),
|
|
773
|
+
inputSchema={
|
|
774
|
+
"type": "object",
|
|
775
|
+
"properties": {
|
|
776
|
+
"project_path": {
|
|
777
|
+
"type": "string",
|
|
778
|
+
"description": "Path to the project root",
|
|
779
|
+
"default": ".",
|
|
780
|
+
},
|
|
781
|
+
"force": {
|
|
782
|
+
"type": "boolean",
|
|
783
|
+
"description": "If true, reindex everything. Otherwise, only new/changed files.",
|
|
784
|
+
"default": False,
|
|
785
|
+
},
|
|
786
|
+
"provider": {
|
|
787
|
+
"type": "string",
|
|
788
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
789
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
790
|
+
"default": "ollama",
|
|
791
|
+
},
|
|
792
|
+
},
|
|
793
|
+
},
|
|
794
|
+
),
|
|
795
|
+
Tool(
|
|
796
|
+
name="semantic_stats",
|
|
797
|
+
description="Get statistics about the semantic search index for a project.",
|
|
798
|
+
inputSchema={
|
|
799
|
+
"type": "object",
|
|
800
|
+
"properties": {
|
|
801
|
+
"project_path": {
|
|
802
|
+
"type": "string",
|
|
803
|
+
"description": "Path to the project root",
|
|
804
|
+
"default": ".",
|
|
805
|
+
},
|
|
806
|
+
"provider": {
|
|
807
|
+
"type": "string",
|
|
808
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
809
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
810
|
+
"default": "ollama",
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
},
|
|
814
|
+
),
|
|
815
|
+
Tool(
|
|
816
|
+
name="start_file_watcher",
|
|
817
|
+
description=(
|
|
818
|
+
"Start automatic background reindexing when code files change. "
|
|
819
|
+
"Watches for .py file changes and triggers semantic_index automatically. "
|
|
820
|
+
"Run semantic_index() first before starting the watcher."
|
|
821
|
+
),
|
|
822
|
+
inputSchema={
|
|
823
|
+
"type": "object",
|
|
824
|
+
"properties": {
|
|
825
|
+
"project_path": {
|
|
826
|
+
"type": "string",
|
|
827
|
+
"description": "Path to the project root",
|
|
828
|
+
"default": ".",
|
|
829
|
+
},
|
|
830
|
+
"provider": {
|
|
831
|
+
"type": "string",
|
|
832
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
833
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
834
|
+
"default": "ollama",
|
|
835
|
+
},
|
|
836
|
+
"debounce_seconds": {
|
|
837
|
+
"type": "number",
|
|
838
|
+
"description": "Wait time after file changes before reindexing (default: 2.0)",
|
|
839
|
+
"default": 2.0,
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
),
|
|
844
|
+
Tool(
|
|
845
|
+
name="stop_file_watcher",
|
|
846
|
+
description="Stop the file watcher for a project.",
|
|
847
|
+
inputSchema={
|
|
848
|
+
"type": "object",
|
|
849
|
+
"properties": {
|
|
850
|
+
"project_path": {
|
|
851
|
+
"type": "string",
|
|
852
|
+
"description": "Path to the project root",
|
|
853
|
+
"default": ".",
|
|
854
|
+
},
|
|
855
|
+
},
|
|
856
|
+
},
|
|
857
|
+
),
|
|
858
|
+
Tool(
|
|
859
|
+
name="list_file_watchers",
|
|
860
|
+
description="List all active file watchers across all projects.",
|
|
861
|
+
inputSchema={
|
|
862
|
+
"type": "object",
|
|
863
|
+
"properties": {},
|
|
864
|
+
},
|
|
865
|
+
),
|
|
866
|
+
Tool(
|
|
867
|
+
name="multi_query_search",
|
|
868
|
+
description=(
|
|
869
|
+
"Search with LLM-expanded query variations for better recall. "
|
|
870
|
+
"Rephrases query into multiple semantic variations (e.g., 'database connection' -> "
|
|
871
|
+
"['SQLAlchemy engine setup', 'postgres connection', 'db session factory']) "
|
|
872
|
+
"and aggregates results using reciprocal rank fusion."
|
|
873
|
+
),
|
|
874
|
+
inputSchema={
|
|
875
|
+
"type": "object",
|
|
876
|
+
"properties": {
|
|
877
|
+
"query": {
|
|
878
|
+
"type": "string",
|
|
879
|
+
"description": "Natural language search query",
|
|
880
|
+
},
|
|
881
|
+
"project_path": {
|
|
882
|
+
"type": "string",
|
|
883
|
+
"description": "Path to the project root",
|
|
884
|
+
"default": ".",
|
|
885
|
+
},
|
|
886
|
+
"n_results": {
|
|
887
|
+
"type": "integer",
|
|
888
|
+
"description": "Maximum number of results to return",
|
|
889
|
+
"default": 10,
|
|
890
|
+
},
|
|
891
|
+
"num_expansions": {
|
|
892
|
+
"type": "integer",
|
|
893
|
+
"description": "Number of query variations to generate",
|
|
894
|
+
"default": 3,
|
|
895
|
+
},
|
|
896
|
+
"language": {
|
|
897
|
+
"type": "string",
|
|
898
|
+
"description": "Filter by language (e.g., 'py', 'ts')",
|
|
899
|
+
},
|
|
900
|
+
"node_type": {
|
|
901
|
+
"type": "string",
|
|
902
|
+
"description": "Filter by node type (e.g., 'function', 'class')",
|
|
903
|
+
},
|
|
904
|
+
"provider": {
|
|
905
|
+
"type": "string",
|
|
906
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
907
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
908
|
+
"default": "ollama",
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
"required": ["query"],
|
|
912
|
+
},
|
|
913
|
+
),
|
|
914
|
+
Tool(
|
|
915
|
+
name="decomposed_search",
|
|
916
|
+
description=(
|
|
917
|
+
"Search by decomposing complex queries into focused sub-questions. "
|
|
918
|
+
"Breaks multi-part queries like 'Initialize the DB and create a user model' "
|
|
919
|
+
"into separate searches ('database initialization', 'user model definition') "
|
|
920
|
+
"and returns organized results for each part."
|
|
921
|
+
),
|
|
922
|
+
inputSchema={
|
|
923
|
+
"type": "object",
|
|
924
|
+
"properties": {
|
|
925
|
+
"query": {
|
|
926
|
+
"type": "string",
|
|
927
|
+
"description": "Complex search query (may contain multiple concepts)",
|
|
928
|
+
},
|
|
929
|
+
"project_path": {
|
|
930
|
+
"type": "string",
|
|
931
|
+
"description": "Path to the project root",
|
|
932
|
+
"default": ".",
|
|
933
|
+
},
|
|
934
|
+
"n_results": {
|
|
935
|
+
"type": "integer",
|
|
936
|
+
"description": "Maximum results per sub-query",
|
|
937
|
+
"default": 10,
|
|
938
|
+
},
|
|
939
|
+
"language": {
|
|
940
|
+
"type": "string",
|
|
941
|
+
"description": "Filter by language",
|
|
942
|
+
},
|
|
943
|
+
"node_type": {
|
|
944
|
+
"type": "string",
|
|
945
|
+
"description": "Filter by node type",
|
|
946
|
+
},
|
|
947
|
+
"provider": {
|
|
948
|
+
"type": "string",
|
|
949
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
950
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
951
|
+
"default": "ollama",
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
"required": ["query"],
|
|
955
|
+
},
|
|
956
|
+
),
|
|
957
|
+
Tool(
|
|
958
|
+
name="enhanced_search",
|
|
959
|
+
description=(
|
|
960
|
+
"Unified enhanced search combining query expansion and decomposition. "
|
|
961
|
+
"Automatically selects strategy based on query complexity: "
|
|
962
|
+
"simple queries use multi-query expansion, complex queries use decomposition. "
|
|
963
|
+
"Use mode='auto' (default), 'expand', 'decompose', or 'both'."
|
|
964
|
+
),
|
|
965
|
+
inputSchema={
|
|
966
|
+
"type": "object",
|
|
967
|
+
"properties": {
|
|
968
|
+
"query": {
|
|
969
|
+
"type": "string",
|
|
970
|
+
"description": "Search query (simple or complex)",
|
|
971
|
+
},
|
|
972
|
+
"project_path": {
|
|
973
|
+
"type": "string",
|
|
974
|
+
"description": "Path to the project root",
|
|
975
|
+
"default": ".",
|
|
976
|
+
},
|
|
977
|
+
"n_results": {
|
|
978
|
+
"type": "integer",
|
|
979
|
+
"description": "Maximum number of results",
|
|
980
|
+
"default": 10,
|
|
981
|
+
},
|
|
982
|
+
"mode": {
|
|
983
|
+
"type": "string",
|
|
984
|
+
"description": "Search mode: 'auto' (default), 'expand', 'decompose', or 'both'",
|
|
985
|
+
"enum": ["auto", "expand", "decompose", "both"],
|
|
986
|
+
"default": "auto",
|
|
987
|
+
},
|
|
988
|
+
"language": {
|
|
989
|
+
"type": "string",
|
|
990
|
+
"description": "Filter by language",
|
|
991
|
+
},
|
|
992
|
+
"node_type": {
|
|
993
|
+
"type": "string",
|
|
994
|
+
"description": "Filter by node type",
|
|
995
|
+
},
|
|
996
|
+
"provider": {
|
|
997
|
+
"type": "string",
|
|
998
|
+
"description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
|
|
999
|
+
"enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
|
|
1000
|
+
"default": "ollama",
|
|
1001
|
+
},
|
|
1002
|
+
},
|
|
1003
|
+
"required": ["query"],
|
|
1004
|
+
},
|
|
1005
|
+
),
|
|
485
1006
|
]
|
|
486
1007
|
|
|
1008
|
+
|
|
487
1009
|
def get_prompt_definitions() -> List[Prompt]:
|
|
488
1010
|
"""Return all Prompt definitions for the Stravinsky MCP server."""
|
|
489
1011
|
return [
|