🌐 Web Tools MCP Server
Clean và đơn giản MCP Server cho việc duyệt web với 2 tools chính:
🔧 Tools Available
1. 🔍 web_search_tool ✅ COMPLETED
- Tìm kiếm Google và trả về danh sách URLs
- Input: search query, số lượng kết quả (default: 15)
- Output: JSON với title, URL, snippet, source cho mỗi kết quả
2. 📄 web_fetch_tool 🚧 COMING NEXT
- Lấy nội dung từ URL cụ thể
- Input: URL
- Output: Clean text content từ webpage
🚀 Quick Start
Install
cd Web_mcp
pip install -e .Test
python test.pyRun MCP Server
python mcp_server.py📝 Usage Examples
Basic Web Search
web_search_tool("CSS accessibility best practices")Custom Parameters
web_search_tool("React performance optimization", 10, "en")Vietnamese Search
web_search_tool("lập trình web frontend", 15, "vi")📊 Output Format
{
"query": "CSS accessibility best practices",
"total_results": 15,
"results": [
{
"rank": 1,
"title": "CSS And Accessibility: Inclusion Through User Choice",
"url": "https://www.smashingmagazine.com/...",
"snippet": "Using the prefers-reduced-motion CSS media feature...",
"source": "smashingmagazine.com"
}
],
"status": "success"
}🎯 Development Status
- ✅ Phase 1: Web Search Tool - COMPLETED
- 🚧 Phase 2: Web Fetch Tool - IN PROGRESS
- 🔄 Phase 3: Additional search engines support
🛠️ Project Structure
Web_mcp/
├── mcp_server.py # Main MCP server
├── start_server.py # Start script
├── test_web_search.py # Test script
├── tools/
│ ├── mcp_web_search/ # ✅ Web search tool
│ │ ├── __init__.py
│ │ ├── core.py # MCP tool interface
│ │ └── search.py # Google search logic
│ └── mcp_web_fetch/ # 🚧 Web fetch tool (coming)
└── pyproject.toml # DependenciesNext: Implement mcp_web_fetch tool for content extraction! 🚀
