Initial commit: MCP Agent Tools
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
|||||||
|
# Python
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*.egg-info/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
env/
|
||||||
|
.env
|
||||||
|
|
||||||
|
# Data & runtime
|
||||||
|
*.db
|
||||||
|
*.sqlite3
|
||||||
|
data/
|
||||||
|
essays_data/
|
||||||
|
knowledge_*
|
||||||
|
|
||||||
|
# System files
|
||||||
|
Thumbs.db
|
||||||
|
.DS_Store
|
||||||
|
desktop.ini
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 DVS (dvs-dvsxt)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+1577
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
|||||||
|
# 🤖 MCP Agent Tools & Multimodal Support
|
||||||
|
|
||||||
|
> A **FastAPI-based AI agent tool service** providing agent core tools, multimodal AI capabilities, TTS/OCR, knowledge base, essays, and utility APIs.
|
||||||
|
|
||||||
|
This project contains two FastAPI services for AI agent assistance:
|
||||||
|
|
||||||
|
1. **Main Agent Tools** — core agent tools: MCP endpoint, safe command execution, workspace switching, SSH session management, and permission dialogs.
|
||||||
|
2. **Multimodal & Gadget Support** — multimodal AI (Qwen chat/ask/TTS/OCR), knowledge base management, essay recording/search, and utility APIs (WHOIS / IP / GitHub).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Components
|
||||||
|
|
||||||
|
### 🤖 Main Agent Tools (`agent_tools.py`)
|
||||||
|
Agent core tools exposed via FastAPI:
|
||||||
|
- **MCP endpoint** (`/mcp`)
|
||||||
|
- **Safe command execution** (`execute_command_safe`)
|
||||||
|
- **Workspace switching** (`/switch_workspace`, `/current_workspace`)
|
||||||
|
- **SSH session management** (`/ssh/sessions`, `/ssh/cleanup`)
|
||||||
|
- **Python runner** (`create_and_run_python`)
|
||||||
|
- **Permission dialogs** (confirm / input) on Windows
|
||||||
|
|
||||||
|
### 🧩 Multimodal & Gadget Support (`multimodal_gadget_support.py`)
|
||||||
|
- **AI Chat / Ask** — Qwen (Flash / Pro) chat & ask endpoints
|
||||||
|
- **TTS** — text-to-speech (Flash / Plus / Max)
|
||||||
|
- **OCR** — text recognition (`/ocr`, `/ocr_advanced`)
|
||||||
|
- **Knowledge Base** — add / query / search / manage knowledge points
|
||||||
|
- **Essays** — record, search, view personal essays
|
||||||
|
- **Utilities** — WHOIS, IP info, GitHub repo lookup
|
||||||
|
- **Keyword split** — DeepSeek-based query segmentation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
- Python 3.9+
|
||||||
|
- `fastapi`, `uvicorn`, `pydantic`
|
||||||
|
- Optional: `paramiko` (SSH), `openai` (AI), `pandas`, etc.
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install fastapi uvicorn pydantic
|
||||||
|
|
||||||
|
# Run Agent Tools
|
||||||
|
python agent_tools.py
|
||||||
|
|
||||||
|
# Run Multimodal & Gadget Support (on another port)
|
||||||
|
python multimodal_gadget_support.py
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📁 Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
mcp/
|
||||||
|
├── Main Agent Tools.py # 🤖 Agent core tools (FastAPI)
|
||||||
|
├── Multimodal and Gadget Support.py # 🧩 Multimodal & gadget support (FastAPI)
|
||||||
|
└── README.md # This document
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ Security Note
|
||||||
|
|
||||||
|
> This service executes **system commands** and exposes agent tools. **Run only in trusted environments.** All sensitive keys are configured via environment variables, not hardcoded.
|
||||||
Reference in New Issue
Block a user