Search Agent
An intelligent search service with REST API, CLI, and MCP server interfaces.
Features
- REST API: Full-featured HTTP API with streaming support
- CLI: Command-line interface for quick searches
- MCP Server: Model Context Protocol server for integration with AI assistants
Installation
npm install
Usage
REST API Server
npm run serve
The server will start at http://localhost:3000.
CLI
npm run search "Your question here"
MCP Server
npm run mcp
MCP Configuration
To use the search agent as an MCP server in your AI assistant, add this to your configuration:
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"search-agent": {
"command": "node",
"args": ["/path/to/searchAgent/mcpServer.js"],
"env": {
"EXA_API_KEY": "your-exa-api-key",
"OPENROUTER_API_KEY": "your-openrouter-api-key"
}
}
}
}
Other MCP Clients
For other MCP clients, configure the command as:
- Command:
node - Args:
["/path/to/searchAgent/mcpServer.js"] - Environment variables:
EXA_API_KEYandOPENROUTER_API_KEY
Available MCP Tools
search
Search for information and return a summarized answer with sources.
Parameters:
question(required): The question or topic to search forpreviousClarification(optional): Previous clarification from the user if the question needed refinementoriginalQuestion(optional): The original question if this is a follow-up
Example:
{
"name": "search",
"arguments": {
"question": "What are the latest developments in AI?"
}
}
Environment Variables
Required:
EXA_API_KEY: Your Exa API keyOPENROUTER_API_KEY: Your OpenRouter API key
Optional:
PORT: Port for REST server (default: 3000)HOST: Host for REST server (default: 0.0.0.0)MAINTENANCE_MODE: Set to "true" to enable maintenance mode
Description
Languages
JavaScript
58.6%
HTML
41.4%