Model Context Protocol

Model Context Protocol (MCP)

Overview

MCP is an open protocol that standardizes how applications provide context to large language models (LLMs). You may think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools. In this case, the data source is your eMedia Application 

Features

  • Support for multiple models (e.g., GPT-4o, Claude, Ollama, Gemini)
  • Compatible with any MCP client that follows the spec (e.g., Copilot by VS Code, Cursor, etc.)
  • Easy, stateless, token-based authentication

Usage

We highly recommend using Copilot in VSCode as it offers the latest features and keeps up with new MCP standards. This documentation will guide you through the whole setup process.

To use Copilot in VS Code, you need access to a GitHub Copilot subscription. The free tier is more than enough for most users. Click here to create an account if you don't have one already. Then, download VS Code and install it on your computer, and follow the steps below:

Set up Copilot in VS Code

  1. Hover over the Copilot icon in the Status Bar and select Set up Copilot.

     

  2. Select Sign in to sign in to your GitHub account, or Use Copilot if you're already signed in.

     

  3. You can now start using Copilot in VS Code.

Enable MCP support in VS Code

To enable MCP support in VS Code, go to VS Code settings > Features > Chat > MCP and toggle the checkmark.

Add the eMedia MCP server

You have multiple options to add an MCP server in VS Code. For simplicity, we'll use the workspace method.

  1. Open VS Code, go to File > Open Folder, and select a Folder where you want to create/store all your search results.
  2. Click on the Files icon (1) at the top left corner. It will open the files tab, right click on the empty area of the tab, you'll see the context menu. Click New Folder... (2)

    Name the folder .vscode (notice the dot at the beginning)

     

  3. Right click on the .vscode folder, and click New File..., type mcp.json as the file name. Your file tree should look like this:

     

  4. Click on the mcp.json file, and paste the content below. Be sure to replace the URL and token.

    {
      "servers": {
        "MCP_NAME": {
          "type": "http",
          "url": "YOUR_EMEDIA_FINDER_LINK/mediadb/mcp",
          "headers": {
            "X-tokentype": "entermedia",
            "X-token": "YOUR_AUTH_TOKEN"
          }
        }
      }
    }

    MCP_NAME: Give your MCP configuration a name.

    YOUR_EMEDIA_FINDER_LINK: This is your eMedia Application's finder link. (e.g., https://cinecraft.emedialibrary.com/cinecraft)

    YOUR_AUTH_TOKEN: Contact your site admin for the auth token.

  5. Press Ctrl S or ⌘ S to save the changes. You should immediately see a Start button right above the MCP_NAME area, click it to connect to the MCP server.

  6. You can Stop, Restart from the same area:

     

Use the eMedia MCP tools in Copilot

Once you have added an MCP server, you can use the tools it provides in agent mode. To use the MCP tools in agent mode:

  1. Open the Chat view (Ctrl+Alt+I or ⌃⌘I), and select Agent mode from the dropdown.

     

  2. Select the Tools button to view the list of available tools.

    You can select or deselect the tools you want to use. You can search for tools by typing in the search box. Your newly added tools are usually at the bottom of the list:

     

  3. You can now enter a prompt in the chat input box and notice how tools are automatically invoked as needed.

    By default, when a tool is invoked, you need to confirm the action before it is run. This is because tools might run locally on your machine and might perform actions that modify files or data.

    Use the Continue button dropdown options to automatically confirm the specific tool for the current session, workspace, or all future invocations.

     

Available Tools in eMedia MCP

  • search_by_type

    Searches with one or more keywords in one or more types.

    Example Usage: Search for Dogs and Cats from Animals 

  • emedia_takeaways

    Searches and summarizes the key points from one or more documents that match the search query. 

    Example Usage: List the takeaways from the Monday meeting.

     

Generally, you may want your results to be persisted. MCP responses are usually in Markdown Format. You can suffix your query with an instruction to write the response in a file:

Example Usage: Search for Dogs and Cats from Animals and write the exact response in a markdown file.

Once done, you may need to accept the changes by clicking "Keep".

 

As you may notice, the result looks rather gibberish. To preview them in a more human-friendly format, click anywhere in the file, and then press Ctrl+Shift+V or ⇧⌘V