| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a Java/Spring Boot implementation of the MCP WebSearch server with the same features as the Node.js version.
java/ ├── pom.xml # Maven configuration ├── src/ │ ├── main/ │ │ ├── java/com/xtivia/mcp/websearch/ │ │ │ ├── McpWebSearchApplication.java # Main application │ │ │ ├── config/ │ │ │ │ └── WebSearchProperties.java # Configuration properties │ │ │ ├── model/ │ │ │ │ ├── SearchResult.java # Search result model │ │ │ │ ├── SearchResponse.java # Search response model │ │ │ │ ├── FetchResult.java # Fetch result model │ │ │ │ └── PreferredSite.java # Preferred site model │ │ │ ├── provider/ │ │ │ │ ├── SearchProvider.java # Provider interface │ │ │ │ ├── DuckDuckGoProvider.java # DuckDuckGo implementation │ │ │ │ └── BraveProvider.java # Brave Search implementation │ │ │ ├── service/ │ │ │ │ ├── PreferredSitesManager.java # Site preferences │ │ │ │ ├── RequestManager.java # Rate limiting │ │ │ │ └── ContentFetchService.java # Content fetching │ │ │ ├── tool/ │ │ │ │ ├── WebSearchTool.java # Search MCP tool │ │ │ │ └── ContentFetchTool.java # Fetch MCP tool │ │ │ └── util/ │ │ │ ├── KeywordExtractor.java # Keyword extraction │ │ │ └── SummaryGenerator.java # Summary generation │ │ └── resources/ │ │ ├── application.yml # Spring configuration │ │ └── preferred_sites.json # Site preferences │ └── test/ │ └── java/com/xtivia/mcp/websearch/ │ └── McpWebSearchApplicationTests.java
Edit src/main/resources/application.yml:
websearch:
provider: duckduckgo # duckduckgo or brave
max-concurrent-requests: 4
rate-limit: 10
rate-limit-window-seconds: 60
search-results-count: 10
search-result-max-length: 400
fetch-result-max-length: 5000
debug: falsecd java
mvn clean packagejava -jar target/mcp-websearch-1.0.0.jar --stdiojava -jar target/mcp-websearch-1.0.0.jar
# Or specify custom port
java -jar target/mcp-websearch-1.0.0.jar --port=8080The application automatically detects SSL certificates and enables HTTPS if:
If certificates are found, the server will start in HTTPS mode automatically. Otherwise, it falls back to HTTP mode.
Generate self-signed certificates (for development):
On Linux/Mac:
./generate-certs.shOn Windows:
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodesThe server will display which mode it's running in at startup:
java -jar target/mcp-websearch-1.0.0.jar --debugIntelligent web search with DuckDuckGo (primary) and Brave (fallback).
Parameters:
Returns:
{
"query": "search term",
"totalResults": 10,
"searchProvider": "DuckDuckGo",
"results": [
{
"title": "Result Title",
"url": "https://example.com",
"keywords": ["keyword1", "keyword2"],
"summary": "Intelligent summary of the result..."
}
]
}Fetch and extract content from a URL.
Parameters:
Returns:
{
"url": "https://example.com",
"title": "Page Title",
"content": "Extracted content...",
"summary": "Intelligent summary...",
"keywords": ["keyword1", "keyword2"],
"metadata": {
"domain": "example.com",
"contentType": "text/html",
"contentLength": 1234,
"lastModified": "2025-01-01T00:00:00Z"
}
}Automatically enhances queries with site: operators based on keywords:
cd java
mvn testThe project includes spring-boot-devtools for automatic restart during development.
Enable debug mode to see detailed logs:
java -jar target/mcp-websearch-1.0.0.jar --debugAdd to your Claude Desktop config:
stdio mode:
{
"mcpServers": {
"websearch": {
"command": "java",
"args": [
"-jar",
"/path/to/mcp-websearch-1.0.0.jar",
"--stdio"
]
}
}
}HTTP mode:
{
"mcpServers": {
"websearch": {
"url": "http://localhost:3000/mcp"
}
}
}HTTPS mode (when certificates are detected):
{
"mcpServers": {
"websearch": {
"url": "https://localhost:3000/mcp"
}
}
}| Feature | Node.js | Java/Spring |
|---|---|---|
| MCP SDK | ✅ @modelcontextprotocol/sdk | ✅ Spring AI MCP |
| Search Providers | ✅ DDG + Brave | ✅ DDG + Brave |
| Query Enhancement | ✅ | ✅ |
| Rate Limiting | ✅ | ✅ |
| Content Fetching | ✅ Cheerio | ✅ Jsoup |
| Stdio Transport | ✅ | ✅ |
| HTTP Transport | ✅ Express | ✅ Spring WebFlux |
| HTTPS Support | ✅ | ✅ |
| Debug Mode | ✅ | ✅ |
| Preferred Sites | ✅ | ✅ |
MIT
Contributions welcome! Please feel free to submit a Pull Request.
| Back | FazBrowse Home | New Git URL |