MCP Server built for use with VS Code / Cline / Anthropic - enable google search and ability to follow links and research websites
An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
npm install
npm run build
You can either set these as system environment variables or configure them in your MCP settings file.
Required environment variables:
GOOGLE_API_KEY
: Your Google API keyGOOGLE_SEARCH_ENGINE_ID
: Your Custom Search Engine ID%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):{
"mcpServers": {
"google-search": {
"autoApprove": [
"google_search",
"extract_webpage_content",
"extract_multiple_webpages"
],
"disabled": false,
"timeout": 60,
"command": "node",
"args": [
"/path/to/google-search-mcp-server/dist/google-search.js"
],
"env": {
"GOOGLE_API_KEY": "your-google-api-key",
"GOOGLE_SEARCH_ENGINE_ID": "your-custom-search-engine-id"
},
"transportType": "stdio"
}
}
}
Start the MCP server:
npm run start
Search Google and return relevant results from the web. This tool finds web pages, articles, and information on specific topics using Google's search engine.
{
"name": "google_search",
"arguments": {
"query": "your search query",
"num_results": 5, // optional, default: 5
"site": "example.com", // optional, limit results to specific website
"language": "en", // optional, filter by language (ISO 639-1 code)
"dateRestrict": "m6", // optional, filter by date (e.g., "m6" for last 6 months)
"exactTerms": "exact phrase", // optional, search for exact phrase
"resultType": "news", // optional, specify type (news, images, videos)
"page": 2, // optional, page number for pagination (starts at 1)
"resultsPerPage": 10, // optional, results per page (max: 10)
"sort": "date" // optional, sort by "date" or "relevance" (default)
}
}
Response includes:
Extract and analyze content from a webpage, converting it to readable text. This tool fetches the main content while removing ads, navigation elements, and other clutter.
{
"name": "extract_webpage_content",
"arguments": {
"url": "https://example.com",
"format": "markdown" // optional, format options: "markdown" (default), "html", or "text"
}
}
Response includes:
Extract and analyze content from multiple webpages in a single request. Ideal for comparing information across different sources or gathering comprehensive information on a topic.
{
"name": "extract_multiple_webpages",
"arguments": {
"urls": [
"https://example1.com",
"https://example2.com"
],
"format": "html" // optional, format options: "markdown" (default), "html", or "text"
}
}
Response includes:
The server provides detailed error messages for:
The server is built with TypeScript and uses the MCP SDK to provide a standardized interface for AI models to interact with Google Search and webpage content analysis tools. It consists of two main services:
The server uses caching mechanisms to improve performance and reduce API calls.
If you prefer to distribute only the built version of this tool rather than the source code, you can follow these steps:
npm run build
# Create a distribution directory
mkdir -p dist-package
# Copy the compiled JavaScript files
cp -r dist dist-package/
# Copy package files (without dev dependencies)
cp package.json dist-package/
cp README.md dist-package/
# Create a simplified package.json for distribution
node -e "const pkg = require('./package.json'); delete pkg.devDependencies; delete pkg.scripts.build; delete pkg.scripts.dev; pkg.scripts.start = 'node dist/google-search.js'; require('fs').writeFileSync('dist-package/package.json', JSON.stringify(pkg, null, 2));"
# Install production dependencies only
npm install --production
# Start the server
npm start
This approach allows you to distribute the compiled JavaScript files without exposing the TypeScript source code. Users will still need to:
Note that the package.json in the distribution will only include production dependencies and a simplified set of scripts.
MIT
No configuration available
This service may require manual configuration, please check the details on the left
Related projects feature coming soon
Will recommend related projects based on sub-categories