<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubham Mishra on Medium]]></title>
        <description><![CDATA[Stories by Shubham Mishra on Medium]]></description>
        <link>https://medium.com/@mishrashubham843?source=rss-103097b2421f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_VI4CKQH7Z-8s-RhSEyocw.jpeg</url>
            <title>Stories by Shubham Mishra on Medium</title>
            <link>https://medium.com/@mishrashubham843?source=rss-103097b2421f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 19:38:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mishrashubham843/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Ultimate Guide to MCP (Model Context Protocol)]]></title>
            <link>https://medium.com/@mishrashubham843/the-ultimate-guide-to-mcp-model-context-protocol-e0a1f0bdc71c?source=rss-103097b2421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0a1f0bdc71c</guid>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[modelcontext]]></category>
            <dc:creator><![CDATA[Shubham Mishra]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 16:16:33 GMT</pubDate>
            <atom:updated>2025-12-15T16:16:33.311Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Pain Point: The “Siloed Agent” Problem</h3><p>If you are an engineer building AI Agents today (using <strong>LangGraph</strong>, <strong>AutoGen</strong>, or <strong>CrewAI</strong>), you know the struggle. You build a brilliant agent, but it is locked in a <strong>Silo</strong>.</p><ul><li>It can’t see your local files.</li><li>It can’t query your internal PostgreSQL database.</li><li>It can’t check your Linear tickets.</li></ul><h4>The Old Way (Integration Hell)</h4><p>To fix this, you write “Connectors.” You write a Python function to talk to Postgres. Then another for Slack. Then another for your file system. In Agentic language, these are called <strong>Tools</strong>.</p><p><strong>The Problem:</strong> Every time you switch frameworks (e.g., moving from a LangGraph agent to Claude Desktop), you have to rewrite these tools from scratch. You are maintaining 10 different custom tools for 10 different platforms. It is unmaintainable spaghetti code.</p><h4>The Solution: MCP (The Universal Port)</h4><p>MCP acts like a <strong>USB-C port</strong> for AI applications.</p><ul><li><strong>Before MCP:</strong> You build a specific “Database Tool for LangGraph.”</li><li><strong>After MCP:</strong> You build <strong>one</strong> “Database MCP Server.”</li></ul><p>Now, Claude Desktop, Cursor, and your custom LangGraph agent can <em>all</em> plug into it instantly. <strong>Write once, connect everywhere.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*x6zoWXw00HUc6WXHFhuLbg.png" /></figure><h3>The Mental Model: Architecture Deep Dive</h3><p>To master MCP, you need to understand the three key players. Think of this like a <strong>High-End Restaurant</strong>.</p><h4>1. The Components</h4><ol><li><strong>The Host (The Customer):</strong> This is the AI application. It could be <strong>Claude Desktop</strong>, <strong>Cursor</strong>, or <strong>your custom Agent</strong> (built with LangGraph/AutoGen). It has the intent (“I need to query the database”) but lacks the access.</li><li><strong>The Client (The Waiter):</strong> The connector inside the Host. It takes the agent’s intent, translates it into the correct protocol (JSON-RPC), and sends it to the kitchen.</li><li><strong>The Server (The Kitchen):</strong> The external process (e.g., <strong>GitHub</strong>, <strong>Database</strong>, <strong>File System</strong>). It holds the data and executes the actual work.</li></ol><h4>2. The Layers (The “How”)</h4><p>How do they actually understand each other? Through two specific layers.</p><p><strong>A. The Data Layer (JSON-RPC)</strong></p><p>This is the language they speak. No matter what the tool is, the messages always look the same.</p><ul><li><strong>Example Request:</strong></li></ul><p>{ “jsonrpc”: “2.0”, “method”: “tools/call”, “params”: { … } }</p><ul><li><strong>Why it matters:</strong> It’s lightweight, stateless, and universally supported.</li></ul><p><strong>B. The Transport Layer (The Road)</strong></p><p>This is how the JSON message travels.</p><ul><li><strong>Stdio (Local):</strong> Like passing notes in class. The Host launches the Server as a subprocess and talks via Standard Input/Output. <em>Best for: Local files, privacy, speed.</em></li><li><strong>HTTP+SSE (Remote):</strong> Like sending a text message. Uses HTTP and Server-Sent Events. <em>Best for: Cloud deployments, sharing tools with a team.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*9bAznB9rj3M52AdD0uhtkw.png" /></figure><h4>3. The Menu (Primitives)</h4><p>An MCP Server exposes three specific capabilities to the Agent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*C7J8D90RP3aYmpY-gr0UAA.png" /></figure><h4>4. The Lifecycle</h4><p>The connection isn’t random; it follows a strict 3-step dance to prevent errors.</p><ol><li><strong>Handshake (Initialization):</strong></li></ol><ul><li><strong>Client:</strong> “Hello, I speak MCP version 2024–11.”</li><li><strong>Server:</strong> “Hi. I support <strong>Tools</strong> and <strong>Resources</strong>.”</li><li><strong>Client:</strong> “Acknowledged. Let’s begin.”</li></ul><p><strong>2. Operation:</strong> The Agent sends tool calls, and the Server responds with results.</p><p><strong>3. Shutdown:</strong> When you close the app, the Client sends a signal to kill the connection, ensuring no “zombie processes” eat up your RAM.</p><h3>The Quick Win: Using the Connectors Directory</h3><p>You don’t need to be a coder to give Claude superpowers. You can give Claude Desktop access to your tools immediately using the built-in <strong>Connectors Directory</strong>.</p><ul><li><strong>Step 1:</strong> Open <strong>Claude Desktop</strong>.</li><li><strong>Step 2:</strong> Look for the <strong>“Search and tools”</strong> icon near the chat input.</li><li><strong>Step 3:</strong> Click <strong>“Manage connectors”</strong> (or go to Settings &gt; Connectors).</li><li><strong>Step 4:</strong> You will see official connectors for tools like Filesystem, Google Drive, Notion, and GitHub.</li><li><strong>Step 5:</strong> Select a tool (e.g., Filesystem) and Click <strong>“Install”</strong> or <strong>“Connect”</strong>.</li></ul><p>The Result: Go back to the chat and ask: “Read the file notes.txt on my desktop and summarize it.”</p><p>Claude will instantly access the file via the connector and give you the answer. Zero coding required.</p><h3><strong>The Hero Project: Building “The Second Brain” (FastMCP 2)</strong></h3><p>Now let’s build something custom. We will build a <strong>Personal Knowledge Base Tool</strong>.</p><p><strong>The Goal:</strong> A system that lets you save thoughts, organize notes, and recall them directly through Claude Desktop without switching apps.</p><ul><li><strong>Resources:</strong> Your Agent can read your local notes.</li><li><strong>Tools:</strong> Your Agent can append new ideas to files.</li></ul><p><strong>Tech Stack:</strong> Python, uv (modern package manager), and the <strong>FastMCP 2</strong> library.</p><h4>Step 1: Setup</h4><p>Open your terminal. We use uv because it is faster and cleaner than pip.</p><pre># Create a new project<br>uv init second-brain<br>cd second-brain<br><br># Install the FastMCP 2 library<br>uv add fastmcp</pre><h4>Step 2: The Code (server.py)</h4><p>We use FastMCP (v2), which removes all the boilerplate. It is the “FastAPI” of MCP.</p><pre>from fastmcp import FastMCP<br>from datetime import datetime<br>import os<br><br>NOTES_DIR = &quot;./my_notes&quot;<br>if not os.path.exists(NOTES_DIR):<br>    os.makedirs(NOTES_DIR)<br><br>mcp = FastMCP(&quot;Second Brain&quot;)<br><br><br>@mcp.tool()<br>def list_notes() -&gt; str:<br>    &quot;&quot;&quot;List all available notes in the second brain.&quot;&quot;&quot;<br>    notes = os.listdir(NOTES_DIR)<br>    if not notes:<br>        return &quot;No notes found.&quot;<br>    return &quot;Available notes:\n&quot; + &quot;\n&quot;.join(f&quot;- {note}&quot; for note in notes)<br><br><br>@mcp.tool()<br>def read_note(filename: str) -&gt; str:<br>    &quot;&quot;&quot;Read the full content of a specific note file.&quot;&quot;&quot;<br>    try:<br>        with open(os.path.join(NOTES_DIR, filename), &quot;r&quot;) as f:<br>            return f.read()<br>    except FileNotFoundError:<br>        return f&quot;Note &#39;{filename}&#39; not found.&quot;<br><br><br>@mcp.tool()<br>def save_thought(filename: str, content: str) -&gt; str:<br>    &quot;&quot;&quot;Save a new thought or append to an existing note file.&quot;&quot;&quot;<br>    filepath = os.path.join(NOTES_DIR, filename)<br>    timestamp = datetime.now().strftime(&quot;%Y-%m-%d %H:%M&quot;)<br>    with open(filepath, &quot;a&quot;) as f:<br>        f.write(f&quot;\n[{timestamp}] {content}&quot;)<br>    return f&quot;Saved thought to {filename}&quot;<br><br><br>@mcp.prompt()<br>def daily_review() -&gt; str:<br>    &quot;&quot;&quot;Returns a prompt for summarizing the day&#39;s thoughts.&quot;&quot;&quot;<br>    notes = os.listdir(NOTES_DIR)<br>    return f&quot;Please review the following notes: {notes}. Summarize the key ideas added today.&quot;<br><br><br>if __name__ == &quot;__main__&quot;:<br>    mcp.run()</pre><h4>Step 3: Connecting Your Server</h4><p>Because we are using FastMCP 2, we don’t even need to edit the config file manually!</p><p>Run this command in your terminal:</p><pre>uv run fastmcp install claude-desktop server.py</pre><p><strong>The Magic:</strong></p><ol><li>Restart Claude.</li><li>Type: <em>“Add a note to ideas.txt that I need to learn Rust.”</em></li><li>Check your folder. The file is there. You just gave your Agent a permanent memory.</li></ol><h3>Troubleshooting: If It Doesn’t Connect</h3><p>If you see a “Connection Failed” error, Claude likely cannot find the uv tool.</p><p><strong>Fix 1: Use the Absolute Path for uv</strong></p><ol><li>Find the path:</li></ol><ul><li><strong>Windows:</strong> where uv</li><li><strong>Mac/Linux:</strong> which uv</li></ul><ol><li>Update claude_desktop_config.json: Copy that path (e.g., /Users/me/.cargo/bin/uv) and paste it into the “command” field.</li></ol><p><strong>Fix 2: Set the Working Directory</strong></p><p>If uv runs but fails to find server.py, explicitly tell it where to look by updating the “args” list:</p><pre>&quot;args&quot;: [<br>  &quot;--directory&quot;,<br>  &quot;/ABSOLUTE/PATH/TO/YOUR/PROJECT/FOLDER&quot;,<br>  &quot;run&quot;,<br>  &quot;server.py&quot;<br>]</pre><h3>Going Professional: Remote &amp; Custom Agents</h3><h4>Scenario A: “I need to share this tool with my team.”</h4><p>Local servers (stdio) only work on <em>your</em> laptop. To share them, you deploy them as a <strong>Remote Server (SSE)</strong>.</p><p>The Code Change:</p><p>Change just one line in your server.py:</p><pre># Old (Local)<br># mcp.run()<br># New (Remote)<br>mcp.run(transport=&quot;sse&quot;)</pre><p>You can now deploy this script to AWS, Render, or Railway. It will give you a URL (e.g., <a href="https://my-notes.railway.app/sse).">https://my-notes.railway.app/sse).</a> Your team puts <em>that</em> URL into their Claude config.</p><h3>Scenario B: “I want to use this with my LangGraph Agent.”</h3><p>You aren’t limited to Claude. You can connect this to your custom agents using langchain-mcp-adapters.</p><h3>Conclusion</h3><p>You are no longer just writing scripts. You are building <strong>AI Infrastructure</strong>.</p><p>By wrapping your data and tools in <strong>MCP Servers</strong>, you future-proof your work. Whether your company uses Claude today, OpenAI tomorrow, or a local Llama model next year, your tools will work with all of them, zero code changes required.</p><p>If you found this guide useful, I share more deep dives on AI infrastructure and Agentic workflows on <a href="https://www.linkedin.com/in/shubhammishra-ai/"><strong>LinkedIn</strong></a>. Follow along for more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0a1f0bdc71c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript: Different ways to create an object from another object.]]></title>
            <link>https://medium.com/@mishrashubham843/javascript-different-ways-to-create-an-object-from-another-object-67397f8dfe65?source=rss-103097b2421f------2</link>
            <guid isPermaLink="false">https://medium.com/p/67397f8dfe65</guid>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shubham Mishra]]></dc:creator>
            <pubDate>Thu, 25 Oct 2018 09:29:43 GMT</pubDate>
            <atom:updated>2018-10-25T09:41:25.737Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we will learn different ways of creating an object from another object, and difference between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*3Bf5DMZ_cN3SOC-0px8Crw.png" /></figure><p>Let’s create an object using object literal as:</p><pre><strong>let a = {</strong></pre><pre><strong>id: 23,</strong></pre><pre><strong>name: &#39;Sam&#39;</strong></pre><pre><strong>};</strong></pre><p>Now we will see different ways of creating object from this object:</p><h3>1) Using Object.create(obj):</h3><p>This way of creating object use delegation, means instead of copying object into another, this will create link/reference of old object into new object so that if requested property is not present in new object it will look up for them in old object and returns them if present.</p><p>Another advantage of delegation is that if any changes will be made in old object then those will be reflected in new object as well.</p><pre><strong>let b = Object.create(a);</strong></pre><pre><strong>console.log(a); //{id: 23, name: &quot;Sam&quot;}</strong></pre><pre><strong>console.log(b); //{}</strong></pre><p>In above code when we prints the ‘b’ object it will show nothing but if we request any property example ‘id’, then it will return that property from parent/old object(a).</p><pre><strong>console.log(a.id); //23</strong></pre><pre><strong>console.log(b.id); //23</strong></pre><p>Now let’s add a new property “section” in ‘a’ (old object).</p><pre><strong>a.section = &#39;C&#39;;</strong></pre><pre><strong>console.log(a.section); //C</strong></pre><pre><strong>console.log(b.section); //C</strong></pre><p>So here we’ve added a new property to ‘a’( old object ), and that property is also available to ‘b’( new object ).</p><h3>2) Using Object.assign( {}, obj ):</h3><p>This way will create the object by simply copying all the properties from old object to new object, this can also be said as 1-time copying, means if any changes will be made in old object, those changes will not be reflected in new object.</p><pre><strong>let c = Object.assign({}, a);</strong></pre><pre><strong>console.log(a); //{id: 23, name: &quot;Sam&quot;}</strong></pre><pre><strong>console.log(c); //{id: 23, name: &quot;Sam&quot;}</strong></pre><p>In above code if we print ‘c’(new object) then this will print all the properties that are present in ‘a’(old object), that means all the properties are copied from ‘a’ to ‘c’ object and there is no delegation present.</p><pre><strong>console.log(a.id); //23</strong></pre><pre><strong>console.log(c.id); //23</strong></pre><p>Now let’s add a new property in ‘a’(old object).</p><pre><strong>a.year = 2018;</strong></pre><pre><strong>console.log(a.year); //2018</strong></pre><pre><strong>console.log(c.year); //undefined</strong></pre><p>Now here we’ve added ‘year’ property to ‘a’(old object) but if we try to request that property using ‘c’ object then it will prints undefined, since the changes made to old object can’t be reflected to new object.</p><h3>3) JSON’s parse() and stringify():</h3><p>JSON’s parse(string) converts the string into JavaScript object.</p><p>JSON’s stringify(object) converts the JavaScript object into string.</p><p>so we will use these two methods to create a new object from old object. We first convert the old object into string using <strong>stringify()</strong> method, then we convert this string into JavaScript object using <strong>parse()</strong> method.</p><pre><strong>let d = JSON.parse(JSON.stringify(a));</strong></pre><pre><strong>console.log(a); //{id: 23, name: &quot;Sam&quot;}</strong></pre><pre><strong>console.log(d); //{id: 23, name: &quot;Sam&quot;}</strong></pre><pre><strong>console.log(a.id); //23</strong></pre><pre><strong>console.log(d.id); //23</strong></pre><p>we can also say this way as 1-time copy, as in above code when we prints ‘d’(new object) it will prints all the properties, now if we make any changes to ‘a’(old object) then these changes will not be available in ‘d’(new object).</p><pre><strong>a.grade = &#39;A+&#39;;</strong></pre><pre><strong>console.log(a.grade); //A+</strong></pre><pre><strong>console.log(d.grade); //undefined</strong></pre><p>As we can see we’ve added ‘grade’ property to ‘a’(old object), but it’s not available in ‘d’(new object).</p><p>This is all about the different ways of creating an object from another object.</p><p>Hope this might have helped you to understand JavaScript better</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67397f8dfe65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>