Skip to content

Commit 981d6eb

Browse files
committed
use correct fetch mcp
1 parent 577e232 commit 981d6eb

File tree

4 files changed

+84
-50
lines changed

4 files changed

+84
-50
lines changed

.claude/context/web_automation_guide.md

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,30 @@ await page.waitForSelector('.dynamic-content');
3131
const content = await page.textContent('.dynamic-content');
3232
```
3333

34-
### 🔍 **Fetch MCP** - For Lightweight Data Retrieval
34+
### 🔍 **Fetch MCP** - For Enhanced Data Retrieval & Content Processing
3535

3636
**Use Fetch when you need:**
37-
- **API Calls**: REST API consumption, data retrieval
38-
- **Simple Web Scraping**: Static HTML content extraction
39-
- **Information Gathering**: Research tasks, data collection
37+
- **Multi-format Content**: HTML, JSON, plain text, or Markdown output
38+
- **API Calls**: REST API consumption with custom headers
39+
- **Web Scraping**: Clean text extraction from websites
40+
- **Content Transformation**: HTML to Markdown conversion
41+
- **Research Tasks**: Information gathering with formatted output
4042
- **Fast Requests**: Lightweight operations without browser overhead
41-
- **Bulk Data Processing**: Multiple rapid requests
42-
- **RSS/XML Parsing**: Feed processing, data syndication
43-
- **Health Checks**: Server monitoring, uptime checks
43+
- **Bulk Data Processing**: Multiple rapid requests with different formats
44+
- **Documentation Parsing**: Extract clean content from docs sites
4445

45-
**Example Use Cases:**
46+
**Enhanced Capabilities (zcaceres/fetch-mcp):**
4647
```bash
47-
# Research tasks
48-
"Fetch the latest Laravel documentation for validation rules"
49-
"Get the current weather data from OpenWeatherMap API"
50-
"Retrieve the latest GitHub releases for Laravel framework"
51-
52-
# API integration
53-
"Fetch user data from the CRM API"
54-
"Get product information from the inventory system"
55-
"Retrieve exchange rates from the financial API"
48+
# Multiple output formats available
49+
"Fetch Laravel docs as Markdown for easier reading"
50+
"Get API response as clean JSON structure"
51+
"Extract plain text from news article (no HTML)"
52+
"Fetch website content as raw HTML for parsing"
53+
54+
# Custom headers for authenticated requests
55+
"Fetch protected API endpoint with Bearer token"
56+
"Get content from site requiring specific User-Agent"
57+
"Access authenticated documentation with API key"
5658
```
5759

5860
## Complementary Use Cases
@@ -95,11 +97,12 @@ const content = await page.textContent('.dynamic-content');
9597

9698
## Performance Considerations
9799

98-
### **Fetch MCP Performance**
100+
### **Enhanced Fetch MCP Performance**
99101
-**Fast**: Minimal overhead, direct HTTP requests
100-
- 💾 **Lightweight**: Low memory usage
101-
- 🔄 **Scalable**: Handle multiple concurrent requests
102-
- 📊 **Efficient**: Perfect for bulk data operations
102+
- 💾 **Lightweight**: Low memory usage compared to browser automation
103+
- 🔄 **Versatile**: Multiple output formats (HTML, JSON, text, Markdown)
104+
- 📊 **Efficient**: Perfect for bulk data operations with content transformation
105+
- 🔧 **Flexible**: Custom headers support for authenticated requests
103106

104107
### **Playwright MCP Performance**
105108
- 🐌 **Slower**: Full browser execution overhead
@@ -149,11 +152,19 @@ playwright('test product display on frontend');
149152

150153
## Agent Task Examples
151154

152-
### **Research Tasks** (Fetch MCP)
155+
### **Research Tasks** (Enhanced Fetch MCP)
153156
```
154-
Agent: "Research the latest Laravel 12 security features"
155-
→ Fetch: Laravel docs, security guides, release notes
156-
→ Result: Comprehensive security feature summary
157+
Agent: "Get Laravel 12 security best practices as clean Markdown"
158+
→ Enhanced Fetch: HTML to Markdown conversion, clean formatting
159+
→ Result: Well-formatted security documentation
160+
161+
Agent: "Extract plain text from this news article (remove ads/navigation)"
162+
→ Enhanced Fetch: Text extraction with HTML cleanup
163+
→ Result: Clean article content only
164+
165+
Agent: "Fetch API documentation and return as JSON structure"
166+
→ Enhanced Fetch: JSON parsing with structured output
167+
→ Result: Properly formatted API reference data
157168
```
158169

159170
### **Testing Tasks** (Playwright MCP)
@@ -174,12 +185,14 @@ Agent: "Integrate and test a new payment provider"
174185

175186
## Best Practices
176187

177-
### **Choose Fetch MCP When:**
178-
- The content is static HTML
179-
- You need simple data extraction
180-
- Performance is critical
181-
- You're making API calls
182-
- The site doesn't require JavaScript
188+
### **Choose Enhanced Fetch MCP When:**
189+
- You need content in specific formats (Markdown, plain text, JSON)
190+
- The content is static HTML or API responses
191+
- You want clean text extraction without ads/navigation
192+
- Performance is critical for bulk operations
193+
- You're making API calls with custom authentication headers
194+
- You need content transformation (HTML to Markdown)
195+
- The site doesn't require JavaScript interaction
183196

184197
### **Choose Playwright MCP When:**
185198
- Content is JavaScript-generated

.claude_config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"args": ["-y", "@playwright/mcp"]
3535
},
3636
"fetch": {
37-
"command": "npx",
38-
"args": ["-y", "@modelcontextprotocol/server-fetch"]
37+
"command": "node",
38+
"args": ["~/.config/claude-code/mcp-servers/fetch-mcp/dist/index.js"]
3939
},
4040
"github": {
4141
"command": "npx",

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Laravel 12 project has been configured with Claude Code and optimized MCP s
99
- **Memory** - Shared knowledge base across projects
1010
- **Context7** - Latest Laravel 12 documentation access
1111
- **Playwright** - Browser automation and testing capabilities (Microsoft MCP)
12-
- **Fetch** - HTTP requests and web data retrieval (Official MCP)
12+
- **Fetch** - Enhanced HTTP requests, web scraping, and content transformation (zcaceres/fetch-mcp)
1313

1414
### Project-Specific Servers
1515
- **Filesystem** - Access to this project's files
@@ -291,7 +291,7 @@ npx playwright test --debug # Debug mode
291291
- **Memory**: Persistent knowledge across sessions
292292
- **Database**: Direct database queries and schema analysis
293293
- **Playwright**: Browser automation, testing, and web scraping
294-
- **Fetch**: HTTP requests, API calls, and web data retrieval
294+
- **Fetch**: Enhanced HTTP requests with HTML, JSON, text, and Markdown parsing
295295
- **Filesystem**: Read and modify project files
296296

297297
### Usage Tips

setup.sh

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -482,16 +482,37 @@ install_filesystem() {
482482
fi
483483
}
484484

485-
# Install Fetch MCP Server (Official MCP version)
485+
# Install Fetch MCP Server (zcaceres version - enhanced capabilities)
486486
install_fetch() {
487-
print_step "Installing Fetch MCP Server (Official MCP)..."
487+
print_step "Installing Fetch MCP Server (zcaceres - enhanced version)..."
488488

489-
print_status "Installing Fetch MCP server via npm..."
490-
if npm install -g @modelcontextprotocol/server-fetch; then
491-
print_success "Fetch MCP Server installed!"
489+
cd "$MCP_DIR"
490+
491+
if [ -d "fetch-mcp" ]; then
492+
print_status "Removing existing fetch-mcp installation..."
493+
rm -rf fetch-mcp
494+
fi
495+
496+
print_status "Cloning zcaceres fetch-mcp repository..."
497+
if ! git clone https://github.com/zcaceres/fetch-mcp.git fetch-mcp; then
498+
print_error "Failed to clone zcaceres fetch-mcp repository"
499+
return 1
500+
fi
501+
502+
cd fetch-mcp
503+
504+
print_status "Installing fetch-mcp dependencies..."
505+
if ! npm install; then
506+
print_error "Failed to install fetch-mcp dependencies"
507+
return 1
508+
fi
509+
510+
print_status "Building fetch-mcp..."
511+
if npm run build; then
512+
print_success "Enhanced Fetch MCP Server installed!"
492513
return 0
493514
else
494-
print_error "Failed to install Fetch MCP Server"
515+
print_error "Failed to build fetch-mcp"
495516
return 1
496517
fi
497518
}
@@ -694,20 +715,20 @@ configure_claude_mcp() {
694715
print_warning "Playwright MCP server not found - skipping configuration"
695716
fi
696717

697-
# Add global Fetch MCP server
698-
if command -v npx &> /dev/null && npx @modelcontextprotocol/server-fetch --version &> /dev/null 2>&1; then
718+
# Add global Fetch MCP server (zcaceres enhanced version)
719+
if [ -f "$MCP_DIR/fetch-mcp/dist/index.js" ]; then
699720
if ! claude mcp list 2>/dev/null | grep -q "^fetch:"; then
700-
print_status "Adding global Fetch MCP server..."
701-
if claude mcp add "fetch" npx @modelcontextprotocol/server-fetch; then
702-
print_success "Global Fetch MCP server added"
721+
print_status "Adding global Enhanced Fetch MCP server..."
722+
if claude mcp add "fetch" node "$MCP_DIR/fetch-mcp/dist/index.js"; then
723+
print_success "Global Enhanced Fetch MCP server added"
703724
else
704-
print_warning "Failed to add global Fetch MCP server"
725+
print_warning "Failed to add global Enhanced Fetch MCP server"
705726
fi
706727
else
707-
print_success "Global Fetch MCP server already configured"
728+
print_success "Global Enhanced Fetch MCP server already configured"
708729
fi
709730
else
710-
print_warning "Fetch MCP server not found - skipping configuration"
731+
print_warning "Enhanced Fetch MCP server not found - skipping configuration"
711732
fi
712733

713734
print_header "Setting up project-specific MCP servers..."
@@ -895,7 +916,7 @@ create_project_context() {
895916
896917
### Development Tools
897918
- **Claude Code**: AI-powered development assistant
898-
- **MCP Servers**: Context7, GitHub, Memory, Database, Playwright, Fetch, Filesystem
919+
- **MCP Servers**: Context7, GitHub, Memory, Database, Playwright, Enhanced Fetch, Filesystem
899920
- **Testing**: Pest PHP for feature and unit testing
900921
- **Code Quality**: Laravel Pint for code formatting
901922

0 commit comments

Comments
 (0)