Sponsored by Deepsite.site

Gemini MCP Server

Created By
rtbui20127 months ago
Content

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

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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
Tavily Mcp
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™