Mira API - MCP Server

MCP is quickly becoming the recognized standard for integrating remote tools and resources into LLMs.

In this guide we’ll explain the new MCP Server integration option for the Mira API, by showing how you can integrate Mira with OpenAI.

This guide is largely based on the OpenAI Remote MCP guide - and we won’t repeat the Responses API options and descriptions here. Please refer to the original guide for full details, and code samples in other programming languages.

Before you start

To run through this tutorial, you will need:

  • Your Meltwater API token
  • Access to the Mira API Beta program
  • Access to Open AI, and your Open AI API token

Meltwater API MCP Server Specification

The Meltwater API MCP Server exposes the following description and tools to LLMs:

{
    "jsonrpc": "2.0",
    "id": 2,
    "result": {
        "tools": [
            {
                "annotations": {
                    "destructiveHint": false,
                    "openWorldHint": true,
                    "readOnlyHint": true
                },
                "description": "Ask Meltwater's MIRA assistant about stories, trends, and topics in news or social media.\n\nUse natural language queries like 'What were the top stories for Microsoft last week?' or 'How is climate change being discussed on social media?'\n\nAccess current news stories, social media trends, and emerging topics across global media sources.\nGet insights on brand sentiment, competitive analysis, and industry developments.\nUnderstand social media conversations, influencer discussions, and public opinion trends.\nAnalyze breaking news, story development, and media coverage patterns.",
                "inputSchema": {
                    "type": "object",
                    "required": [
                        "prompt"
                    ],
                    "properties": {
                        "project_id": {
                            "type": [
                                "null",
                                "string"
                            ],
                            "description": "Project ID to tailor the responses to a specific project's system prompt. (optional)"
                        },
                        "prompt": {
                            "type": "string",
                            "description": "Prompt to send to the conversational chat"
                        }
                    },
                    "additionalProperties": false
                },
                "name": "ask"
            },
            {
                "annotations": {
                    "destructiveHint": false,
                    "openWorldHint": true,
                    "readOnlyHint": true
                },
                "description": "Retrieve a list of Mira API projects with their associated ids.\n    \nThese project ids can be passed into the ask tool to tailor the responses to a specific project.",
                "inputSchema": {
                    "type": "object",
                    "properties": {
                        "page": {
                            "type": [
                                "null",
                                "integer"
                            ],
                            "description": "Page number for the project list. Default is 1. (optional)"
                        },
                        "page_size": {
                            "type": [
                                "null",
                                "integer"
                            ],
                            "description": "Number of projects to return per page. Default is 100. (optional)"
                        },
                        "sort": {
                            "type": [
                                "null",
                                "string"
                            ],
                            "description": "Sort direction for the project list. Can be either asc or desc. Default is desc. (optional)"
                        }
                    },
                    "additionalProperties": false
                },
                "name": "list_projects",
                "outputSchema": {
                    "type": "object",
                    "required": [
                        "projects",
                        "pagination"
                    ],
                    "properties": {
                        "pagination": {
                            "type": "object",
                            "required": [
                                "page",
                                "page_size",
                                "total_items",
                                "total_pages"
                            ],
                            "properties": {
                                "page": {
                                    "type": "integer"
                                },
                                "page_size": {
                                    "type": "integer"
                                },
                                "total_items": {
                                    "type": "integer"
                                },
                                "total_pages": {
                                    "type": "integer"
                                }
                            },
                            "additionalProperties": false
                        },
                        "projects": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "name",
                                    "share_level",
                                    "created_at",
                                    "updated_at"
                                ],
                                "properties": {
                                    "created_at": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "share_level": {
                                        "type": "string"
                                    },
                                    "updated_at": {
                                        "type": "string"
                                    }
                                },
                                "additionalProperties": false
                            }
                        }
                    },
                    "additionalProperties": false
                }
            }
        ]
    }
}

Note the descriptions provided in the specification as these are critical to how an LLM will select the tools exposed, and how it will form prompts when calling those tools.

Specifying an MCP Server in OpenAI

The OpenAI Responses API uses the following structure to reference remote MCP servers:

{
    "type": "mcp",
    "server_label": "meltwater-api",
    "server_url": "https://api.meltwater.com/mcp",
    "require_approval": "never",
    "headers": {
        "apikey": <YOUR MELTWATER API KEY>
    }
}

Here the critical fields are:

  • server_url: The URL for the Meltwater MCP server.
  • apikey: Your Meltwater API key, which will be sent as a header in requests to the server by OpenAI.

Calling the Responses API

Using the MCP approach, it’s incredibly simple to call the Responses API including the MCP server tools.

This example code calls the Responses API, and provides a simple prompt for a news brief. Because of the description provided by the Meltwater MCP server, the LLM should know to direct questions regarding news and social insights to the Mira API.

from openai import OpenAI

client = OpenAI(api_key=<YOUR OPENAI API KEY>)

resp = client.responses.create(
    model="gpt-4.1",
    tools=[
        {
            "type": "mcp",
            "server_label": "meltwater-api",
            "server_url": "https://api.meltwater.com/mcp",
            "require_approval": "never",
            "headers": {
                "apikey": <YOUR MELTWATER API KEY>
              }
        },
    ],
    input="What is going on in the news with fast fashion in the last 7 days?",
)

print(resp.output_text)

The output from the Responses API call will be returned in Markdown format. For our example prompt, the first few paragraphs of the output were:

1. **Shein Opens First Permanent Physical Stores in France**
   - Overview: Shein, the Asian fast-fashion giant, is launching its first permanent physical outlets in France, starting with Paris and expanding to five other cities. The move comes amid criticism over Shein's environmental impact and working conditions, as well as recent French legislation targeting fast-fashion brands. The new stores are expected to create jobs and revitalize city centers, but have sparked backlash and regulatory scrutiny [Shein picks France to open its first permanent outlets](https://www.bbc.com/news/articles/ckg2p87de58o), [Shein is opening its first physical stores](https://www.theverge.com/news/791000/shein-france-physical-store-chinese-ecommerce-fast-fashion) [Shein plans first permanent stores in France, sparking backlash](https://www.reuters.com/business/retail-consumer/shein-plans-first-permanent-stores-france-sparking-backlash-2025-10-02/), [Shein enters bricks-and-mortar retail in France, sparking backlash](https://www.straitstimes.com/world/europe/shein-enters-bricks-and-mortar-retail-in-france-sparking-backlash) [Shein plans first permanent stores in France, sparking backlash](https://www.thestar.com.my/business/business-news/2025/10/02/shein-plans-first-permanent-stores-in-france-sparking-backlash).

2. **Shein Must Face Trademark and Copyright Lawsuits from Rival Temu**
   - Overview: Shein is embroiled in legal battles with rival Temu, as a US federal judge ruled that Shein must face claims of copyright and trademark infringement. The lawsuits allege a “bad-faith campaign” against Temu and highlight ongoing competition and legal challenges within the ultra-fast fashion sector [Shein Fails to Escape Rival Temu’s Trademark, Copyright Lawsuit](https://news.bloomberglaw.com/ip-law/shein-fails-to-escape-rival-temus-trademark-copyright-lawsuit), [Shein Fails to Escape Rival Temu’s Trademark, Copyright Lawsuit](https://news.bloombergtax.com/litigation/shein-fails-to-escape-rival-temus-trademark-copyright-lawsuit) [Swedish court rules Shein breached Swedish retailer Nelly’s copyright](https://insideretail.asia/2025/10/06/swedish-court-rules-shein-breached-swedish-retailer-nellys-copyright/).

3. **H&M Powers Content Strategy Through London Fashion Week Event**
   - Overview: H&M leveraged its London Fashion Week show to create a multi-faceted content strategy, turning the event into a broadcast platform and social content engine. The brand’s approach generated significant creative value and engagement, showcasing its ability to connect with diverse audiences through fashion and cultural activations [How H&M used a fashion week event to power a 360-degree content strategy](https://www.glossy.co/fashion/hm-shows-how-a-fashion-week-event-can-power-a-content-strategy/).

For fuller examples and explanation of the Responses API, see the official documentation.

Integrating with Claude Desktop

You can also configure Claude Desktop to use the Meltwater MCP server directly. This allows you to chat with Claude and have it automatically access Meltwater’s news and social media insights.

Configuration

To configure the MCP server, you need to edit the claude_desktop_config.json file:

File Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

You can also access this file through Claude Desktop by going to Settings > Developer > Edit Config.

Configuration:

Add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "meltwater": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.meltwater.com/mcp",
        "--header",
        "apikey: ${MELTWATER_API_KEY}"
      ],
      "env": {
        "MELTWATER_API_KEY": "<your api key>"
      }
    }
  }
}

Configuration Details:

  • meltwater: A unique identifier for this MCP server
  • command: Uses npx to run the mcp-remote package
  • args: Specifies the server URL and authentication header
  • env: Environment variables, including your Meltwater API key

Setup Steps:

  1. Replace <your api key> with your actual Meltwater API key
  2. Save the configuration file
  3. Restart Claude Desktop
  4. The Meltwater MCP server will now be available in your Claude conversations

Once configured, you can ask Claude questions about news and social media trends, and it will automatically use the Meltwater API to provide current insights.