deepcode-hku 1.0.1__tar.gz → 1.0.3__tar.gz
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.
- {deepcode_hku-1.0.1/deepcode_hku.egg-info → deepcode_hku-1.0.3}/PKG-INFO +35 -7
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/README.md +33 -5
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/__init__.py +1 -5
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode.py +3 -3
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3/deepcode_hku.egg-info}/PKG-INFO +35 -7
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode_hku.egg-info/SOURCES.txt +1 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/mcp_agent.config.yaml +15 -6
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/setup.py +2 -2
- deepcode_hku-1.0.3/tools/bocha_search_server.py +219 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/code_indexer.py +128 -70
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/pdf_downloader.py +133 -134
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/styles.py +394 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/agent_orchestration_engine.py +72 -21
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/codebase_index_workflow.py +1 -1
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/.pre-commit-config.yaml +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/LICENSE +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/MANIFEST.in +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/cli_app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/cli_interface.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/cli_launcher.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/main_cli.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/workflows/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/cli/workflows/cli_workflow_adapter.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode_hku.egg-info/dependency_links.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode_hku.egg-info/entry_points.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode_hku.egg-info/requires.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/deepcode_hku.egg-info/top_level.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/mcp_agent.secrets.yaml +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/prompts/code_prompts.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/requirements.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/schema/mcp-agent.config.schema.json +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/setup.cfg +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/code_implementation_server.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/code_reference_indexer.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/command_executor.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/git_command.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/pdf_converter.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/tools/pdf_utils.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/components.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/handlers.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/layout.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/ui/streamlit_app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/utils/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/utils/cli_interface.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/utils/dialogue_logger.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/utils/file_processor.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/utils/simple_llm_logger.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/agents/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/agents/code_implementation_agent.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/agents/memory_agent_concise.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/agents/memory_agent_concise_index.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/code_implementation_workflow.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.3}/workflows/code_implementation_workflow_index.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepcode-hku
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: AI Research Engine - Transform research papers into working code automatically
|
|
5
5
|
Home-page: https://github.com/HKUDS/DeepCode
|
|
6
6
|
Author: DeepCodeTeam
|
|
7
7
|
Project-URL: Documentation, https://github.com/HKUDS/DeepCode
|
|
@@ -76,7 +76,7 @@ Dynamic: summary
|
|
|
76
76
|
<p>
|
|
77
77
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
78
78
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
79
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
79
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
80
80
|
</p>
|
|
81
81
|
<p>
|
|
82
82
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -288,11 +288,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
288
288
|
|
|
289
289
|
### 🔧 **Core Techniques**
|
|
290
290
|
|
|
291
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
291
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
292
292
|
|
|
293
|
-
-
|
|
293
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
294
294
|
|
|
295
|
-
-
|
|
295
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
|
@@ -455,7 +455,7 @@ Implementation Generation • Testing • Documentation
|
|
|
455
455
|
|
|
456
456
|
```bash
|
|
457
457
|
# 🚀 Install DeepCode package directly
|
|
458
|
-
pip install deepcode
|
|
458
|
+
pip install deepcode-hku
|
|
459
459
|
|
|
460
460
|
# 🔑 Download configuration files
|
|
461
461
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -520,6 +520,34 @@ pip install -r requirements.txt
|
|
|
520
520
|
|
|
521
521
|
</details>
|
|
522
522
|
|
|
523
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
524
|
+
|
|
525
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
# 1. Install MCP servers globally
|
|
529
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
530
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
531
|
+
|
|
532
|
+
# 2. Find your global node_modules path
|
|
533
|
+
npm -g root
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
537
|
+
|
|
538
|
+
```yaml
|
|
539
|
+
mcp:
|
|
540
|
+
servers:
|
|
541
|
+
brave:
|
|
542
|
+
command: "node"
|
|
543
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
544
|
+
filesystem:
|
|
545
|
+
command: "node"
|
|
546
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
550
|
+
|
|
523
551
|
### ⚡ **Step 2: Launch Application**
|
|
524
552
|
|
|
525
553
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<p>
|
|
33
33
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
34
34
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
35
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
35
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
36
36
|
</p>
|
|
37
37
|
<p>
|
|
38
38
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -244,11 +244,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
244
244
|
|
|
245
245
|
### 🔧 **Core Techniques**
|
|
246
246
|
|
|
247
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
247
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
248
248
|
|
|
249
|
-
-
|
|
249
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
250
250
|
|
|
251
|
-
-
|
|
251
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
252
252
|
|
|
253
253
|
---
|
|
254
254
|
|
|
@@ -411,7 +411,7 @@ Implementation Generation • Testing • Documentation
|
|
|
411
411
|
|
|
412
412
|
```bash
|
|
413
413
|
# 🚀 Install DeepCode package directly
|
|
414
|
-
pip install deepcode
|
|
414
|
+
pip install deepcode-hku
|
|
415
415
|
|
|
416
416
|
# 🔑 Download configuration files
|
|
417
417
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -476,6 +476,34 @@ pip install -r requirements.txt
|
|
|
476
476
|
|
|
477
477
|
</details>
|
|
478
478
|
|
|
479
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
480
|
+
|
|
481
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# 1. Install MCP servers globally
|
|
485
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
486
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
487
|
+
|
|
488
|
+
# 2. Find your global node_modules path
|
|
489
|
+
npm -g root
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
493
|
+
|
|
494
|
+
```yaml
|
|
495
|
+
mcp:
|
|
496
|
+
servers:
|
|
497
|
+
brave:
|
|
498
|
+
command: "node"
|
|
499
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
500
|
+
filesystem:
|
|
501
|
+
command: "node"
|
|
502
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
506
|
+
|
|
479
507
|
### ⚡ **Step 2: Launch Application**
|
|
480
508
|
|
|
481
509
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -5,12 +5,9 @@ DeepCode - AI Research Engine
|
|
|
5
5
|
⚡ Transform research papers into working code automatically
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "1.0.
|
|
8
|
+
__version__ = "1.0.3"
|
|
9
9
|
__author__ = "DeepCode Team"
|
|
10
10
|
__url__ = "https://github.com/HKUDS/DeepCode"
|
|
11
|
-
__description__ = (
|
|
12
|
-
"AI Research Engine - Transform research papers into working code automatically"
|
|
13
|
-
)
|
|
14
11
|
|
|
15
12
|
# Import main components for easy access
|
|
16
13
|
from utils import FileProcessor, DialogueLogger
|
|
@@ -21,5 +18,4 @@ __all__ = [
|
|
|
21
18
|
"__version__",
|
|
22
19
|
"__author__",
|
|
23
20
|
"__url__",
|
|
24
|
-
"__description__",
|
|
25
21
|
]
|
|
@@ -190,11 +190,11 @@ def main():
|
|
|
190
190
|
"--theme.base",
|
|
191
191
|
"dark",
|
|
192
192
|
"--theme.primaryColor",
|
|
193
|
-
"#
|
|
193
|
+
"#3b82f6",
|
|
194
194
|
"--theme.backgroundColor",
|
|
195
|
-
"#
|
|
195
|
+
"#0f1419",
|
|
196
196
|
"--theme.secondaryBackgroundColor",
|
|
197
|
-
"#
|
|
197
|
+
"#1e293b",
|
|
198
198
|
]
|
|
199
199
|
|
|
200
200
|
subprocess.run(cmd, check=True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepcode-hku
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: AI Research Engine - Transform research papers into working code automatically
|
|
5
5
|
Home-page: https://github.com/HKUDS/DeepCode
|
|
6
6
|
Author: DeepCodeTeam
|
|
7
7
|
Project-URL: Documentation, https://github.com/HKUDS/DeepCode
|
|
@@ -76,7 +76,7 @@ Dynamic: summary
|
|
|
76
76
|
<p>
|
|
77
77
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
78
78
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
79
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
79
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
80
80
|
</p>
|
|
81
81
|
<p>
|
|
82
82
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -288,11 +288,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
288
288
|
|
|
289
289
|
### 🔧 **Core Techniques**
|
|
290
290
|
|
|
291
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
291
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
292
292
|
|
|
293
|
-
-
|
|
293
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
294
294
|
|
|
295
|
-
-
|
|
295
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
|
@@ -455,7 +455,7 @@ Implementation Generation • Testing • Documentation
|
|
|
455
455
|
|
|
456
456
|
```bash
|
|
457
457
|
# 🚀 Install DeepCode package directly
|
|
458
|
-
pip install deepcode
|
|
458
|
+
pip install deepcode-hku
|
|
459
459
|
|
|
460
460
|
# 🔑 Download configuration files
|
|
461
461
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -520,6 +520,34 @@ pip install -r requirements.txt
|
|
|
520
520
|
|
|
521
521
|
</details>
|
|
522
522
|
|
|
523
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
524
|
+
|
|
525
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
# 1. Install MCP servers globally
|
|
529
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
530
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
531
|
+
|
|
532
|
+
# 2. Find your global node_modules path
|
|
533
|
+
npm -g root
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
537
|
+
|
|
538
|
+
```yaml
|
|
539
|
+
mcp:
|
|
540
|
+
servers:
|
|
541
|
+
brave:
|
|
542
|
+
command: "node"
|
|
543
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
544
|
+
filesystem:
|
|
545
|
+
command: "node"
|
|
546
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
550
|
+
|
|
523
551
|
### ⚡ **Step 2: Launch Application**
|
|
524
552
|
|
|
525
553
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
$schema: ./schema/mcp-agent.config.schema.json
|
|
2
2
|
|
|
3
|
+
# Default search server configuration
|
|
4
|
+
# Options: "brave" or "bocha-mcp"
|
|
5
|
+
default_search_server: "brave"
|
|
3
6
|
|
|
4
7
|
execution_engine: asyncio
|
|
5
8
|
logger:
|
|
@@ -31,39 +34,45 @@ mcp:
|
|
|
31
34
|
# Use `npm i -g @modelcontextprotocol/server-filesystem` to install the server globally.
|
|
32
35
|
# Use `npm -g root` to find the global node_modules path.`
|
|
33
36
|
# command: "node"
|
|
34
|
-
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","
|
|
37
|
+
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","."]
|
|
35
38
|
command: "npx"
|
|
36
39
|
args: ["-y", "@modelcontextprotocol/server-filesystem"]
|
|
37
40
|
fetch:
|
|
38
41
|
command: "uvx"
|
|
39
42
|
args: ["mcp-server-fetch"]
|
|
40
43
|
github-downloader:
|
|
41
|
-
command: "
|
|
44
|
+
command: "python"
|
|
42
45
|
args: ["tools/git_command.py"]
|
|
43
46
|
env:
|
|
44
47
|
PYTHONPATH: "."
|
|
45
48
|
file-downloader:
|
|
46
|
-
command: "
|
|
49
|
+
command: "python"
|
|
47
50
|
args: ["tools/pdf_downloader.py"]
|
|
48
51
|
env:
|
|
49
52
|
PYTHONPATH: "."
|
|
50
53
|
command-executor:
|
|
51
|
-
command: "
|
|
54
|
+
command: "python"
|
|
52
55
|
args: ["tools/command_executor.py"]
|
|
53
56
|
env:
|
|
54
57
|
PYTHONPATH: "."
|
|
55
58
|
code-implementation:
|
|
56
|
-
command: "
|
|
59
|
+
command: "python"
|
|
57
60
|
args: ["tools/code_implementation_server.py"]
|
|
58
61
|
env:
|
|
59
62
|
PYTHONPATH: "."
|
|
60
63
|
description: "Paper code reproduction tool server - provides file operations, code execution, search and other functions"
|
|
61
64
|
code-reference-indexer:
|
|
62
|
-
command: "
|
|
65
|
+
command: "python"
|
|
63
66
|
args: ["tools/code_reference_indexer.py"]
|
|
64
67
|
env:
|
|
65
68
|
PYTHONPATH: "."
|
|
66
69
|
description: "Code reference indexer server - Provides intelligent code reference search from indexed repositories"
|
|
70
|
+
bocha-mcp:
|
|
71
|
+
command: "python3"
|
|
72
|
+
args: ["tools/bocha_search_server.py"]
|
|
73
|
+
env:
|
|
74
|
+
PYTHONPATH: "."
|
|
75
|
+
BOCHA_API_KEY: ""
|
|
67
76
|
|
|
68
77
|
openai:
|
|
69
78
|
# Secrets (API keys, etc.) are stored in an mcp_agent.secrets.yaml file which can be gitignored
|
|
@@ -13,7 +13,7 @@ def read_long_description():
|
|
|
13
13
|
|
|
14
14
|
# Retrieving metadata from __init__.py
|
|
15
15
|
def retrieve_metadata():
|
|
16
|
-
vars2find = ["__author__", "__version__", "__url__"
|
|
16
|
+
vars2find = ["__author__", "__version__", "__url__"]
|
|
17
17
|
vars2readme = {}
|
|
18
18
|
|
|
19
19
|
# Use definitive path relative to setup.py location
|
|
@@ -62,7 +62,7 @@ setuptools.setup(
|
|
|
62
62
|
url=metadata["__url__"],
|
|
63
63
|
version=metadata["__version__"],
|
|
64
64
|
author=metadata["__author__"],
|
|
65
|
-
description=
|
|
65
|
+
description="AI Research Engine - Transform research papers into working code automatically",
|
|
66
66
|
long_description=long_description,
|
|
67
67
|
long_description_content_type="text/markdown",
|
|
68
68
|
packages=setuptools.find_packages(
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
from dotenv import load_dotenv
|
|
7
|
+
from mcp.server.fastmcp import FastMCP
|
|
8
|
+
|
|
9
|
+
load_dotenv()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Initialize FastMCP server
|
|
13
|
+
server = FastMCP(
|
|
14
|
+
"bocha-search-mcp",
|
|
15
|
+
prompt="""
|
|
16
|
+
# Bocha Search MCP Server
|
|
17
|
+
|
|
18
|
+
Bocha is a Chinese search engine for AI, This server provides tools for searching the web using Bocha Search API.
|
|
19
|
+
It allows you to get enhanced search details from billions of web documents, including weather, news, wikis, healthcare, train tickets, images, and more.
|
|
20
|
+
|
|
21
|
+
## Available Tools
|
|
22
|
+
|
|
23
|
+
### 1. bocha_web_search
|
|
24
|
+
Search with Bocha Web Search and get enhanced search details from billions of web documents, including page titles, urls, summaries, site names, site icons, publication dates, image links, and more.
|
|
25
|
+
|
|
26
|
+
### 2. bocha_ai_search
|
|
27
|
+
Search with Bocha AI Search, recognizes the semantics of search terms and additionally returns structured modal cards with content from vertical domains.
|
|
28
|
+
|
|
29
|
+
## Output Format
|
|
30
|
+
|
|
31
|
+
All search results will be formatted as text with clear sections for each
|
|
32
|
+
result item, including:
|
|
33
|
+
|
|
34
|
+
- Bocha Web search: Title, URL, Description, Published date and Site name
|
|
35
|
+
- Bocha AI search: Title, URL, Description, Published date, Site name, and structured data card
|
|
36
|
+
|
|
37
|
+
If the API key is missing or invalid, appropriate error messages will be returned.
|
|
38
|
+
""",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@server.tool()
|
|
43
|
+
async def bocha_web_search(
|
|
44
|
+
query: str, freshness: str = "noLimit", count: int = 10
|
|
45
|
+
) -> str:
|
|
46
|
+
"""Search with Bocha Web Search and get enhanced search details from billions of web documents,
|
|
47
|
+
including page titles, urls, summaries, site names, site icons, publication dates, image links, and more.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
query: Search query (required)
|
|
51
|
+
freshness: The time range for the search results. (Available options YYYY-MM-DD, YYYY-MM-DD..YYYY-MM-DD, noLimit, oneYear, oneMonth, oneWeek, oneDay. Default is noLimit)
|
|
52
|
+
count: Number of results (1-50, default 10)
|
|
53
|
+
"""
|
|
54
|
+
# Get API key from environment
|
|
55
|
+
boch_api_key = os.environ.get("BOCHA_API_KEY", "")
|
|
56
|
+
|
|
57
|
+
if not boch_api_key:
|
|
58
|
+
return (
|
|
59
|
+
"Error: Bocha API key is not configured. Please set the "
|
|
60
|
+
"BOCHA_API_KEY environment variable."
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Endpoint
|
|
64
|
+
endpoint = "https://api.bochaai.com/v1/web-search?utm_source=bocha-mcp-local"
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
payload = {
|
|
68
|
+
"query": query,
|
|
69
|
+
"summary": True,
|
|
70
|
+
"freshness": freshness,
|
|
71
|
+
"count": count,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
headers = {
|
|
75
|
+
"Authorization": f"Bearer {boch_api_key}",
|
|
76
|
+
"Content-Type": "application/json",
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async with httpx.AsyncClient() as client:
|
|
80
|
+
response = await client.post(
|
|
81
|
+
endpoint, headers=headers, json=payload, timeout=10.0
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response.raise_for_status()
|
|
85
|
+
resp = response.json()
|
|
86
|
+
if "data" not in resp:
|
|
87
|
+
return "Search error."
|
|
88
|
+
|
|
89
|
+
data = resp["data"]
|
|
90
|
+
|
|
91
|
+
if "webPages" not in data:
|
|
92
|
+
return "No results found."
|
|
93
|
+
|
|
94
|
+
results = []
|
|
95
|
+
for result in data["webPages"]["value"]:
|
|
96
|
+
results.append(
|
|
97
|
+
f"Title: {result['name']}\n"
|
|
98
|
+
f"URL: {result['url']}\n"
|
|
99
|
+
f"Description: {result['summary']}\n"
|
|
100
|
+
f"Published date: {result['datePublished']}\n"
|
|
101
|
+
f"Site name: {result['siteName']}"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
return "\n\n".join(results)
|
|
105
|
+
|
|
106
|
+
except httpx.HTTPStatusError as e:
|
|
107
|
+
return f"Bocha Web Search API HTTP error occurred: {e.response.status_code} - {e.response.text}"
|
|
108
|
+
except httpx.RequestError as e:
|
|
109
|
+
return f"Error communicating with Bocha Web Search API: {str(e)}"
|
|
110
|
+
except Exception as e:
|
|
111
|
+
return f"Unexpected error: {str(e)}"
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@server.tool()
|
|
115
|
+
async def bocha_ai_search(
|
|
116
|
+
query: str, freshness: str = "noLimit", count: int = 10
|
|
117
|
+
) -> str:
|
|
118
|
+
"""Search with Bocha AI Search, recognizes the semantics of search terms
|
|
119
|
+
and additionally returns structured modal cards with content from vertical domains.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
query: Search query (required)
|
|
123
|
+
freshness: The time range for the search results. (Available options noLimit, oneYear, oneMonth, oneWeek, oneDay. Default is noLimit)
|
|
124
|
+
count: Number of results (1-50, default 10)
|
|
125
|
+
"""
|
|
126
|
+
# Get API key from environment
|
|
127
|
+
boch_api_key = os.environ.get("BOCHA_API_KEY", "")
|
|
128
|
+
|
|
129
|
+
if not boch_api_key:
|
|
130
|
+
return (
|
|
131
|
+
"Error: Bocha API key is not configured. Please set the "
|
|
132
|
+
"BOCHA_API_KEY environment variable."
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# Endpoint
|
|
136
|
+
endpoint = "https://api.bochaai.com/v1/ai-search?utm_source=bocha-mcp-local"
|
|
137
|
+
|
|
138
|
+
try:
|
|
139
|
+
payload = {
|
|
140
|
+
"query": query,
|
|
141
|
+
"freshness": freshness,
|
|
142
|
+
"count": count,
|
|
143
|
+
"answer": False,
|
|
144
|
+
"stream": False,
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
headers = {
|
|
148
|
+
"Authorization": f"Bearer {boch_api_key}",
|
|
149
|
+
"Content-Type": "application/json",
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async with httpx.AsyncClient() as client:
|
|
153
|
+
response = await client.post(
|
|
154
|
+
endpoint, headers=headers, json=payload, timeout=10.0
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
response.raise_for_status()
|
|
158
|
+
response = response.json()
|
|
159
|
+
results = []
|
|
160
|
+
if "messages" in response:
|
|
161
|
+
for message in response["messages"]:
|
|
162
|
+
content = {}
|
|
163
|
+
try:
|
|
164
|
+
content = json.loads(message["content"])
|
|
165
|
+
except (json.JSONDecodeError, TypeError):
|
|
166
|
+
content = {}
|
|
167
|
+
|
|
168
|
+
# 网页
|
|
169
|
+
if message["content_type"] == "webpage":
|
|
170
|
+
if "value" in content:
|
|
171
|
+
for item in content["value"]:
|
|
172
|
+
results.append(
|
|
173
|
+
f"Title: {item['name']}\n"
|
|
174
|
+
f"URL: {item['url']}\n"
|
|
175
|
+
f"Description: {item['summary']}\n"
|
|
176
|
+
f"Published date: {item['datePublished']}\n"
|
|
177
|
+
f"Site name: {item['siteName']}"
|
|
178
|
+
)
|
|
179
|
+
elif (
|
|
180
|
+
message["content_type"] != "image"
|
|
181
|
+
and message["content"] != "{}"
|
|
182
|
+
):
|
|
183
|
+
results.append(message["content"])
|
|
184
|
+
|
|
185
|
+
if not results:
|
|
186
|
+
return "No results found."
|
|
187
|
+
|
|
188
|
+
return "\n\n".join(results)
|
|
189
|
+
|
|
190
|
+
except httpx.HTTPStatusError as e:
|
|
191
|
+
return f"Bocha AI Search API HTTP error occurred: {e.response.status_code} - {e.response.text}"
|
|
192
|
+
except httpx.RequestError as e:
|
|
193
|
+
return f"Error communicating with Bocha AI Search API: {str(e)}"
|
|
194
|
+
except Exception as e:
|
|
195
|
+
return f"Unexpected error: {str(e)}"
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def main():
|
|
199
|
+
"""Initialize and run the MCP server."""
|
|
200
|
+
|
|
201
|
+
# Check for required environment variables
|
|
202
|
+
if "BOCHA_API_KEY" not in os.environ:
|
|
203
|
+
print(
|
|
204
|
+
"Error: BOCHA_API_KEY environment variable is required",
|
|
205
|
+
file=sys.stderr,
|
|
206
|
+
)
|
|
207
|
+
print(
|
|
208
|
+
"Get a Bocha API key from: " "https://open.bochaai.com",
|
|
209
|
+
file=sys.stderr,
|
|
210
|
+
)
|
|
211
|
+
sys.exit(1)
|
|
212
|
+
|
|
213
|
+
print("Starting Bocha Search MCP server...", file=sys.stderr)
|
|
214
|
+
|
|
215
|
+
server.run(transport="stdio")
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
if __name__ == "__main__":
|
|
219
|
+
main()
|