mcp-giphy-media-retriever
Interface for querying and fetching animated images (GIFs) from the Giphy service, with integrated content moderation capabilities.
Author

magarcia
Quick Info
Actions
Tags
MCP Giphy Media Retriever
An MCP server implementation designed to interface with the Giphy API, allowing sophisticated AI agents to discover, retrieve, and deploy visual reaction content.
Core Functionality
- Safety Guardrails: Enables stringent filtering of results based on maturity ratings (G, PG, PG-13, R) for content compliance.
- AI-Optimized Output: Structures returned data into a format easily parsable by machine learning models.
- Versatile Access: Supports searching by keyword, fetching spontaneous random media, and retrieving currently popular items.
- Rich Context: Provides complete associated data for every returned media object, including dimensions and source attribution.
- Efficient Paging: Implements result set management for optimized handling of large data volumes.
Available Toolset
-
execute_gif_search -
Executes a keyword-based search across the Giphy catalog.
- Parameters:
term(string): The phrase or subject to search for.count(optional number): Desired quantity of results (default: 10; maximum allowed: 50).start_index(optional number): Offset for pagination (default: 0).maturity_filter(optional string): Content restriction level (g, pg, pg-13, r).locale(optional string): Language designator (default: 'en').
-
Output: A collection of GIF object records, each detailed with comprehensive metadata.
-
fetch_spontaneous_media -
Retrieves a single, randomly selected GIF, optionally constrained by a thematic tag.
- Parameters:
theme_tag(optional string): A keyword to narrow the randomness.safety_level(optional string): Content rating filter (g, pg, pg-13, r).
-
Output: A singular, randomly chosen GIF object including its associated data.
-
capture_current_trends -
Fetches the currently most popular animated media on the platform.
- Parameters:
result_count(optional number): The maximum number of trending items to retrieve (default: 10; maximum allowed: 50).page_offset(optional number): Pagination starting point (default: 0).restriction(optional string): Maturity classification filter (g, pg, pg-13, r).
- Output: An array containing the top trending GIF objects with full metadata.
Data Structure Details
Each returned GIF artifact contains:
identifier: The unique Giphy ID string.caption: The descriptive title assigned to the GIF.asset_link: The canonical URL pointing to the GIF on the Giphy platform.visual_data: An object detailing various file formats, each containing:source_url: Direct link to the image file.pixel_width: Horizontal resolution.pixel_height: Vertical resolution.- Supplementary descriptive fields where available.
Deployment Requirements
Giphy Access Credential
Acquire your unique authorization token here: Giphy Developer Dashboard Access:
- Register for a Giphy Developer account.
- Instantiate a new application to obtain the necessary API key.
- Select the appropriate service tier.
Environment Variable Setup
Place your credential in a configuration file named .env:
GIPHY_API_KEY=your_secret_key_here
Integration with Local Environment
For use within the Claude Desktop framework, update your configuration file (claude_desktop_config.json) as follows:
{
"mcpServers": {
"giphy_media": {
"command": "npx",
"args": ["-y", "mcp-server-giphy"],
"env": {
"GIPHY_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
Development Workflow
# Dependency acquisition
npm install
# Project compilation
npm run build
# Server initiation
npm start
# Live reloading development session
npm run dev
# Test suite execution
npm test
# Inspection utility activation
npm run inspector
Software Licensing
This server module operates under the permissive MIT License. Modifications, distribution, and utilization are permitted subject to the terms outlined in the accompanying LICENSE file within the source repository.
CONTEXT_WIKIPEDIA_NOTE: XMLHttpRequest (XHR) serves as an Application Programming Interface, implemented as a JavaScript object, facilitating the transmission of HTTP requests from a web browser client to a remote web server. Its methods permit browser-based applications to initiate server communications post-page-load and subsequently receive data back. XHR is foundational to Ajax techniques. Before Ajax, server interaction relied predominantly on conventional hyperlink navigation or form submissions, processes that typically necessitated a full page refresh.
== Historical Context ==
The underlying concept for XMLHttpRequest was formulated in the year 2000 by the development team at Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). Note that the original implementation did not utilize the literal identifier XMLHttpRequest. Instead, developers employed COM identifiers: ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer 7 (2006), standardization led to universal adoption of the XMLHttpRequest identifier across all major browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Specification Progression === The World Wide Web Consortium (W3C) published the initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. A subsequent Level 2 specification was released by the W3C on February 25, 2008. Level 2 introduced enhanced capabilities such as progress monitoring, support for cross-origin requests, and binary stream handling. By the close of 2011, the Level 2 features were formally merged back into the primary specification. In 2012, development responsibility transitioned to the WHATWG, which maintains the active document using the Web IDL standard.
== Operational Procedure == Generally, dispatching a request using XMLHttpRequest involves several sequential programming stages.
- Instantiate the XMLHttpRequest client object by invoking its constructor:
- Invoke the
openmethod to define the request method (e.g., GET/POST), specify the target resource URI, and select synchronous or asynchronous execution mode: - For asynchronous operations, assign an event handler function that is triggered upon state transitions:
- Initiate the network transmission by calling the
sendmethod, optionally passing payload data: - Process state changes within the event handler. Upon successful data reception, the server response payload is typically held in the
responseTextproperty. When processing completes, the state transitions to 4 (the 'done' state). Beyond these fundamental steps, XHR offers extensive configuration for request control and response parsing. Custom HTTP headers can be injected to dictate server behavior, and data for upload can be supplied via thesendargument. Responses can be immediately parsed from JSON into native JavaScript structures or processed incrementally as they arrive instead of waiting for the full corpus. Furthermore, the request can be terminated early or configured with a timeout threshold.
