使用说明
CasaOS SearXNG MCP Server
This MCP server provides search capabilities through your locally hosted CasaOS SearXNG instance.
Overview
- Server Name:
searxng-casaos-mcp - Target Instance: CasaOS SearXNG at
http://casaos:7888 - Tools Available:
search,get_engines,health_check
Installation
1. Install Dependencies
Navigate to the MCP server directory and install Node.js dependencies:
cd searxng-mcp-server
npm install
2. Configure Cline
Copy the contents of cline-mcp-config.json to your Cline configuration file:
Windows: %APPDATA%\Cline\config.json
macOS/Linux: ~/.config/cline/config.json
Add the MCP server configuration to the mcpServers section:
{
"mcpServers": {
"searxng-casaos": {
"command": "node",
"args": [
"d:/Programs/AI/!MCPServers!/searXNG/searxng-mcp-server/index.js"
],
"cwd": "d:/Programs/AI/!MCPServers!/searXNG/searxng-mcp-server",
"env": {
"NODE_ENV": "production"
},
"description": "SearXNG search server for CasaOS instance",
"version": "1.0.0"
}
}
}
3. Configure OpenCode
For OpenCode, use the configuration in opencode-mcp-config.json and add it to your OpenCode MCP configuration.
Usage
Available Tools
1. search - Web Search
Search the web using your CasaOS SearXNG instance.
Parameters:
query(required): The search queryformat(optional): Output format (json, csv, rss) - default: jsonlanguage(optional): Language code (en, es, fr) - default: encategory(optional): Search category (general, images, videos, etc.)time_range(optional): Time range (day, week, month, year)safesearch(optional): Safe search level (0=off, 1=moderate, 2=strict) - default: 0limit(optional): Maximum results to return (1-100) - default: 10
Example:
{
"query": "latest AI developments",
"language": "en",
"category": "general",
"limit": 5
}
2. get_engines - Get Available Engines
Get information about available search engines.
Parameters:
format(optional): Output format - default: json
3. health_check - Health Check
Check if the CasaOS SearXNG instance is accessible.
Parameters: None
Example Usage in Cline
# Search for information
Search for "latest Python release" using the searxng-casaos MCP server
# Check server health
Run health_check on the searxng-casaos MCP server
# Get available search engines
Run get_engines on the searxng-casaos MCP server
Configuration
Server Configuration
The MCP server is configured in index.js with the following settings:
const SEARXNG_CONFIG = {
baseUrl: 'http://casaos:7888', // Your CasaOS SearXNG URL
defaultTimeout: 10000, // 10 seconds default timeout
maxTimeout: 60000, // 60 seconds max timeout
};
Environment Variables
NODE_ENV: Set toproductionfor production use
Troubleshooting
Connection Issues
-
Verify CasaOS SearXNG is running:
curl http://casaos:7888 -
Check Tailscale connection: Ensure your device is connected to the same Tailscale network as CasaOS.
-
Verify port accessibility:
telnet casaos 7888
MCP Server Issues
-
Check Node.js version:
node --versionRequires Node.js 18+ with ES modules support.
-
Install dependencies:
cd searxng-mcp-server npm install -
Test server manually:
cd searxng-mcp-server node index.js
Common Errors
- "CasaOS SearXNG instance is not accessible": Check network connectivity and Tailscale connection
- "HTTP 500": SearXNG server error - check CasaOS logs
- "Network timeout": Increase timeout or check network speed
Security Notes
- The MCP server connects to your local CasaOS instance over the internal network
- No external API keys or credentials are required
- All communication stays within your local network via Tailscale
Development
Running in Development Mode
cd searxng-mcp-server
npm run dev
Adding New Tools
To add new tools, modify the ListToolsRequestSchema handler in index.js and add the corresponding handler in the CallToolRequestSchema switch statement.
License
MIT License - See package.json for details.
Support
For issues with this MCP server, check:
- CasaOS SearXNG logs
- Tailscale connectivity
- Node.js dependencies
- Network configuration