Skip to main content
Glama
narkov

Google Business Profile MCP Server

by narkov
README.md
# Google Business Profile MCP Server

An MCP (Model Context Protocol) server that lets AI assistants manage your Google Business Profile — create posts, reply to reviews, list locations, and more.

Built for use with [Claude Code](https://docs.anthropic.com/en/docs/claude-code), [Cursor](https://cursor.com), and other MCP-compatible AI tools.

## Features

| Tool | Description |
|---|---|
| `gbp_list_accounts` | List all GBP accounts |
| `gbp_list_locations` | List business locations for an account |
| `gbp_create_post` | Create a post (standard, event, or offer) with optional photo/video and CTA button |
| `gbp_list_posts` | List posts for a location |
| `gbp_get_post` | Get details of a specific post |
| `gbp_update_post` | Update a post's text or call-to-action |
| `gbp_delete_post` | Delete a post |
| `gbp_list_reviews` | List reviews for a location |
| `gbp_get_review` | Get a specific review |
| `gbp_reply_review` | Reply to a review on behalf of the business |
| `gbp_delete_review_reply` | Delete a business reply to a review |
| `gbp_list_media` | List media (photos/videos) for a location |

### Post types

- **Standard** — text + optional image + optional CTA button (Learn More, Book, Shop, etc.)
- **Event** — with title, start/end dates and times
- **Offer** — with coupon code, terms, and redeem URL

## Prerequisites

1. A [Google Cloud project](https://console.cloud.google.com/) with the **My Business Business Information API** and **My Business Account Management API** enabled
2. An **OAuth 2.0 Client ID** (Desktop or Web type) with `http://localhost:3456/callback` as an authorized redirect URI
3. Your Google account must have access to a [Google Business Profile](https://business.google.com/)

## Setup

### 1. Clone and install

```bash
git clone https://github.com/narkov/gbp-mcp.git
cd gbp-mcp
npm install
npm run build
```

### 2. Configure credentials

Copy the example env file and fill in your OAuth credentials:

```bash
cp .env.example .env
```

Edit `.env`:

```
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-your-secret
```

### 3. Authorize with Google (one-time)

```bash
npm run auth
```

This opens a browser for Google OAuth consent. After approval, tokens are saved to `credentials/gbp-tokens.json` and auto-refresh on subsequent use.

### 4. Add to your MCP client

#### Claude Code (`.mcp.json`)

```json
{
  "mcpServers": {
    "gbp": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/gbp-mcp",
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "GOCSPX-your-secret"
      }
    }
  }
}
```

#### Cursor (`~/.cursor/mcp.json`)

Same format as above.

## Usage examples

Once connected, your AI assistant can:

```
"List all my GBP locations"
"Create a post on my Kyiv location about a spring sale with a Shop Now button"
"Show me recent reviews and draft replies for negative ones"
"Delete last week's expired offer post"
```

## API reference

This server uses the following Google APIs:

- [My Business Account Management API](https://developers.google.com/my-business/reference/accountmanagement/rest) — accounts
- [My Business Business Information API](https://developers.google.com/my-business/reference/businessinformation/rest) — locations
- [Google My Business API v4](https://developers.google.com/my-business/reference/rest) — posts, reviews, media

## License

MIT