SearchAPI.site - MCP Server

by mrgoonie

14 227 downloads Not rated yet MIT
GitHub

About

TypeScript Model Context Protocol (MCP) server boilerplate providing search API tools/resources. Includes CLI support and extensible structure for connecting AI systems (LLMs) to external data sources (Google, Bing, etc.) via SearchAPI.site

Details

License
MIT

Explore

- Connects AI assistants to Google and Bing search
- Supports Google Web, Image, and YouTube search
- Supports Bing Web search (more platforms planned)
- Offers both stdio and Streamable HTTP transports
- Built with TypeScript for type safety and maintainability

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name SearchAPI.site - MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Node.js (>=18.x): Download
- Git: For version control

---

For local configuration with stdio transport:

{
"mcpServers": {
"searchapi": {
"command": "node",
"args": ["/path/to/searchapi-mcp-server/dist/index.js"],
"transportType": "stdio"
}
}
}

For remote HTTP configuration:

{
"mcpServers": {
"searchapi": {
"type": "http",
"url": "http://mcp.searchapi.site/mcp"
}
}
}

Environment Variables for HTTP Transport:

You can configure the HTTP server using these environment variables:

- MCP_HTTP_HOST: The host to bind to (default: 127.0.0.1)
- MCP_HTTP_PORT: The port to listen on (default: 8080)
- MCP_HTTP_PATH: The endpoint path (default: /mcp)

---


npm install

---

DEBUG=true npm run dev:server

```

---

Run the example IP lookup tool from the CLI:


- Purpose: Define MCP tools with schemas and descriptions for AI assistants
- Naming: Files should be named <feature>.tool.ts with types in <feature>.types.ts
- Pattern: Each tool should use zod for argument validation

Follow these steps to add your own tools to the server:

Create a tool definition in src/tools/:

typescript
// src/tools/example.tool.ts
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { z } from 'zod';
import { Logger } from '../utils/logger.util.js';
import { formatErrorForMcpTool } from '../utils/error.util.js';
import * as exampleController from '../controllers/example.controller.js';

const logger = Logger.forContext('tools/example.tool.ts');

const GetDataArgs = z.object({
param: z.string().optional().describe('Optional parameter'),
});

type GetDataArgsType = z.infer<typeof GetDataArgs>;

async function handleGetData(args: GetDataArgsType) {
try {
logger.debug('Tool get_data called', args);

const result = await exampleController.getData({
param: args.param,
});

return {
content: [{ type: 'text' as const, text: result.content }],
};
} catch (error) {
logger.error('Tool get_data failed', error);
return formatErrorForMcpTool(error);
}
}

export function register(server: McpServer) {
server.tool(
'get_data',
Gets data from the example API, optionally using \param\.
Use this to fetch example data. Returns formatted data as Markdown.
,
GetDataArgs.shape,
handleGetData,
);
}
```

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "searchapi.site - mcp server": {
            "searchapi-mcp-server": {
                "command": "npx",
                "args": [
                    "mcp-eval",
                    "src/evals/evals.ts",
                    "src/tools/searchapi.tool.ts"
                ],
                "env": {
                    "OPENAI_API_KEY": "your-key"
                }
            }
        }
    }
}

McpServers

{
    "searchapi-mcp-server": {
        "command": "npx",
        "args": [
            "mcp-eval",
            "src/evals/evals.ts",
            "src/tools/searchapi.tool.ts"
        ],
        "env": {
            "OPENAI_API_KEY": "your-key"
        }
    }
}

This project provides a Model Context Protocol (MCP) server that connects AI assistants to external data sources (Google, Bing, etc.) via SearchAPI.site.

Author: Claude

- Glama
- Github
- NPM

<a href="https://glama.ai/mcp/servers/@mrgoonie/searchapi-mcp-server">
SearchAPI Server MCP server
</a>

Available platforms

- [x] Google - Web Search - [x] Google - Image Search - [x] Google - YouTube Search - [ ] Google - Maps Search - [x] Bing - Web Search - [ ] Bing - Image Search - [ ] Reddit - [ ] X/Twitter - [ ] Facebook Search - [ ] Facebook Group Search - [ ] Instagram - [ ] TikTok

SearchAPI.site

- Website
- API Docs
- Swagger UI Config
- Create Search API key here
- GitHub

Supported Transports

- [x] "stdio" transport - Default transport for CLI usage
- [x] "Streamable HTTP" transport - For web-based clients
- [ ] Implement auth ("Authorization" headers with Bearer <token>)
- [x] ~~"sse" transport~~ (Deprecated)
- [ ] Write tests

How to use

CLI

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.