mcpField
G
Gemini MCP Server

Gemini MCP Server

Local
github.com/rtbui2012AI & Agents0Updated 78w ago

About Gemini MCP Server

Gemini MCP Server provides Google Custom Search web and image search to MCP-compatible clients. It is for developers integrating search results into AI assistants or other MCP clients.

Key features

  1. 01Google Custom Search web queries
  2. 02Structured titles, links, and snippets
  3. 03Image search with a Markdown result
  4. 04Node.js 18+ requirement
  5. 05MIT-licensed project

Use cases

  1. 01Retrieve web results for an AI assistant
  2. 02Find images through an MCP client

MCP support

Exposes web and image search as MCP tools for compatible clients: googleSearchContent and googleSearchImages.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"gemini-mcp-server-rtbui2012": {
"command": "npx",
"args": [
"-y",
"ts-node"
]
}
}
}
Run commandnpx -y ts-node

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmts-node

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Gemini MCP Server

This project implements a Model Context Protocol (MCP) server for Google Search enabling integration with AI assistants and other MCP-compatible clients.


Prerequisites

  • Node.js 18+
  • npm

Installation

1. Clone the repository
git clone https://github.com/your-username/mcp-google-search.git
cd google-mcp-server
2. Install dependencies
npm install
3. Set up your Google Custom Search API credentials

Create a .env file in the project root with the following content:

GEMINI_API_KEY=your_google_api_key_here
  • GOOGLE_API_KEY: Your Google Custom Search API key.

You can obtain these from the Google Custom Search JSON API documentation.


Usage

1. Run a test search
npx ts-node src/test.ts

This will execute a sample search and print the results to the console.

2. Integrate with MCP-compatible clients

To use this server as part of an MCP configuration, add an entry to your MCP settings file (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "gemini-api": {
      "command": "npx",
      "args": ["ts-node", "src/index.ts"],
      "env": {
        "GEMIN_API_KEY": "your_gemini_api_key_here",
      }
    }
  }
}

Replace the API key and CX ID with your actual credentials.


Available Tools

The server provides the following tools:

  1. googleSearchContent: Performs a web search using the Google Custom Search API and returns structured results (titles, links, and snippets).
  2. googleSearchImages: Performs an image search using the Google Custom Search API and returns a Markdown image link for the first result.

Refer to the source code in src/tools.ts for detailed usage information.


Development

To make changes to the project:

  1. Modify the code in the src directory as needed.
  2. If you add or remove dependencies, update package.json accordingly.
  3. Restart your MCP client or test script to apply changes.

Troubleshooting

  • Ensure your Google API key and CX ID are correctly set in the .env file or your environment.
  • Check that all dependencies are installed (npm install).
  • Verify that you are using Node.js 18 or newer.
  • If you make changes to the code, restart your server or test script.

License

This project is licensed under the MIT License.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.