Google Business Profile Review MCP Server
Enables AI assistants to fetch, analyze, and respond to Google Business Profile reviews with AI-generated replies through secure OAuth integration with Google's My Business API.
README
Google Business Profile Review MCP Server
A Model Context Protocol (MCP) server that enables AI assistants to manage Google Business Profile reviews through intelligent automation.
Features
- Review Management: Fetch and analyze Google Business Profile reviews
- AI-Powered Responses: Generate contextually appropriate replies using LLM sampling
- Automated Posting: Post replies back to Google Business Profile
- OAuth Integration: Secure authentication with Google APIs
- Rate Limiting: Respectful API usage with built-in rate limiting
- Structured Logging: Comprehensive logging for debugging and monitoring
Prerequisites
- Node.js 18.0.0 or higher
- Google Cloud Platform account with My Business API enabled
- Google OAuth 2.0 credentials
- Google Business Profile API Access (see requirements below)
Google Business Profile API Access Requirements
Before you can use this MCP server, you must request and be approved for Google Business Profile API access. Google requires all applicants to:
- Manage a verified Google Business Profile that has been active for 60+ days
- This can be your own business or a client's business you manage
- Have a website representing the business listed on the Google Business Profile
- Complete Google Business Profile with current, up-to-date information
To request API access:
- Go to the Google Cloud Console and note your Project Number from the Project info card
- Submit your request using the GBP API contact form
- Select "Application for Basic API Access" from the dropdown
- Provide your Project Number and all requested information
- Use an email address listed as an owner/manager on your business's GBP
- Wait for review - you'll receive a follow-up email with the decision
Check approval status by viewing quotas in Google Cloud Console:
- 0 QPM (Queries Per Minute) = Not yet approved
- 300 QPM = Approved ✓
For complete prerequisites, see the official GBP API documentation.
Setup
1. Google Cloud Configuration
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Request GBP API access (see requirements above - this step is critical and may take time for approval)
- Enable the following APIs (after your project is approved):
- Go to "APIs & Services" > "Library"
- Search for and enable "Google My Business API"
- Search for and enable "My Business Account Management API"
- Create OAuth 2.0 credentials:
- Go to "Credentials" in the API & Services section
- Click "Create Credentials" > "OAuth 2.0 Client IDs"
- Set application type to "Web application"
- Add authorized redirect URI:
http://localhost:3000/auth/callback - Note down the Client ID and Client Secret
- Configure OAuth Consent Screen:
- Go to "APIs & Services" > "OAuth consent screen"
- Add test users (your Google account email that has access to the business profile)
- Add required scopes:
business.manage,userinfo.email,userinfo.profile
2. Installation
# Clone the repository
git clone <repository-url>
cd review-mcp
# Install dependencies
npm install
# Build the project
npm run build
3. Configuration
# Copy the environment template
cp .env.example .env
# Edit .env with your credentials
# Add your Google OAuth credentials and other settings
Required environment variables:
GOOGLE_CLIENT_ID: Your Google OAuth 2.0 Client IDGOOGLE_CLIENT_SECRET: Your Google OAuth 2.0 Client SecretGOOGLE_REDIRECT_URI: OAuth redirect URI (default: http://localhost:3000/auth/callback)
4. Authentication
Before running the server, you need to authenticate with Google:
# Run the authentication helper
npm run auth
This will:
- Open your browser to Google's authentication page
- Ask you to grant permissions to access your Google Business Profile
- Save the authentication tokens locally
- These tokens will be automatically used by the MCP server
5. Running the Server
# Start the server with your authenticated credentials
npm start
# Or in development/mock mode for testing
npm run start:mock
The server will start with STDIO transport for MCP communication.
Usage
Connecting to MCP Clients
You can connect to this server using any MCP-compatible client:
VS Code (GitHub Copilot)
Add to your VS Code MCP settings file (mcp.json):
Windows: %APPDATA%\Code\User\profiles\<profile-id>\mcp.json
macOS/Linux: ~/.config/Code/User/profiles/<profile-id>/mcp.json
{
"servers": {
"google-business-reviews": {
"type": "stdio",
"command": "node",
"args": [
"C:\\path\\to\\review-mcp\\build\\index.js"
],
"cwd": "C:\\path\\to\\review-mcp",
"env": {
"NODE_ENV": "production",
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/auth/callback",
"LOG_LEVEL": "info"
},
"description": "Google Business Profile Review MCP Server - Manage reviews with AI-powered responses"
}
}
}
Important Notes:
- Replace
C:\\path\\to\\review-mcpwith the actual path to your project - Use double backslashes (
\\) in Windows paths - Replace
your-client-idandyour-client-secretwith your actual OAuth credentials - Make sure to run
npm run authfirst to authenticate before using in VS Code - Restart VS Code after adding the configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"google-business-reviews": {
"command": "node",
"args": ["/path/to/review-mcp/build/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/auth/callback"
}
}
}
}
HTTP Clients
Connect to: http://localhost:3000/mcp
Available Tools
list_locations: Get all business locations associated with your accountget_reviews: Fetch reviews for a specific locationgenerate_reply: Generate an AI response to a reviewpost_reply: Post a reply to a review on Google Business Profile
Available Resources
business_profile: Business profile information and settingsreview_templates: Pre-defined response templates
Available Prompts
review_response: Generate professional review responsessentiment_analysis: Analyze review sentiment
Development
Project Structure
src/
├── index.ts # Main server entry point
├── server/ # MCP server implementation
│ ├── mcpServer.ts # Core MCP server setup
│ ├── tools/ # Tool implementations
│ ├── resources/ # Resource implementations
│ └── prompts/ # Prompt implementations
├── services/ # Business logic services
│ ├── googleAuth.ts # Google OAuth handling
│ ├── reviewService.ts # Review management
│ └── llmService.ts # LLM interaction
├── types/ # TypeScript type definitions
└── utils/ # Utility functions
Scripts
npm run dev: Start development server with hot reloadnpm run build: Build the TypeScript projectnpm run lint: Run ESLintnpm run test: Run testsnpm run clean: Clean build directory
API Documentation
Authentication Flow
- User initiates OAuth flow through the MCP client
- Server redirects to Google OAuth consent screen
- User grants permissions for Google My Business access
- Server receives authorization code and exchanges for access token
- Token is stored securely for subsequent API calls
Rate Limiting
The server implements rate limiting to respect Google API quotas:
- 60 requests per minute per user (configurable)
- Exponential backoff for failed requests
- Graceful error handling for quota exceeded
Security Considerations
- All Google API calls use OAuth 2.0 authentication
- Access tokens are stored securely and refreshed automatically
- Input validation and sanitization for all user inputs
- Rate limiting to prevent abuse
- Comprehensive logging for security monitoring
Troubleshooting
Common Issues
- OAuth Error: Ensure redirect URI matches exactly what's configured in Google Cloud Console
- API Quota Exceeded: Check your Google Cloud Console for API usage and limits
- Permission Denied: Verify the Google account has access to the business profile
Logging
Enable debug logging by setting LOG_LEVEL=debug in your .env file.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the troubleshooting section
- Review the logs with debug level enabled
- Open an issue on GitHub with detailed information about the problem
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。