Mcp Google サーバー A Google カスタム検索とウェブページ読み取りのための Mcp サーバー
概要
mcp-google-searchとは?
mcp-google-searchは、ユーザー### adenotによってGitHubに作成された公開リポジトリです。このプロジェクトは、Google内の検索機能を強化することに焦点を当てており、ユーザーに改善された検索結果や機能を提供する可能性があります。オープンソースソリューションとして設計されており、開発者が機能を追加・強化できるようになっています。
mcp-google-searchの特徴
- オープンソース:リポジトリは公開されており、誰でもコードを閲覧、使用、貢献することができます。
- 検索機能の強化:プロジェクトは、ユーザーがGoogle検索と対話する方法を改善し、検索プロセスを効率化する機能を提供することを目指しています。
- コミュニティ主導:オープンソースプロジェクトとして、開発者間のコラボレーションを促進し、その成長と改善に貢献できるコミュニティを育成します。
- ドキュメント:リポジトリの機能を効果的に実装し利用するための包括的なドキュメントが提供されています。
mcp-google-searchの使い方
-
リポジトリをクローンする:次のコマンドを使用して、リポジトリをローカルマシンにクローンします。
git clone https://github.com/adenot/mcp-google-search.git
-
依存関係をインストールする:プロジェクトディレクトリに移動し、必要な依存関係をインストールします。これは通常、プロジェクトの設定に応じてnpmやyarnなどのパッケージマネージャを使用して行います。
-
アプリケーションを実行する:ドキュメントの指示に従ってアプリケーションを実行します。これには、ローカルサーバーを起動したり、特定のスクリプトを実行したりすることが含まれる場合があります。
-
貢献する:プロジェクトに貢献したい場合は、リポジトリに提供されている貢献ガイドラインを確認してください。問題を報告したり、機能リクエストを提出したり、改善を加えたプルリクエストを送信することができます。
よくある質問
mcp-google-searchで使用されているプログラミング言語は何ですか?
プロジェクトは主にJavaScriptを使用していますが、フロントエンド開発のためにHTMLやCSSも含まれている場合があります。
問題やバグを報告するにはどうすればよいですか?
リポジトリの「Issues」タブに移動し、問題の詳細情報を含む新しい問題を提出することで報告できます。
mcp-google-searchにはライセンスがありますか?
はい、リポジトリはMITライセンスの下でライセンスされており、ソフトウェアの自由な使用、改変、配布を許可しています。
リポジトリの変更について最新情報を得るにはどうすればよいですか?
GitHubでリポジトリをウォッチすることで更新通知を受け取ることができます。また、利用可能な場合はソーシャルメディアプラットフォームでプロジェクトをフォローすることもできます。
プロジェクトに貢献できますか?
もちろんです!貢献は歓迎されます。参加方法についての詳細は、リポジトリの貢献ガイドラインを参照してください。
詳細
mcp-google-server A MCP Server for Google Custom Search and Webpage Reading
A Model Context Protocol server that provides web search capabilities using Google Custom Search API and webpage content extraction functionality.
Setup
Getting Google API Key and Search Engine ID
-
Create a Google Cloud Project:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable billing for your project
-
Enable Custom Search API:
- Go to API Library
- Search for "Custom Search API"
- Click "Enable"
-
Get API Key:
- Go to Credentials
- Click "Create Credentials" > "API Key"
- Copy your API key
- (Optional) Restrict the API key to only Custom Search API
-
Create Custom Search Engine:
- Go to Programmable Search Engine
- Enter the sites you want to search (use www.google.com for general web search)
- Click "Create"
- On the next page, click "Customize"
- In the settings, enable "Search the entire web"
- Copy your Search Engine ID (cx)
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
Features
Search Tool
Perform web searches using Google Custom Search API:
- Search the entire web or specific sites
- Control number of results (1-10)
- Get structured results with title, link, and snippet
Webpage Reader Tool
Extract content from any webpage:
- Fetch and parse webpage content
- Extract page title and main text
- Clean content by removing scripts and styles
- Return structured data with title, text, and URL
Installation
Installing via Smithery
To install Google Custom Search Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @adenot/mcp-google-search --client claude
To use with Claude Desktop, add the server config with your Google API credentials:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"google-search": {
"command": "npx",
"args": [
"-y",
"@adenot/mcp-google-search"
],
"env": {
"GOOGLE_API_KEY": "your-api-key-here",
"GOOGLE_SEARCH_ENGINE_ID": "your-search-engine-id-here"
}
}
}
}
Usage
Search Tool
{
"name": "search",
"arguments": {
"query": "your search query",
"num": 5 // optional, default is 5, max is 10
}
}
Webpage Reader Tool
{
"name": "read_webpage",
"arguments": {
"url": "https://example.com"
}
}
Example response from webpage reader:
{
"title": "Example Domain",
"text": "Extracted and cleaned webpage content...",
"url": "https://example.com"
}
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
サーバー設定
{
"mcpServers": {
"mcp-google-search": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--adenot--mcp-google-search--mcp-google-search",
"node ./build/index.js"
],
"env": {
"GOOGLE_API_KEY": "google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "google-search-engine-id"
}
}
}
}