An implementation of Giphy integration with Model Context Protocol
Configuration
View docs{
"mcpServers": {
"magarcia-mcp-server-giphy": {
"command": "npx",
"args": [
"-y",
"mcp-server-giphy"
],
"env": {
"GIPHY_API_KEY": "<YOUR_API_KEY>"
}
}
}
}You can run a dedicated MCP server that exposes Giphy GIFs to AI models. It fetches, filters, and formats GIF data with full metadata so your models can search, retrieve, and incorporate GIFs efficiently while respecting content ratings and pagination.
You interact with the Giphy MCP Server through an MCP-enabled client. Use the available tools to search for GIFs, fetch a random GIF, or retrieve trending GIFs. Each GIF entry includes essential metadata such as the image formats, dimensions, and attribution. Apply content rating filters (G, PG, PG-13, R) to ensure content suitability. Use the tools to build AI-assisted workflows that require visual media from Giphy without exposing raw web pages.
Prerequisites you need before installation: a runtime environment that supports Node.js and npm. Ensure you have Node.js and npm installed on your system.
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
# Run in development mode with hot reloading
npm run dev
# Run tests
npm test
# Use with MCP Inspector
npm run inspectorNote: To use the server with an MCP client like Claude Desktop, you can configure an MCP connection that runs the server via npx and passes your API key as an environment variable. The example below shows how to configure the client to start the MCP using the package name and a key placeholder.
Create a GIPHY API key by signing up as a Giphy Developer and creating an app to obtain the key. Then place the key in your environment or a configuration file as shown.
json
{
"mcpServers": {
"giphy": {
"command": "npx",
"args": ["-y", "mcp-server-giphy"],
"env": {
"GIPHY_API_KEY": "<YOUR_API_KEY>"
}
}
}
}GIPHY_API_KEY=your_api_key_hereThe server provides three core tools for interacting with GIF data. Use these through your MCP client to build richer media-enabled AI experiences. Remember to keep your API key secure and avoid exposing it in client-side code.
Search GIFs on Giphy with a query string, returning an array of GIF objects with metadata. Supports limit, offset, rating, and language filters.
Retrieve a random GIF, with optional tag filtering and content rating. Returns a random GIF object with full metadata.
Fetch currently trending GIFs with optional limit, offset, and rating filters. Returns an array of GIF objects with metadata.