A remote Model Context Protocol (MCP) server that provides global access to Gravatar avatars, profiles, and AI-inferred interests.
See Setup for instructions on connecting to this server.
This server provides 6 comprehensive tools for accessing Gravatar data:
- Description: Retrieve comprehensive Gravatar profile information using a profile identifier
- Required inputs:
profileIdentifier
(string): A Profile Identifier (see Identifier Types section)
- Returns: Profile object as JSON with comprehensive user information
- Description: Retrieve comprehensive Gravatar profile information using an email address
- Required inputs:
email
(string): The email address associated with the Gravatar profile. Can be any valid email format - the system will automatically normalize and hash the email for lookup.
- Returns: Profile object as JSON with comprehensive user information
- Description: Fetch AI-inferred interests for a Gravatar profile using a profile identifier
- Required inputs:
profileIdentifier
(string): A Profile Identifier (see Identifier Types section)
- Returns: List of AI-inferred interest names as JSON
- Description: Fetch AI-inferred interests for a Gravatar profile using an email address
- Required inputs:
email
(string): The email address associated with the Gravatar profile. Can be any valid email format - the system will automatically normalize and hash the email for lookup.
- Returns: List of AI-inferred interest names as JSON
- Description: Retrieve the avatar image for a Gravatar profile using an avatar identifier
- Required inputs:
avatarIdentifier
(string): An Avatar Identifier (see Identifier Types section)
- Optional inputs:
size
(number, default: undefined): Desired avatar size in pixels (1-2048). Images are square, so this sets both width and height. Common sizes: 80 (default web), 200 (high-res web), 512 (large displays).defaultOption
(string, default: undefined): Fallback image style when no avatar exists. Options: '404' (return HTTP 404 error instead of image), 'mp' (mystery person silhouette), 'identicon' (geometric pattern), 'monsterid' (generated monster), 'wavatar' (generated face), 'retro' (8-bit style), 'robohash' (robot), 'blank' (transparent).forceDefault
(boolean, default: undefined): When true, always returns the default image instead of the user's avatar. Useful for testing default options or ensuring consistent placeholder images.rating
(string, default: undefined): Maximum content rating to display. 'G' (general audiences), 'PG' (parental guidance), 'R' (restricted), 'X' (explicit). If user's avatar exceeds this rating, the default image is shown instead.
- Returns: Avatar image in PNG format
- Description: Retrieve the avatar image for a Gravatar profile using an email address
- Required inputs:
email
(string): The email address associated with the Gravatar profile. Can be any valid email format - the system will automatically normalize and hash the email for lookup.
- Optional inputs:
size
(number, default: undefined): Desired avatar size in pixels (1-2048). Images are square, so this sets both width and height. Common sizes: 80 (default web), 200 (high-res web), 512 (large displays).defaultOption
(string, default: undefined): Fallback image style when no avatar exists. Options: '404' (return HTTP 404 error instead of image), 'mp' (mystery person silhouette), 'identicon' (geometric pattern), 'monsterid' (generated monster), 'wavatar' (generated face), 'retro' (8-bit style), 'robohash' (robot), 'blank' (transparent).forceDefault
(boolean, default: undefined): When true, always returns the default image instead of the user's avatar. Useful for testing default options or ensuring consistent placeholder images.rating
(string, default: undefined): Maximum content rating to display. 'G' (general audiences), 'PG' (parental guidance), 'R' (restricted), 'X' (explicit). If user's avatar exceeds this rating, the default image is shown instead.
- Returns: Avatar image in PNG format
404
: Return an HTTP 404 error instead of an image when no avatar existsmp
: (mystery-person) A simple, cartoon-style silhouetted outline of a personidenticon
: A geometric pattern based on an email hashmonsterid
: A generated 'monster' with different colors, faces, etcwavatar
: Generated faces with differing features and backgroundsretro
: Awesome generated, 8-bit arcade-style pixelated facesrobohash
: A generated robot with different colors, faces, etcblank
: A transparent PNG image
G
: Suitable for display on all websites with any audience typePG
: May contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violenceR
: May contain harsh profanity, intense violence, nudity, or hard drug useX
: May contain sexual imagery or extremely disturbing violence
Here you have multiple options to connect to Gravatar's remote MCP server. You should use your own instance (http://localhost:8787/mcp
for local development).
If your Claude Desktop app and account support adding integrations, you can add a remote server directly to Claude Desktop:
- Add a new integration
- Enter a name for your server
- Enter the URL of your remote MCP server (
http://localhost:8787/mcp
)
If your environment doesn't support that, you can connect to your remote MCP server from Claude Desktop using the mcp-remote proxy.
Follow Anthropic's Quickstart and within Claude Desktop go to Settings > Developer > Edit Config.
Update with this configuration:
{
"mcpServers": {
"gravatar": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/mcp"
]
}
}
}
For VS Code with support for Remote MCP Servers, add your server by pressing Cmd + Shift + P
(or Ctrl + Shift + P
on Windows/Linux) and type MCP: Add Server...
, then HTTP (HTTP or Server-Sent-Events)
.
For VS Code with MCP support, add the following to your User Settings (JSON) file. Press Cmd + Shift + P
(or Ctrl + Shift + P
on Windows/Linux) and type Preferences: Open Settings (JSON)
.
{
"mcp": {
"servers": {
"gravatar": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/mcp"
]
}
}
}
}
Optionally, you can add either configuration to a file called .vscode/mcp.json
in your workspace to share the configuration with others.
Note that the
mcp
key is not needed in the.vscode/mcp.json
file.
The Gravatar MCP server uses different types of identifiers to access profile and avatar data:
A Profile Identifier can be one of the following:
- SHA256 Hash (preferred): An email address that has been normalized (lower-cased and trimmed) and then hashed with SHA256
- MD5 Hash (deprecated): An email address that has been normalized (lower-cased and trimmed) and then hashed with MD5
- URL Slug: The username portion from a Gravatar profile URL (e.g., 'username' from gravatar.com/username)
An Avatar Identifier is an email address that has been normalized (lower-cased and trimmed) and then hashed with either:
- SHA256 (preferred)
- MD5 (deprecated)
Important: Unlike Profile Identifiers, Avatar Identifiers cannot use URL slugs - only email hashes are supported.
When using email-based tools, you can provide any valid email format. The system will automatically:
- Normalize the email (convert to lowercase and trim whitespace)
- Generate the appropriate hash for API requests
- Process the email securely without storing it
The server works without authentication, but you can optionally configure a Gravatar API key to access additional profile fields.
Set the API key as an environment variable:
export GRAVATAR_API_KEY=your-api-key-here
Create a .env
file in the project root:
# .env
GRAVATAR_API_KEY=your-api-key-here
This file is automatically loaded during local development and should not be committed to version control (it's already in .gitignore
).
Configure these environment variables depending on your needs:
# Required for remote access
MCP_TRANSPORT=http
# Server configuration
HOST=0.0.0.0 # Listen on all interfaces
PORT=8787 # Default port (or use PORT from hosting provider)
# Security settings (recommended for production)
ENABLE_DNS_REBINDING_PROTECTION=true
ALLOWED_HOSTS=your-domain.com,www.your-domain.com
ALLOWED_ORIGINS=https://your-domain.com,https://www.your-domain.com
# Optional Gravatar API key for enhanced features
GRAVATAR_API_KEY=your-api-key-here
# Debug output (disable in production)
DEBUG=false
Start the development server for testing:
# Install dependencies
npm install
# Start in HTTP mode for remote access
npm run dev:http
# Or start in STDIO mode for local testing
npm run dev
This will start the HTTP server at http://localhost:8787
with hot reloading enabled.
This remote MCP server is built with Node.js and Express.js and features:
- OpenAPI Generated Client: TypeScript client generated from Gravatar's OpenAPI specification for profile and interests endpoints
- Direct HTTP Calls: Native fetch() for avatar image retrieval with proper MIME type detection
- Remote Access: StreamableHTTP transport for MCP communication over the network
- Global Deployment: Deploy to any Node.js hosting platform for worldwide access
- No API Key Required: Simplified deployment without authentication requirements
The server uses a dynamic schema generation system:
# Extract MCP schemas from OpenAPI specification
npm run extract-schemas
This generates Zod schemas from the OpenAPI spec for input validation and output formatting, ensuring type safety and MCP compliance.
This server is optimized for remote deployment with:
- Node.js Runtime: Express.js HTTP server for reliable network access
- StreamableHTTP Transport: Modern MCP transport for remote clients
- Environment Configuration: Flexible deployment options via environment variables
- Security Features: DNS rebinding protection and CORS configuration
- Global Distribution: Deploy anywhere Node.js is supported
The server operates without API key authentication by default, which means:
- Standard Gravatar API rate limits apply
- All requests appear from your server's IP address
- Consider implementing client-side rate limiting for high-volume usage
- Node.js: 22.0.0 or higher
- npm: 10.0.0 or higher
This remote MCP server is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MPL-2.0. For more details, please see the LICENSE file in the project repository.
- STDIO Gravatar MCP Server - The original local Node.js version
- Gravatar API Documentation - Official Gravatar API documentation
- Model Context Protocol - Learn more about MCP