{"id":155775,"date":"2025-03-25T13:25:11","date_gmt":"2025-03-25T13:25:11","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/how-to-use-mcp-model-context-protocol\/"},"modified":"2025-03-25T13:25:11","modified_gmt":"2025-03-25T13:25:11","slug":"how-to-use-mcp-model-context-protocol","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=155775","title":{"rendered":"How to Use MCP: Model Context Protocol"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>You\u2019ve built applications with LLMs. You\u2019ve played with agents. Maybe you\u2019ve even worked with <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/06\/langchain-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">LangChain<\/a>, <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/07\/microsofts-autogen-framework-for-agentic-workflow\/\" target=\"_blank\" rel=\"noreferrer noopener\">AutoGen<\/a>, or OpenAI\u2019s Assistants API. Isn\u2019t it impressive how much these models can reason, understand, and generate? But the moment your agent needs to do something real, like check a database, read from a CRM, or fetch a Google Doc; things start to fall apart. Suddenly you\u2019re:<\/p>\n<ul class=\"wp-block-list\">\n<li>Writing custom wrappers for each API,<\/li>\n<li>Manually deciding what data goes in the prompt, and<\/li>\n<li>Fighting token limits and stale context.<\/li>\n<\/ul>\n<p>That\u2019s where Model Context Protocol (MCP) comes in. <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/02\/model-context-protocol\/\" target=\"_blank\" rel=\"noreferrer noopener\">MCP<\/a> is not a new \u201cframework\u201d but an open standard that helps AI assistants and agents connect to real-world data and tools in a simple and reusable way. In this blog, we will understand what MCP is, how to use it, and why it\u2019s so popular now \u2013 all while exploring its applications.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-mcp\">What is MCP?<\/h2>\n<p>Model Context Protocol (MCP) is a powerful open standard that was launched by Claude\u2019s parent company, Anthropic, in November 2024. It allows Large Language Models (LLMs) like Claude or GPT to seamlessly access external content such as documents, databases, tools, local files or APIs, in a structured, secure, and scalable way.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"872\" height=\"661\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29%E2%80%AFPM.webp\" alt=\"What is MCP?\" class=\"wp-image-228149\" style=\"width:587px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29%E2%80%AFPM.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29%E2%80%AFPM-300x227.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29%E2%80%AFPM-768x582.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29%E2%80%AFPM-150x114.webp 150w\" sizes=\"(max-width: 872px) 100vw, 872px\"\/><\/figure>\n<\/div>\n<p>MCP at its core consists of three main components:<\/p>\n<ol class=\"wp-block-list\">\n<li><b>Model<\/b>: It refers to the LLM (like Claude or GPT-4) that\u2019s responding to your inputs.<\/li>\n<li><b>Context<\/b>: It is the additional information the model needs to respond meaningfully. The source of this information can be documents, PDFs, prompts, or database entries.<\/li>\n<li><b>Protocol<\/b>: It represents a set of rules that lets the model access and use that context from structured sources.<\/li>\n<\/ol>\n<p>\n  <iframe loading=\"lazy\" title=\"Model Context Protocol(MCP) Explained for Beginners in Python (with multiple examples)!\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/LYfr7qusVSs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br \/>\n  <\/iframe>\n<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-does-mcp-work\">How Does MCP Work?<\/h2>\n<p>In its true essence, MCP standardizes the communication between the clients and servers, without needing custom code or manual data uploads. Clients and Servers can mean different things for different technologies, but for MCP, these are:.\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Client: <\/strong>This is the interface where the LLMs respond to you. This could be Claude\u2019s desktop app, your IDE, or a chatbot.<\/li>\n<li><strong>Server:<\/strong> This is the system or data source (local or remote) that holds the context, for eg. Google Drive, GitHub, Gmail, your local files, PDFs, etc.<\/li>\n<\/ul>\n<p>When you ask a question or give a command, the client sends a request to the server for the relevant information. The server then provides the necessary context (e.g., a file, email, or database), which the client uses to give you a response or complete a task. This process allows AI to efficiently work with real-time, dynamic data.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"506\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.33.18%E2%80%AFPM.webp\" alt=\"How Does MCP Work?\" class=\"wp-image-228150\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.33.18%E2%80%AFPM.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.33.18%E2%80%AFPM-300x174.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.33.18%E2%80%AFPM-768x446.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.33.18%E2%80%AFPM-150x87.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<\/div>\n<p>Thus, with MCP, the client (LLM interface) can automatically discover available servers (data sources), and request specific information based on your query.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-why-do-we-need-mcp\">Why Do We Need MCP?<\/h2>\n<p>MCP acts like a universal connector for your LLMs, allowing them to:<\/p>\n<ul class=\"wp-block-list\">\n<li>Find out what tools are available (like your files, calendar, or documents).<\/li>\n<li>Understand what each tool can do (e.g. \u201cread PDF\u201d, \u201ccount files\u201d, \u201csave chat\u201d).<\/li>\n<li>Use those tools directly without needing any special code for each one.<\/li>\n<li>Get clean, structured results which it can use to answer you better.<\/li>\n<\/ul>\n<p>So instead of you uploading files or copying data into the prompt, the LLMs just access what it needs automatically. Whether it\u2019s reading from a Notion doc, querying a database, or retrieving a GitHub issue, MCP turns it into a seamless, reusable workflow.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-to-use-mcp\">How to Use MCP?<\/h2>\n<p>In this tutorial, we will use MCP to connect the Claude desktop app (client) to our local files and data using Python. We\u2019ll then use the external data as context to perform these 4 tasks:<\/p>\n<ol class=\"wp-block-list\">\n<li>Create a custom greeting tool<\/li>\n<li>Count the number of files on our desktop<\/li>\n<li>Save a chat with Claude to our local system<\/li>\n<li>Ask Claude questions using a local PDF document<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\" id=\"h-requirements\">Requirements<\/h3>\n<p>To perform all these 4 tasks, make sure that you have:<\/p>\n<ol class=\"wp-block-list\">\n<li>A system with Python 3.11+ installed<\/li>\n<li>Claude desktop app (free or pro version)<\/li>\n<li>Basic familiarity with Python<\/li>\n<li>VS Code or any IDE<\/li>\n<li>A few local documents (e.g. a PDF like a leave policy)<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\" id=\"h-one-time-set-up\">One-time Set Up<\/h3>\n<p>Before we start with performing the tasks, here are a few one time tasks that you need to perform to ensure all your 4 tasks are performed smoothly.\u00a0<\/p>\n<p><strong>Create a Python Environment<\/strong><\/p>\n<ol class=\"wp-block-list\"\/>\n<p>It is highly recommended to create a separate python environment to perform these tasks. If you are using a conda environment, you can do that by executing the following command: <\/p>\n<pre class=\"wp-block-preformatted\">conda create ~n mcp python==3.11<\/pre>\n<p><strong>Install the MCP Library<\/strong><\/p>\n<ol class=\"wp-block-list\"\/>\n<p>Since we are working with Python, it\u2019s important to incorporate Python code files. To do this, write\u00a0 and execute the command:<\/p>\n<pre class=\"wp-block-preformatted\">pip install mcp<\/pre>\n<p>The code file, besides Python can also be in Typescript, Java or Kotlin. You can read more about these in <a href=\"https:\/\/modelcontextprotocol.io\/introduction\" target=\"_blank\" rel=\"nofollow noopener\">MCP Documentation<\/a>.<\/p>\n<p><strong>Download Claude\u2019s Desktop App<\/strong><\/p>\n<ol class=\"wp-block-list\"\/>\n<p>To download the app, head to <a href=\"https:\/\/claude.ai\/download\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/claude.ai\/download<\/a> and download the app for your respective system. Once installed, it may take a few seconds to launch. It\u2019s completely normal. Although, yoy can build with Claude MCP using Claude\u2019s free plan but the plan its usage limits while experimenting and is often inconvenient to work with. Hence its preferred to work with a paid subscription.<\/p>\n<p><strong>Set-up the Configuration File<\/strong><\/p>\n<ol class=\"wp-block-list\"\/>\n<p>The configuration file is unique for each client. Since we are using Claude\u2019s desktop app, we will need to download Claude\u2019s configuration file. To do this:<\/p>\n<ul class=\"wp-block-list\">\n<li>Go to Claude Settings.<\/li>\n<li>Then go to the Developer Section.<\/li>\n<li>Click on \u201cEdit Configuration\u201d.<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"479\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Set-up-the-Configuration-File.webp\" alt=\"Set-up the Configuration File\" class=\"wp-image-228152\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Set-up-the-Configuration-File.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Set-up-the-Configuration-File-300x165.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Set-up-the-Configuration-File-768x422.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Set-up-the-Configuration-File-150x82.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<ul class=\"wp-block-list\">\n<li>Look for \u201c<em>claude_desktop_config.json<\/em>\u201d. If the file isn\u2019t already there, please create it with the same name.<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"561\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/claude_desktop_config_json.webp\" alt=\"claude_desktop_config_json\" class=\"wp-image-228153\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/claude_desktop_config_json.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/claude_desktop_config_json-300x193.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/claude_desktop_config_json-768x494.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/claude_desktop_config_json-150x97.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p>This file maps your tools (Python scripts) to Claude and you\u2019ll update this file after each task. Now that we are done with all our installations and downloads, let\u2019s start with our tasks.\u00a0<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-task-1-create-a-custom-greeting-tool\">Task 1: Create a Custom Greeting Tool<\/h3>\n<p>In this task, we\u2019ll build a tool that will create a personalised greeting for you whenever prompted with a \u201c<em>Hi<\/em>\u201d or \u201c<em>Hello<\/em>\u201d.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-1-create-a-new-python-file\">Step 1: Create a New Python File<\/h4>\n<p>Here, I have created a new file named \u201cgreeter.py\u201d.<\/p>\n<pre class=\"wp-block-code\"><code>from mcp.server.fastmcp import FastMCP\/\/ FAST MCP is just an easier way to build a server\n\n# Create an MCP server named \"Greeter\"\n\nmcp = FastMCP(\"Greeter\")\u00a0\n\n@mcp.tool()\n\ndef greet() -&gt; str:\n\n\u00a0\u00a0\u00a0\u00a0\"\"\"Return this welcome message, when greeted with \"Hi\", \"Hey\" or \"Hello\".\"\"\"\n\n\u00a0\u00a0\u00a0\u00a0return \"Hey <add your=\"\" own=\"\" name=\"\">, Welcome to the world of MCPs!\"\n\nif __name__ == \"__main__\":\n\n\u00a0\u00a0\u00a0\u00a0mcp.run()<\/add><\/code><\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>The code creates an MCP server that reads for a greeting request and responds with a personalized message.\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li>The function uses a decorator to tell the server how to respond when prompted with \u201c<em>Hi<\/em>\u201c, \u201c<em>Hey<\/em>\u201c, or \u201c<em>Hello<\/em>\u201c.\u00a0<\/li>\n<li>The command we give to the MCP server gets shared with the LLM, which in turn might generate the same response we fed to the server or a version similar to it.\u00a0<\/li>\n<li>You may get a completely different response than what you expect; this is because the final output is generated by an LLM.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-step-2-update-the-config-file\">Step 2: Update the Config File<\/h4>\n<p>Make sure there are absolutely no syntax errors in your configuration file. In a configuration file we need three things:<\/p>\n<ol class=\"wp-block-list\">\n<li>Name of our server<\/li>\n<li>Location of the Python program<\/li>\n<li>Location of the Python file that has to be executed<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"166\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Update-.webp\" alt=\"Update the Config File&#10;\" class=\"wp-image-228154\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Update-.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Update--300x57.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Update--768x146.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Update--150x29.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-step-3-restart-your-claude-desktop-app\">Step 3: Restart Your Claude Desktop App<\/h4>\n<p>Restarting the app is essential because,<\/p>\n<ol class=\"wp-block-list\">\n<li>It tells you about any errors in your code. The error gets highlighted and you can go to the \u201cLogs\u201d section to get insights on how those errors can be corrected.<\/li>\n<li>When no errors are detected, the tool gets registered to the Claude desktop app and you will be able to access it from within the app.<\/li>\n<li>Restarting the app gives it access to the most recent integrations. So you need to do it every time you update or change your code.<\/li>\n<\/ol>\n<h4 class=\"wp-block-heading\" id=\"h-step-4-say-hi-to-claude-in-the-app\">Step 4: Say \u201c<em>Hi<\/em>\u201d to Claude in the App<\/h4>\n<p>Just prompt a \u201c<em>Hi<\/em>\u201d to Claude via the app and it will greet you back using your tool!<\/p>\n<p>Once you say \u201c<em>hey<\/em>\u201d to the Claude desktop app, you will get a pop-up asking you to allow the app to use the tool that you have just created. Click on \u201c<em>Allow tool for this chat<\/em>\u201d. Currently you have to allow a tool to work in a chat every time you call that tool in a given chat.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"370\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Say-Hi-to-Claude-in-the-App.webp\" alt=\"Say \u201cHi\u201d to Claude in the App\" class=\"wp-image-228155\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Say-Hi-to-Claude-in-the-App.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Say-Hi-to-Claude-in-the-App-300x127.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Say-Hi-to-Claude-in-the-App-768x326.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Say-Hi-to-Claude-in-the-App-150x64.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p>Once permission is given, you get the response from the desktop app.\u00a0<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"308\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-1.webp\" alt=\"Task 1\" class=\"wp-image-228157\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-1.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-1-300x106.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-1-768x271.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-1-150x53.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-task-2-count-files-on-your-desktop\">Task 2: Count Files on Your Desktop<\/h3>\n<p>This tool will count the number of files present on your desktop and return the total when you ask Claude.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-1-create-a-new-python-file-0\">Step 1: Create a New Python File<\/h4>\n<p>Here, I am creating a file named file_counter.py<\/p>\n<pre class=\"wp-block-code\"><code>from mcp.server.fastmcp import FastMCP\n\nimport os\n\n# Create an MCP server named \"FileCounter\"\n\nmcp = FastMCP(\"FileCounter\")\n\n@mcp.tool()\n\ndef count_desktop_files() -&gt; str:\n\n\u00a0\u00a0\u00a0\u00a0\"\"\"Count the number of files on the desktop\"\"\"\n\n\u00a0\u00a0\u00a0\u00a0desktop_path = os.path.expanduser(\"~\/Desktop\")\u00a0 # Gets desktop path (e.g., \/Users\/apoorv\/Desktop)\n\n\u00a0\u00a0\u00a0\u00a0try:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# List all items in desktop directory, filter to files only\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0files = [f for f in os.listdir(desktop_path) if os.path.isfile(os.path.join(desktop_path, f))]\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0file_count = len(files)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"There are {file_count} files on your desktop.\"\n\n\u00a0\u00a0\u00a0\u00a0except Exception as e:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"Error counting files: {str(e)}\"\n\nif __name__ == \"__main__\":\n\n\u00a0\u00a0\u00a0\u00a0mcp.run()<\/code><\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>This code sets up an MCP server to scan the desktop directory, count the number of files, and return the count. The function filters through the directory using Python\u2019s os library to count only the files (not folders).<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-2-update-the-config-file-0\">Step 2: Update the Config File<\/h4>\n<p>Follow the steps as above and make sure there aren\u2019t any extra files.\u00a0<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-3-restart-your-claude-desktop-app-0\">Step 3: Restart Your Claude Desktop App<\/h4>\n<p>Follow the steps as above.\u00a0<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-4-ask-claude\">Step 4: Ask Claude<\/h4>\n<p>Give the following prompt to the Claude Desktop app: \u201c<em>How many files are there on my desktop?<\/em>\u201d<\/p>\n<p>Then you will get the pop up to allow the tool for this chat. Once approved you will get the output based on the number of files on your system.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"257\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-2.webp\" alt=\"Task 2\" class=\"wp-image-228158\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-2.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-2-300x88.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-2-768x226.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-2-150x44.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-task-3-save-conversations-as-text-files\">Task 3: Save Conversations as Text Files<\/h3>\n<p>This tool allows Claude to save your ongoing conversation into a .txt file on your desktop.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-1-create-a-new-python-file-1\">Step 1: Create a New Python File<\/h4>\n<p>For this, I\u2019m going to create a new file named conversation_saver.py.<\/p>\n<pre class=\"wp-block-code\"><code>from mcp.server.fastmcp import FastMCP\n\nimport os\n\nfrom datetime import datetime\u00a0\n\nmcp = FastMCP(\"ConversationSaver\")\n\n@mcp.tool()\n\ndef save_conversation(conversation: str) -&gt; str:\n\n\u00a0\u00a0\u00a0\u00a0\"\"\"Save the current conversation to a text file on the desktop\"\"\"\n\n\u00a0\u00a0\u00a0\u00a0desktop_path = os.path.expanduser(\"~\/Desktop\")\n\n\u00a0\u00a0\u00a0\u00a0timestamp = datetime.now().strftime(\"%Y%m%d_%H%M%S\")\n\n\u00a0\u00a0\u00a0\u00a0file_path = os.path.join(desktop_path, f\"claude_chat_{timestamp}.txt\")\n\n\u00a0\u00a0\u00a0\u00a0try:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0with open(file_path, \"w\") as f:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f.write(conversation)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"Conversation saved at: {file_path}\"\n\n\u00a0\u00a0\u00a0\u00a0except Exception as e:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"Error saving conversation: {str(e)}\"\n\nif __name__ == \"__main__\":\n\n\u00a0\u00a0\u00a0\u00a0mcp.run()<\/code><\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>The code creates an MCP server that saves the ongoing conversation to a text file on your desktop, naming it with a timestamp. It uses Python\u2019s datetime to generate unique file names and the os library to save the content in a text file.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-2-update-the-config-file-1\">Step 2: Update the Config File<\/h4>\n<p>Make sure there are absolutely no syntax errors in your configuration file and there aren\u2019t any extra files in the list.\u00a0<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-3-restart-your-claude-desktop-app-1\">Step 3: Restart Your Claude Desktop App<\/h4>\n<p>To check for any errors in your code, restart the app after writing the code. Any errors get highlighted after this step and you can correct them. If there are no errors, your tool gets registered to the Claude app, after which you can access it directly from there.\u00a0<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-4-save-the-chat\">Step 4: Save the Chat<\/h4>\n<p>I\u2019ve gave a prompt to the Claude App: \u201c<em>What is a RAG system<\/em>\u201d<\/p>\n<p>This time, it is NOT going to access any tools; since we haven\u2019t so far created any tool for this type of query. So the app won\u2019t ask you for any permissions and would continue like AI chatbots usually do. It will generate an output based on its training information.<\/p>\n<p>Now I give the app, a second prompt: <em>\u201cSave this chat\u201d<\/em><\/p>\n<p>Claude will prompt you to allow the tool and then save the full conversation to your desktop, timestamped.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"317\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-3.webp\" alt=\"\" class=\"wp-image-228159\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-3.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-3-300x109.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-3-768x279.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Task-3-150x55.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p>You can open the .txt file\u00a0 on your desktop to view the entire exchange.<\/p>\n<p>Check the output I received <a href=\"https:\/\/drive.google.com\/file\/d\/1dsnWNxLcEXTI6CBVo4_mLMXtDi8c-gcZ\/view?usp=sharing\" target=\"_blank\" rel=\"nofollow noopener\">here<\/a>.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-task-4-ask-questions-about-a-local-pdf\">Task 4: Ask Questions About a Local PDF<\/h3>\n<p>This tool lets Claude access a document (which can\u00a0 be word doc, pdf or ppt) available on your local system, and answer questions from it; without you having to upload it manually. For this task, I\u2019ll be prompting some questions regarding my company\u2019s leave policy; the pdf for which is present at my desktop.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-1-create-a-new-python-file-2\">Step 1: Create a New Python File<\/h4>\n<p>For this task, I\u2019m going to create a new file named leave_policy_reader.py.<\/p>\n<pre class=\"wp-block-code\"><code>from mcp.server.fastmcp import FastMCP\n\nimport os\n\nimport PyPDF2\u00a0 # For PDF text extraction\n\nmcp = FastMCP(\"SmartContext\")\n\n# Hardcoded path to your leave policy PDF (edit this to your file\u2019s location)\n\nLEAVE_POLICY_PDF = \"\/Users\/apoorv\/Desktop\/AV\/Code\/MCP\/leave_policy.pdf\"\n\n@mcp.tool()\n\ndef fetch_context(query: str) -&gt; str:\n\n\u00a0\u00a0\u00a0\u00a0\"\"\"Fetch content from a leave policy PDF for leave-related queries\"\"\"\n\n\u00a0\u00a0\u00a0\u00a0query_lower = query.lower()\n\n\u00a0\u00a0\u00a0\u00a0# Only process if \"leave\" is in the query\n\n\u00a0\u00a0\u00a0\u00a0if \"leave\" not in query_lower:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return \"This tool only answers leave-related questions. Ask about leaves!\"\n\n\u00a0\u00a0\u00a0\u00a0if not os.path.exists(LEAVE_POLICY_PDF):\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"Error: Leave policy PDF not found at {LEAVE_POLICY_PDF}!\"\n\n\u00a0\u00a0\u00a0\u00a0try:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# Read the PDF\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0with open(LEAVE_POLICY_PDF, \"rb\") as f:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pdf_reader = PyPDF2.PdfReader(f)\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0content = \"\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for page in pdf_reader.pages:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0extracted_text = page.extract_text()\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if extracted_text:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0content += extracted_text + \"\\n\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if not content:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return \"Error: No text could be extracted from the leave policy PDF!\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0# Return the content with the query for Claude\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return (f\"Using context from {LEAVE_POLICY_PDF}:\\n\\n\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f\"Content:\\n{content}\\n\\n\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f\"Query: {query}\\n\\n\"\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f\"Please answer based on the content above.\")\n\n\u00a0\u00a0\u00a0\u00a0except Exception as e:\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return f\"Error reading leave policy PDF: {str(e)}\"\n\nif __name__ == \"__main__\":\n\n\u00a0\u00a0\u00a0\u00a0mcp.run()<\/code><\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>This code builds an MCP server that reads a PDF document (<a href=\"https:\/\/drive.google.com\/file\/d\/1v3WVxyIBnwW3JWFx-5xzK-mdkcSrO5if\/view?usp=sharing\" target=\"_blank\" rel=\"nofollow noopener\">leave policy<\/a>) and answers leave-related queries. It uses PyPDF2 to extract text from the PDF and responds based on the document\u2019s content. It only gets activated if the query is about \u201cleave\u201d.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-2-update-the-config-file-2\">Step 2: Update the Config File<\/h4>\n<p>As has been done in the previous task.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-step-3-restart-your-claude-desktop-app-2\">Step 3: Restart Your Claude Desktop App<\/h4>\n<p>As has been done in the previous task.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"325\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-25-at-11.26.34%E2%80%AFAM.webp\" alt=\"Restart Your Claude Desktop App\" class=\"wp-image-228163\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-25-at-11.26.34%E2%80%AFAM.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-25-at-11.26.34%E2%80%AFAM-300x112.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-25-at-11.26.34%E2%80%AFAM-768x286.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-25-at-11.26.34%E2%80%AFAM-150x56.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-step-4-ask-claude-0\">Step 4: Ask Claude<\/h4>\n<p>To test this tool, I added the following prompt to my Claude app: \u201cCan I take half day leave?\u201d<\/p>\n<p>Claude processes the prompt, realises it needs the access to the tool we had created and prompts us to grant it access to the tool.<\/p>\n<p>Once the tool is called, it is going to compile the information from the leave policy document and the original query. It would then feed it to the claude LLM and ask it to answer based on it. To do this, the tool will read your PDF in real time and share the information to the LLM.<\/p>\n<p>Finally you get the response based on the leave policy.<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"591\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/task-4.webp\" alt=\"Restart Your Claude Desktop App&#10;\" class=\"wp-image-228164\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/task-4.webp 872w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/task-4-300x203.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/task-4-768x521.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/task-4-150x102.webp 150w\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"\/><\/figure>\n<p>This way you can build customised tools to access different files on your system without having to upload the files again and again!<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-advantages-of-using-mcp\">Advantages of Using MCP<\/h2>\n<p>After the above hands-on, it\u2019s easier to answer this question. Using model context protocol:<\/p>\n<ul class=\"wp-block-list\">\n<li>Eliminates manual data uploads or custom integrations.<\/li>\n<li>Allows LLMs to work with both local and cloud-based systems.<\/li>\n<li>Standardises the way any client works with a server as long as they are using the same protocol.<\/li>\n<li>Supports SDKs in Python, TypeScript, Kotlin, and Java.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-what-are-the-possibilities-with-mcp\">What Are the Possibilities with MCP?<\/h2>\n<p>MCP brings with itself a bag of opportunities and possibilities. Here are a few ways it can enhance existing workflows:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Multi-Step Projects:<\/strong> WIth MCP, AI systems can seamlessly coordinate tasks across multiple platforms, like planning events or managing projects, without complex integrations.<\/li>\n<li><strong>Real-World Awareness:<\/strong> It allows AI to interact with smart environments, IoT devices, and OS functions, making AI more proactive and intuitive.<\/li>\n<li><strong>Collaborating Agents:<\/strong> Using MCP, multiple specialized AI agents can work together, exchanging information and collaborating dynamically without direct integrations.<\/li>\n<li><strong>Personal AI Assistants: <\/strong>With MCP, deeply personalized assistants can be created that securely access personal data and devices, without exposing sensitive information to third parties.<\/li>\n<li><strong>Enhanced Customer Support:<\/strong> Combined with MCP, AI systems can provide context-aware customer service by accessing real-time data, improving response quality and efficiency.<\/li>\n<li><strong>Document Processing:<\/strong> It allows AI models to read, process, and respond based on documents stored locally or in the cloud, such as contracts or legal policies.<\/li>\n<\/ol>\n<p>These are only a few of the unlimited possibilities of MCP across various fields like software development, healthcare, finance and more!<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-why-are-we-suddenly-talking-about-mcp\">Why Are We Suddenly Talking About MCP?<\/h2>\n<p>So far, we have covered everything about MCP \u2013 from what it is to how to use it, why to use it, and its applications. But there is still one question that needs to be answered: Why are we and the whole world talking about it now \u2013 almost 5 months after it was launched?<\/p>\n<p>Well, there are 3 main reasons for this:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Need for AI Agents:<\/strong> Since last year, there has been a wave of AI agents in the market. Although these agents have become much smarter, they still struggle to work well with real-world data and tools (like calendars, emails, or databases). MCP fixes this by standardizing how AI connects to these tools, making it easier for them to work together.<\/li>\n<li><strong>Community Momentum:<\/strong> Popular companies like Cursor, Continue, Source Graph, and more are <a href=\"https:\/\/modelcontextprotocol.io\/clients\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">MCP clients<\/a>, while companies like Github, One Drive, Google Drive, etc. are in the list of its <a href=\"https:\/\/modelcontextprotocol.io\/examples\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">servers<\/a>. Both these lists are growing day by day, as more and more companies join the MCP world.<\/li>\n<li><strong>Model-Agnostic &amp; Open Source:<\/strong> MCP is open-source and works with any AI model. Whether you\u2019re using Claude, GPT-4, or any other AI system, MCP connects them to real-world data and tools. Unlike closed systems, you aren\u2019t locked into one particular model or service.<\/li>\n<\/ol>\n<p>These are a few of many reasons on why the world is talking about MCP and why it is going to make waves in the coming few months.\u00a0<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>Model Context Protocol (MCP) is revolutionizing how AI systems interact with the real world by providing seamless integration with tools, databases, and local files. With MCP, AI agents can now effortlessly access relevant data and perform complex tasks without needing custom code or manual integrations. Whether it\u2019s improving customer service, automating workflows, or enhancing personal AI assistants, MCP unlocks powerful new possibilities for AI models, making them more efficient, intuitive, and adaptable. As businesses and developers continue to adopt MCP, its potential to enhance AI-driven systems will only grow, opening up new opportunities across industries.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"schema-faq wp-block-yoast-faq-block\">\n<div class=\"schema-faq-section\" id=\"faq-question-1742904005029\"><strong class=\"schema-faq-question\">Q1. What is Model Context Protocol (MCP)?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. MCP is an open standard that enables AI models to access real-world data, such as local files, documents, and databases, seamlessly and efficiently.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904018347\"><strong class=\"schema-faq-question\">Q2. How does MCP work?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. MCP connects an AI client (like Claude or an IDE) with a server (local or remote data source), allowing the AI to request and use context without manual input or custom coding.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904027915\"><strong class=\"schema-faq-question\">Q3. Do I need a paid subscription for Claude to use MCP?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. While the free version of Claude works, it often hits rate limits, making it less convenient. A paid version removes these restrictions.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904036650\"><strong class=\"schema-faq-question\">Q4. What are the basic requirements to use MCP?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. You\u2019ll need Python 3.11+, Claude Desktop App, an IDE like VS Code, and some local documents for the tasks.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904044946\"><strong class=\"schema-faq-question\">Q5. Can MCP work with any AI model?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Yes, MCP is model-agnostic and can be used with any AI model, including Claude, GPT-4, and open-source LLMs.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904054896\"><strong class=\"schema-faq-question\">Q6. What tools can be connected using MCP?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. MCP allows AI to access a variety of tools such as Google Drive, GitHub, Notion, emails, and local files.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1742904069363\"><strong class=\"schema-faq-question\">Q7. How do I set up the configuration file for Claude?\u00a0<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. You need to go to Claude\u2019s settings under the developer section and create a claude_desktop_config.json file that maps your tools to Claude\u2019s interface.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/anu81685\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_Z9nKPBc.webp\" width=\"48\" height=\"48\" alt=\"Anu Madan\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>   Anu Madan has 5+ years of experience in content creation and management. Having worked as a content creator, reviewer, and manager, she has created several courses and blogs. Currently, she working on creating and strategizing the content curation and design around Generative AI and other upcoming technology.    <\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>You\u2019ve built applications with LLMs. You\u2019ve played with agents. Maybe you\u2019ve even worked with LangChain, AutoGen, or OpenAI\u2019s Assistants API. Isn\u2019t it impressive how much these models can reason, understand, and generate? But the moment your agent needs to do something real, like check a database, read from a CRM, or fetch a Google Doc; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":155776,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[25217,49787,1168,14524],"dealstore":[],"offerexpiration":[],"class_list":["post-155775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-context","tag-mcp","tag-model","tag-protocol"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use MCP: Model Context Protocol - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=155775\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use MCP: Model Context Protocol - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"You\u2019ve built applications with LLMs. You\u2019ve played with agents. Maybe you\u2019ve even worked with LangChain, AutoGen, or OpenAI\u2019s Assistants API. Isn\u2019t it impressive how much these models can reason, understand, and generate? But the moment your agent needs to do something real, like check a database, read from a CRM, or fetch a Google Doc; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=155775\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-25T13:25:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"661\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=155775#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"How to Use MCP: Model Context Protocol\",\"datePublished\":\"2025-03-25T13:25:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775\"},\"wordCount\":2969,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp\",\"keywords\":[\"Context\",\"MCP\",\"Model\",\"Protocol\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=155775#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=155775\",\"url\":\"https:\/\/fivemor.com\/?p=155775\",\"name\":\"How to Use MCP: Model Context Protocol - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp\",\"datePublished\":\"2025-03-25T13:25:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=155775#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=155775\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=155775#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp\",\"width\":872,\"height\":661},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=155775#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use MCP: Model Context Protocol\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use MCP: Model Context Protocol - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=155775","og_locale":"en_US","og_type":"article","og_title":"How to Use MCP: Model Context Protocol - Som2ny Network","og_description":"You\u2019ve built applications with LLMs. You\u2019ve played with agents. Maybe you\u2019ve even worked with LangChain, AutoGen, or OpenAI\u2019s Assistants API. Isn\u2019t it impressive how much these models can reason, understand, and generate? But the moment your agent needs to do something real, like check a database, read from a CRM, or fetch a Google Doc; [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=155775","og_site_name":"Som2ny Network","article_published_time":"2025-03-25T13:25:11+00:00","og_image":[{"width":872,"height":661,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"17 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=155775#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=155775"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"How to Use MCP: Model Context Protocol","datePublished":"2025-03-25T13:25:11+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=155775"},"wordCount":2969,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=155775#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp","keywords":["Context","MCP","Model","Protocol"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=155775#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=155775","url":"https:\/\/fivemor.com\/?p=155775","name":"How to Use MCP: Model Context Protocol - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=155775#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=155775#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp","datePublished":"2025-03-25T13:25:11+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=155775#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=155775"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=155775#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Screenshot-2025-03-24-at-3.32.29E280AFPM.webp.webp","width":872,"height":661},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=155775#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"How to Use MCP: Model Context Protocol"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/155775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155775"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/155775\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/155776"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155775"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=155775"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=155775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}