VibecoderMcSwaggins commited on
Commit
f9cb2b7
Β·
1 Parent(s): cde8f48

docs: address CodeRabbit feedback for Phase 12 PR

Browse files

- Add `text` fence language to architecture diagrams (MD040)
- Update roadmap directory structure (remove websearch, add clinicaltrials/biorxiv)
- Mark Phase 12 as COMPLETE in roadmap
- Rename test_mcp_server.py to test_mcp_tools_live.py for clarity
- Update hackathon requirements with MCP implementation status
- Fix async pattern in Modal integration doc

docs/implementation/12_phase_mcp_server.md CHANGED
@@ -23,7 +23,7 @@
23
 
24
  ### What MCP Enables
25
 
26
- ```
27
  Current State:
28
  Our Tools β†’ Called directly by Python code β†’ Only our app can use them
29
 
@@ -105,12 +105,12 @@ async def search_pubmed(query: str, max_results: int = 10) -> str:
105
  ### 3.3 MCP Server URL
106
 
107
  Once launched:
108
- ```
109
  http://localhost:7860/gradio_api/mcp/
110
  ```
111
 
112
  Or on HuggingFace Spaces:
113
- ```
114
  https://[space-id].hf.space/gradio_api/mcp/
115
  ```
116
 
@@ -806,7 +806,7 @@ Phase 12 is **COMPLETE** when:
806
 
807
  ## 12. Architecture After Phase 12
808
 
809
- ```
810
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
811
  β”‚ Claude Desktop / Cursor β”‚
812
  β”‚ (MCP Client) β”‚
 
23
 
24
  ### What MCP Enables
25
 
26
+ ```text
27
  Current State:
28
  Our Tools β†’ Called directly by Python code β†’ Only our app can use them
29
 
 
105
  ### 3.3 MCP Server URL
106
 
107
  Once launched:
108
+ ```text
109
  http://localhost:7860/gradio_api/mcp/
110
  ```
111
 
112
  Or on HuggingFace Spaces:
113
+ ```text
114
  https://[space-id].hf.space/gradio_api/mcp/
115
  ```
116
 
 
806
 
807
  ## 12. Architecture After Phase 12
808
 
809
+ ```text
810
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
811
  β”‚ Claude Desktop / Cursor β”‚
812
  β”‚ (MCP Client) β”‚
docs/implementation/roadmap.md CHANGED
@@ -41,7 +41,9 @@ src/
41
  β”œβ”€β”€ tools/ # Search tools
42
  β”‚ β”œβ”€β”€ __init__.py
43
  β”‚ β”œβ”€β”€ pubmed.py # PubMed E-utilities tool
44
- β”‚ β”œβ”€β”€ websearch.py # DuckDuckGo search tool
 
 
45
  β”‚ └── search_handler.py # Orchestrates multiple tools
46
  β”œβ”€β”€ prompts/ # Prompt templates
47
  β”‚ β”œβ”€β”€ __init__.py
@@ -61,7 +63,8 @@ tests/
61
  β”œβ”€β”€ unit/
62
  β”‚ β”œβ”€β”€ tools/
63
  β”‚ β”‚ β”œβ”€β”€ test_pubmed.py
64
- β”‚ β”‚ β”œβ”€β”€ test_websearch.py
 
65
  β”‚ β”‚ └── test_search_handler.py
66
  β”‚ β”œβ”€β”€ agent_factory/
67
  β”‚ β”‚ └── test_judges.py
@@ -202,7 +205,7 @@ Structured Research Report
202
 
203
  ### Hackathon Integration (Phases 12-14)
204
 
205
- 12. **[Phase 12 Spec: MCP Server](12_phase_mcp_server.md)** πŸ“ P0 - REQUIRED
206
  13. **[Phase 13 Spec: Modal Pipeline](13_phase_modal_integration.md)** πŸ“ P1 - $2,500
207
  14. **[Phase 14 Spec: Demo & Submission](14_phase_demo_submission.md)** πŸ“ P0 - REQUIRED
208
 
@@ -223,11 +226,11 @@ Structured Research Report
223
  | Phase 9: Source Cleanup | βœ… COMPLETE | Remove DuckDuckGo |
224
  | Phase 10: ClinicalTrials | βœ… COMPLETE | ClinicalTrials.gov API |
225
  | Phase 11: bioRxiv | βœ… COMPLETE | Preprint search |
226
- | Phase 12: MCP Server | πŸ“ SPEC READY | MCP protocol integration |
227
  | Phase 13: Modal Pipeline | πŸ“ SPEC READY | Sandboxed code execution |
228
  | Phase 14: Demo & Submit | πŸ“ SPEC READY | Hackathon submission |
229
 
230
- *Phases 1-11 COMPLETE. Phases 12-14 for hackathon compliance.*
231
 
232
  ---
233
 
 
41
  β”œβ”€β”€ tools/ # Search tools
42
  β”‚ β”œβ”€β”€ __init__.py
43
  β”‚ β”œβ”€β”€ pubmed.py # PubMed E-utilities tool
44
+ β”‚ β”œβ”€β”€ clinicaltrials.py # ClinicalTrials.gov API
45
+ β”‚ β”œβ”€β”€ biorxiv.py # bioRxiv/medRxiv preprints
46
+ β”‚ β”œβ”€β”€ code_execution.py # Modal sandbox execution
47
  β”‚ └── search_handler.py # Orchestrates multiple tools
48
  β”œβ”€β”€ prompts/ # Prompt templates
49
  β”‚ β”œβ”€β”€ __init__.py
 
63
  β”œβ”€β”€ unit/
64
  β”‚ β”œβ”€β”€ tools/
65
  β”‚ β”‚ β”œβ”€β”€ test_pubmed.py
66
+ β”‚ β”‚ β”œβ”€β”€ test_clinicaltrials.py
67
+ β”‚ β”‚ β”œβ”€β”€ test_biorxiv.py
68
  β”‚ β”‚ └── test_search_handler.py
69
  β”‚ β”œβ”€β”€ agent_factory/
70
  β”‚ β”‚ └── test_judges.py
 
205
 
206
  ### Hackathon Integration (Phases 12-14)
207
 
208
+ 12. **[Phase 12 Spec: MCP Server](12_phase_mcp_server.md)** βœ… COMPLETE
209
  13. **[Phase 13 Spec: Modal Pipeline](13_phase_modal_integration.md)** πŸ“ P1 - $2,500
210
  14. **[Phase 14 Spec: Demo & Submission](14_phase_demo_submission.md)** πŸ“ P0 - REQUIRED
211
 
 
226
  | Phase 9: Source Cleanup | βœ… COMPLETE | Remove DuckDuckGo |
227
  | Phase 10: ClinicalTrials | βœ… COMPLETE | ClinicalTrials.gov API |
228
  | Phase 11: bioRxiv | βœ… COMPLETE | Preprint search |
229
+ | Phase 12: MCP Server | βœ… COMPLETE | MCP protocol integration |
230
  | Phase 13: Modal Pipeline | πŸ“ SPEC READY | Sandboxed code execution |
231
  | Phase 14: Demo & Submit | πŸ“ SPEC READY | Hackathon submission |
232
 
233
+ *Phases 1-12 COMPLETE. Phases 13-14 for hackathon prizes.*
234
 
235
  ---
236
 
docs/pending/01_hackathon_requirements.md CHANGED
@@ -1,5 +1,7 @@
1
  # MCP's 1st Birthday Hackathon - Requirements Analysis
2
 
 
 
3
  ## Deadline: November 30, 2025 11:59 PM UTC
4
 
5
  ---
@@ -21,7 +23,7 @@ tags:
21
  | Requirement | DeepCritical Status | Action Needed |
22
  |-------------|---------------------|---------------|
23
  | Autonomous Agent behavior | βœ… Have it | Search-Judge-Synthesize loop |
24
- | Must use MCP servers as tools | ❌ **MISSING** | Add MCP server wrapper |
25
  | Must be a Gradio app | βœ… Have it | `src/app.py` |
26
  | Planning, reasoning, execution | βœ… Have it | Orchestrator + Judge |
27
  | Context Engineering / RAG | βœ… Have it | LlamaIndex + ChromaDB |
 
1
  # MCP's 1st Birthday Hackathon - Requirements Analysis
2
 
3
+ > **βœ… MCP Server implemented in Phase 12** - Track 2 compliant
4
+
5
  ## Deadline: November 30, 2025 11:59 PM UTC
6
 
7
  ---
 
23
  | Requirement | DeepCritical Status | Action Needed |
24
  |-------------|---------------------|---------------|
25
  | Autonomous Agent behavior | βœ… Have it | Search-Judge-Synthesize loop |
26
+ | Must use MCP servers as tools | βœ… **DONE** | `src/mcp_tools.py` |
27
  | Must be a Gradio app | βœ… Have it | `src/app.py` |
28
  | Planning, reasoning, execution | βœ… Have it | Orchestrator + Judge |
29
  | Context Engineering / RAG | βœ… Have it | LlamaIndex + ChromaDB |
docs/pending/03_modal_integration.md CHANGED
@@ -49,22 +49,24 @@ import numpy as np
49
 
50
  ### Step 1: Wire Into Agent Pipeline
51
 
52
- Add a `StatisticalAnalysisAgent` that uses Modal:
53
 
54
  ```python
55
- # src/agents/analysis_agent.py
 
56
  from src.tools.code_execution import get_code_executor
57
 
58
- class AnalysisAgent:
59
  """Run statistical analysis on evidence using Modal sandbox."""
60
 
61
  async def analyze(self, evidence: list[Evidence], query: str) -> str:
62
  # 1. LLM generates analysis code
63
  code = await self._generate_analysis_code(evidence, query)
64
 
65
- # 2. Execute in Modal sandbox
66
  executor = get_code_executor()
67
- result = executor.execute(code)
 
68
 
69
  # 3. Return results
70
  return result["stdout"]
 
49
 
50
  ### Step 1: Wire Into Agent Pipeline
51
 
52
+ Add a `StatisticalAnalyzer` service that uses Modal:
53
 
54
  ```python
55
+ # src/services/statistical_analyzer.py
56
+ import asyncio
57
  from src.tools.code_execution import get_code_executor
58
 
59
+ class StatisticalAnalyzer:
60
  """Run statistical analysis on evidence using Modal sandbox."""
61
 
62
  async def analyze(self, evidence: list[Evidence], query: str) -> str:
63
  # 1. LLM generates analysis code
64
  code = await self._generate_analysis_code(evidence, query)
65
 
66
+ # 2. Execute in Modal sandbox (run sync executor in thread pool)
67
  executor = get_code_executor()
68
+ loop = asyncio.get_event_loop()
69
+ result = await loop.run_in_executor(None, executor.execute, code)
70
 
71
  # 3. Return results
72
  return result["stdout"]
tests/integration/{test_mcp_server.py β†’ test_mcp_tools_live.py} RENAMED
@@ -1,10 +1,10 @@
1
- """Integration tests for MCP server functionality."""
2
 
3
  import pytest
4
 
5
 
6
- class TestMCPServerIntegration:
7
- """Integration tests for MCP server (requires running app)."""
8
 
9
  @pytest.mark.integration
10
  @pytest.mark.asyncio
 
1
+ """Integration tests for MCP tool wrappers with live API calls."""
2
 
3
  import pytest
4
 
5
 
6
+ class TestMCPToolsLive:
7
+ """Integration tests for MCP tools against live APIs (PubMed, etc.)."""
8
 
9
  @pytest.mark.integration
10
  @pytest.mark.asyncio