Getting Started
This guide covers building the server, authenticating with Google, and connecting it to an MCP client.
Prerequisites
- Go 1.27.1 or later — the
godirective ingo.modrequires this version; older toolchains refuse to build. - A Google Cloud project with the Blogger API enabled.
- OAuth credentials — create an OAuth client ID of type Desktop app in Google Cloud Console and download the credentials file as
credentials.json.
Building
cd /path/to/blogger-mcp
go build -o bin/blogger-mcp .The binary is written to bin/blogger-mcp.
Authentication
Run the auth subcommand once. It opens your browser, waits for the Google consent screen, and writes a token file that the server reuses from then on.
./bin/blogger-mcp auth \
-credentials /path/to/credentials.json \
-token /path/to/token.jsonWhat happens during the run:
- The OAuth consent URL prints to stderr and your browser opens to it.
- A local callback server listens on
127.0.0.1:8085(change with-port). - After you approve, the code is exchanged for a token, which is written to the token path with
0600permissions.
The token carries a refresh token, so the server renews access on its own at runtime. You only re-run auth if you revoke access or rotate credentials.
If you omit the paths, auth falls back to the defaults listed in Configuration.
Using with an MCP client
Clients that read an mcpServers block, such as Claude Code and Cursor, need the absolute path to the binary:
{
"mcpServers": {
"blogger-mcp": {
"command": "/absolute/path/to/bin/blogger-mcp",
"args": [
"-credentials",
"/absolute/path/to/credentials.json",
"-token",
"/absolute/path/to/token.json"
]
}
}
}If you keep both files in the default locations, you can drop args entirely and set the environment variables instead:
{
"mcpServers": {
"blogger-mcp": {
"command": "/absolute/path/to/bin/blogger-mcp",
"env": {
"BLOGGER_MCP_CREDENTIALS": "/absolute/path/to/credentials.json",
"BLOGGER_MCP_TOKEN": "/absolute/path/to/token.json"
}
}
}
}The server speaks stdio, so keep args free of anything that writes to stdout.