---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

Agent Infrastructure

18 min read

Updated 2026-10-29

# How to Build MCP Tools for Multimodal AI Agents

A developer guide to building Model Context Protocol (MCP) servers that give AI agents perception over video, images, audio, and documents. Covers the MCP architecture, tool design patterns, and how to expose multimodal search and retrieval as agent-callable tools.

![Ethan Steininger](/people/ethan.webp)

By [Ethan Steininger](/blog/authors/ethan), Founder & CEO, Mixpeek

MCP

AI Agents

Multimodal

Tool Use

RAG

[Give your agent something to search. Try it as you read.Try a hosted retriever →](/marketplace)

[One-click templatesStart from a templateEach template deploys a working search app on your own files.Browse templates](/templates)

## What Is MCP and Why Does It Matter for Multimodal AI?

  
  
The Model Context Protocol (MCP) is an open standard, originally developed by Anthropic, that defines how AI agents discover and invoke external tools. Think of it as a USB-C port for AI: a single interface that lets any agent connect to any capability without custom integration code.  
  
Before MCP, giving an agent access to a new data source meant writing bespoke function definitions, managing authentication, handling serialization, and hard-coding the tool into the agent's prompt. Every agent framework (LangChain, CrewAI, AutoGen, OpenAI Assistants) had its own tool format. If you wanted the same capability in three frameworks, you wrote three integrations.  
  
MCP changes this by defining a standard transport layer (JSON-RPC over stdio or HTTP+SSE), a discovery mechanism (the server advertises its tools and their schemas), and a consistent invocation pattern. An agent asks the MCP server "what can you do?" and gets back a list of tools with typed input/output schemas. The agent then calls whichever tools it needs, and the server returns structured results.  
  
As of early 2026, the MCP ecosystem has crossed 10,000 public servers and the SDK sees over 90 million monthly downloads across Python and TypeScript. Major AI platforms (Claude, ChatGPT, Cursor, Windsurf, Cline) now natively support MCP tool invocation.  
  

## Why Multimodal MCP Servers Are the Next Frontier

  
  
Most existing MCP servers expose text-based tools: read a file, query a database, call an API, search the web. These are useful, but they leave agents blind to the majority of enterprise data.  
  
Consider the numbers:  
  
*   **80-90% of enterprise data is unstructured** -- video, images, audio, PDFs, presentations, CAD files.
*   The unstructured data volume is growing at **49.3% CAGR** through 2028 (IDC).
*   Most AI agents today can only process text. When an agent encounters a video file, an image gallery, or an audio recording, it has no tools to understand what is inside.
  
  
A multimodal MCP server bridges this gap. Instead of giving agents a "search text" tool, you give them tools like:  
  
*   **search\_video** -- Find moments in video by describing what you are looking for in natural language.
*   **analyze\_image** -- Extract objects, faces, text, and scene descriptions from an image.
*   **transcribe\_audio** -- Convert speech to text with speaker diarization and timestamps.
*   **classify\_content** -- Classify any file against a taxonomy (IAB categories, [brand safety](/curated-lists/best-brand-safety-tools), custom labels).
*   **detect\_brands** -- Find logos and brand marks across video frames and images.
  
  
When an agent has these tools, it can reason about the real world -- not just text documents.  
  

## MCP Architecture: How Servers and Clients Work

  
  
An MCP deployment has two sides:  
  

### The MCP Server

  
  
The server is a process that:  
  
1\. **Advertises capabilities** -- On startup, it responds to tools/list requests with a JSON schema describing each tool's name, description, and input parameters. 2. **Handles invocations** -- When the client calls tools/call with a tool name and arguments, the server executes the logic and returns a result. 3. **Manages transport** -- Communication happens over stdio (for local servers) or HTTP with Server-Sent Events (for remote servers).  
  

### The MCP Client

  
  
The client is the AI agent or its host application (Claude Desktop, Cursor, a custom agent). It:  
  
1\. **Discovers servers** -- Reads a configuration file that lists available MCP servers and how to connect to them. 2. **Fetches tool lists** -- Asks each server what tools it offers. 3. **Presents tools to the model** -- Includes the tool schemas in the system prompt or tool-use API call. 4. **Routes tool calls** -- When the model decides to use a tool, the client sends the invocation to the correct server and feeds the result back to the model.  
  

### Transport Options

  
  

Transport

Best For

Latency

Setup

**stdio**

Local tools, IDE integrations

Lowest

Run as subprocess

**HTTP + SSE**

Remote services, team-shared servers

Medium

Deploy as web service

**Streamable HTTP**

High-throughput production workloads

Medium

Deploy with connection pooling

  
  
For multimodal workloads, HTTP+SSE is typically the right choice because the server needs access to GPU-backed inference services, object storage, and vector databases that run remotely.  
  

## Designing Multimodal MCP Tools

  
  
Good MCP tool design follows the same principles as good API design, but with additional constraints because the "caller" is an LLM, not a human developer.  
  

### Principle 1: Tools Should Be Self-Describing

  
  
The LLM decides when to call your tool based on its name and description. A tool named "search" with description "Search for stuff" will be invoked unpredictably. A tool named "search\_video\_by\_description" with description "Search for specific moments in video files using a natural language description. Returns timestamped segments with confidence scores." will be invoked correctly.  
  
Write descriptions as if you are explaining the tool to a junior developer who has never seen your codebase.  
  

### Principle 2: Accept Natural Language, Return Structured Data

  
  
Agents think in natural language. Your tool inputs should accept free-text queries where possible. Define an inputSchema with a query string field and optional filters like modalities and max\_results. Return structured JSON with results that include file paths, timestamps, confidence scores, and descriptions.  
  

### Principle 3: Scope Tools Narrowly

  
  
One tool per capability. Do not create a single process\_media tool that handles search, classification, transcription, and extraction. The LLM cannot reliably choose the right "mode" parameter. Instead, create separate tools:  
  
*   **search\_video** -- Semantic search across video content
*   **classify\_content** -- Classify against a taxonomy
*   **extract\_metadata** -- Pull structured metadata from a file
*   **detect\_faces** -- Find and identify faces
*   **detect\_brands** -- Find logos and brand marks
  
  
Each tool does one thing well. The agent orchestrates them.  
  

### Principle 4: Include Confidence Scores

  
  
Agents need to know how much to trust a result. Always include confidence scores, match counts, and quality signals in your responses. This lets the agent decide whether to act on a result, ask for clarification, or try a different approach.  
  

## Building a Multimodal MCP Server: Step by Step

  
  
Here is a practical walkthrough of building an MCP server that exposes multimodal search and retrieval capabilities.  
  

### Step 1: Define Your Tools

  
  
Start by listing the capabilities you want to expose. A good starting set for multimodal AI:  
  

Tool

Input

Output

Use Case

search

Natural language query + modality filter

Ranked results with metadata

"Find all frames showing the CEO"

classify

File URL or ID + taxonomy name

Category scores

"What IAB categories does this video match?"

extract\_metadata

File URL or ID

Structured metadata

"What is in this image?"

list\_documents

Namespace + optional filters

Document list

"What files are in the media library?"

get\_document

Document ID

Full document metadata

"Get details about this specific asset"

  
  

### Step 2: Implement the Server

  
  
Using the MCP Python SDK, create a Server instance and register your tools with the list\_tools and call\_tool decorators. Each tool should have a clear name, description, and typed inputSchema. The call\_tool handler dispatches to your backend functions and returns TextContent with JSON results.  
  

### Step 3: Connect to Your Backend

  
  
The MCP server is a thin wrapper. The heavy lifting -- embedding generation, vector search, model inference -- happens in your backend. Your MCP server calls your existing search and classification APIs using an HTTP client like httpx.  
  

### Step 4: Configure the Client

  
  
For local deployment, add a stdio-based entry to your MCP client configuration (such as Claude Desktop's config.json) with the command to run your server and the required environment variables.  
  
For remote deployment (HTTP+SSE), point the client at your server URL with appropriate authentication headers.  
  

## Real-World Use Cases

  
  

### Media Asset Management

  
  
A media company connects their AI assistant to an MCP server backed by their video archive. Editors ask questions like "Find all shots of the Brooklyn Bridge at sunset from last quarter" and get back timestamped results they can drop into their timeline. The agent searches across visual content, audio transcripts, and metadata simultaneously.  
  

### Brand Safety Monitoring

  
  
An ad tech team deploys an MCP server with brand safety tools. Their monitoring agent periodically scans new content, classifies it against brand safety taxonomies, and fires alerts when risky content is detected adjacent to premium ad placements. The agent can explain its reasoning because it has access to both the classification scores and the source content.  
  

### Compliance Review

  
  
A legal team uses an agent with multimodal MCP tools to review contracts, medical images, and recorded depositions. The agent can search across all three modalities, cross-reference findings, and generate structured compliance reports. Instead of three separate tools, one MCP server provides unified access.  
  

### Customer Support Intelligence

  
  
A support team connects their agent to an MCP server that indexes product photos, tutorial videos, and knowledge base articles. When a customer describes a problem, the agent can search for visually similar product issues, find the relevant tutorial segment, and surface the right knowledge base article -- all through natural language.  
  

## Performance Considerations

  
  

### Latency Budget

  
  
MCP tool calls add latency to the agent loop. Each tool invocation is a round trip. For multimodal workloads:  
  
*   **Text search:** 50-200ms typical
*   **Image embedding + search:** 200-500ms typical
*   **Video scene search:** 500ms-2s depending on index size
*   **Classification:** 200-800ms depending on model
  
  
Design your tools to return results in under 2 seconds. If a tool takes longer, consider returning a job ID and a separate check\_status tool, or use streaming to deliver partial results.  
  

### Caching

  
  
Implement caching at the MCP server level:  
  
*   Cache embedding vectors for recently searched queries.
*   Cache classification results for recently processed files.
*   Use semantic similarity to serve cached results for near-duplicate queries.
  
  

### Batching

  
  
If an agent needs to process multiple files, expose a batch variant of your tools. Processing 10 images one at a time through 10 MCP tool calls is 10x slower than processing them in one batch call.  
  

## Security Best Practices

  
  

### Authentication

  
  
Every MCP server should require authentication. For stdio servers, inject the API key via environment variables. For HTTP servers, require bearer tokens. Never expose an unauthenticated MCP server with access to your data.  
  

### Input Validation

  
  
The agent controls what gets sent to your tools. Validate all inputs: file URLs should match expected domains, namespaces should be from an allowlist, query strings should be length-bounded. Treat MCP tool inputs with the same caution as user input in a web application.  
  

### Least Privilege

  
  
Scope your MCP server's access to the minimum required. If the agent only needs to search and read, do not give the MCP server write or delete permissions. Use read-only API keys where possible.  
  

## Connect Mixpeek to your agent, client by client

  
  
Mixpeek runs two hosted MCP servers. Both search the namespaces in your own Mixpeek organization.  
  

Server

URL

How you sign in

Tools

Mixpeek app

https://mcp.mixpeek.com/app/mcp

OAuth: sign in to Mixpeek, pick the organization, approve read access (scope mixpeek:read)

9 read-only tools: list\_namespaces, list\_collections, get\_collection, list\_documents, get\_document, list\_retrievers, get\_retriever, execute\_retriever, search\_namespace

Retrieval

https://mcp.mixpeek.com/retrieval/mcp

An API key sent as a Bearer token

Search your namespaces and run your retrievers

  
  
Use the app server when the client supports MCP sign-in, because no key is stored in a config file. Use the retrieval server when the client takes custom headers.  
  
You can check the app server from a terminal. An unsigned request is refused with a pointer to the sign-in metadata, which is what an MCP client reads to start the OAuth flow:

curl -si -X POST https://mcp.mixpeek.com/app/mcp \\
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \\
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"check","version":"0"}}}' \\
  | grep -i '^www-authenticate'

www-authenticate: Bearer resource\_metadata="https://mcp.mixpeek.com/.well-known/oauth-protected-resource/app/mcp", scope="mixpeek:read"

### Cursor

  
  
1\. Open or create `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project) and add the app server:

{
  "mcpServers": {
    "mixpeek": { "url": "https://mcp.mixpeek.com/app/mcp" }
  }
}

2\. Cursor reads the sign-in metadata and opens a browser window. Sign in to Mixpeek, pick your organization and approve read access. 3. The server then lists its 9 tools.  
  
**A task to try:** ask the agent "Find the moment a rocket lifts off in my Mixpeek videos." It calls `list_namespaces` and `list_retrievers` to find what it can search, then `execute_retriever` with your words as the query, and answers with the clip and its start and end seconds. When we ran this task against a test namespace, the query "rocket launch" returned the TROPICS satellite launch clip first.  
  

### Claude Code

  
  
Add the retrieval server with an API key from [Mixpeek Studio](https://studio.mixpeek.com):

claude mcp add --scope user --transport http mixpeek-retrieval \\
  https://mcp.mixpeek.com/retrieval/mcp \\
  --header "Authorization: Bearer YOUR\_API\_KEY"

Run `claude mcp list` to confirm it connected, then start a session in any project.  
  
**A task to try:** "Search my footage for every segment where our logo is on screen, and list each one with its video and start time." The agent runs your retriever with that query and returns segments with timestamps, which it can then group by video or write into a file.  
  

### Other clients

  
  
Any client that connects to remote MCP servers over HTTP and lets you set a header can use the retrieval server with the same URL and `Authorization: Bearer YOUR_API_KEY`. Sign-in to the app server from Claude Desktop and claude.ai custom connectors is not enabled yet; use Claude Code or Cursor in the meantime.  
  

### No Mixpeek account yet? The agent can sign up

  
  
An agent working without a browser can create its own Mixpeek organization and get a key in one call. Give it the email of the person it works for:

curl -X POST https://api.mixpeek.com/v1/signup/agent \\
  -H 'Content-Type: application/json' \\
  -d '{"email":"you@company.com","agent\_name":"my-agent","accept\_terms":true}'

The response carries `api_key` (shown once), a `namespace` to send as `X-Namespace`, a `bucket`, a `retriever` and `next_steps`: upload a file to the bucket, then run the retriever on it. The key works at once on a starter allowance of credits. The person at that email gets one message to keep the key or block it, and an unconfirmed key expires 72 hours after signup. Put the key in the retrieval server's `Authorization` header above and the agent can search what it just uploaded. The [agent signup reference](https://mixpeek.com/docs/api-reference/onboarding/agent-signup) lists every field and error.  
  

## Key Takeaways

  
  
*   MCP is the emerging standard for connecting AI agents to external capabilities. Building your multimodal tools as MCP servers makes them accessible to every major AI platform.
*   Most MCP servers today are text-only. Multimodal MCP servers -- tools that let agents see, hear, and read -- are a significant competitive advantage.
*   Design tools that accept natural language input and return structured data with confidence scores.
*   Scope tools narrowly: one tool per capability, not one tool that does everything.
*   Latency matters in the agent loop. Target sub-2-second response times for all tools.
*   Secure your MCP server with authentication, input validation, and least-privilege access.
  
  

## Frequently Asked Questions

  
  

### How do I let an AI agent look through my own video library?

  
  
Index the library first, then give the agent a search tool over that index. Indexing cuts each video into timestamped segments and records what is seen, said and written on screen in each one. The agent calls the tool with a plain-language query and gets back segments with start and end times. As Ethan Steininger, Mixpeek's founder, puts it, agents "cannot watch a video, scan a photo for a logo, or search audio by what was said" without a primitive for perceiving it. The search tool is that primitive. With Mixpeek, connect Claude Code to the hosted retrieval server:

claude mcp add --scope user --transport http mixpeek-retrieval \\
  https://mcp.mixpeek.com/retrieval/mcp \\
  --header "Authorization: Bearer YOUR\_API\_KEY"

### Can Claude or ChatGPT watch the videos in my library directly?

  
  
Only a few at a time. Models that accept video sample frames into the context window. Gemini's docs, for example, sample at 1 frame per second, which comes to about 100 tokens per second of video at low resolution, so a 1M-token context holds about 3 hours of footage. A library of thousands of hours will not fit, and the model would re-read every frame on every question. An index reads each video once and lets the agent pull only the moments that match.  
  

### What does an MCP tool for video search return to the agent?

  
  
Return structured results the agent can reason over and cite: the video id, start and end seconds, a relevance score, and the evidence that matched, such as a transcript line or detected on-screen text. Keep the payload small. Ten results with timestamps and short evidence give the agent enough to answer or to ask a follow-up, and they fit easily in context.

{"results": \[{"video\_id": "vid\_123", "start": 64.0, "end": 71.5, "score": 0.83,
  "evidence": {"transcript": "the new pricing goes live on Monday"}}\]}

### Do I have to upload my videos somewhere for an agent to search them?

  
  
No. Mixpeek reads your files where they already live, in S3, GCS or any bucket, and turns what's in them into data your software can search, classify and moderate. You connect the bucket, Mixpeek processes the files, and the agent searches the results through the MCP tool. The source videos stay in your storage.  
  

### How do I connect Claude to Mixpeek's video search with MCP?

  
  
Use the hosted server at https://mcp.mixpeek.com/retrieval/mcp with your API key as a Bearer token, as in the command above. Its tools search your namespace and run your retrievers. To give an agent exactly one search, install the per-retriever server with `pip install mixpeek-mcp-retriever`. It exposes three tools: `search` runs the retriever, `describe` returns its input fields and stages, and `explain` walks through what each stage does. Setup for Cursor, Claude Code and other clients is in the section above on connecting Mixpeek to your agent, client by client.  
  

## Related Resources

  
  
*   [Model Context Protocol](/glossary/model-context-protocol) -- glossary entry explaining the standard
*   [Multimodal Embeddings](/glossary/multimodal-embeddings) -- how vector representations enable cross-modal search
*   [Context Engineering](/glossary/context-engineering) -- the discipline of building the right context for AI systems
*   [Multimodal RAG](/multimodal-rag) -- retrieval-augmented generation across modalities
*   [Documentation](/docs/overview/introduction) -- getting started with Mixpeek

## Give your agent something to search

Run a hosted retriever with no account, or let your agent sign up and search its own files through the Mixpeek MCP server.

[Try a hosted retriever](/marketplace)[Agent signup](https://mixpeek.com/docs/api-reference/onboarding/agent-signup)

[Explore MVS](/mvs)[See pricing](/pricing)

## Related guides

[

Agent Infrastructure

### Context Engineering for AI Agents

A complete guide to context engineering: the practice of curating what an AI agent sees before it acts. Covers the four sources of context, retrieval strategies, compression techniques, context window economics, and how to move beyond prompt engineering to production-ready agent systems.

Read guide →](/guides/context-engineering-ai-agents)[

Agent Perception

### Why Is My AI Agent Using Thousands of Tokens Before I Ask It Anything?

Every MCP server you connect sends its full tool list with every request, and the schemas cost more than the descriptions. We counted the tokens for Mixpeek's own MCP server (68,605 for all 67 tools) and Google's official Google Ads MCP server (3,668 for 3 tools), and show how to cut the bill.

Read guide →](/guides/why-is-my-ai-agent-using-thousands-of-tokens-before-i-ask-it-anything)[

Agent Perception

### MCP Tool Design for Multimodal Search

A technical guide to building MCP (Model Context Protocol) tools that expose multimodal search to AI agents. Covers tool schema design, embedding handoff patterns, streaming results, and how to structure image/audio/video search as composable MCP resources.

Read guide →](/guides/mcp-tool-design-for-multimodal-search)