<?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 Venkatesh Manikantan on Medium]]></title>
        <description><![CDATA[Stories by Venkatesh Manikantan on Medium]]></description>
        <link>https://medium.com/@venkateshvishwanath99?source=rss-ce3412136ece------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SoTYGo4JMPNIzDgT3WvL0A.jpeg</url>
            <title>Stories by Venkatesh Manikantan on Medium</title>
            <link>https://medium.com/@venkateshvishwanath99?source=rss-ce3412136ece------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:39:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@venkateshvishwanath99/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[From a Dusty Thesis to a Live API: Predicting an Enzyme’s Optimum Temperature from Sequence Alone]]></title>
            <link>https://medium.com/@venkateshvishwanath99/from-a-dusty-thesis-to-a-live-api-predicting-an-enzymes-optimum-temperature-from-sequence-alone-61d0b13a1935?source=rss-ce3412136ece------2</link>
            <guid isPermaLink="false">https://medium.com/p/61d0b13a1935</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[protein-engineering]]></category>
            <category><![CDATA[bioinformatics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Venkatesh Manikantan]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 16:38:25 GMT</pubDate>
            <atom:updated>2026-07-24T16:38:25.999Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Years later, I went back to my master’s thesis, where I taught a machine to read a protein sequence and guess the temperature it likes best. This time I didn’t stop at the write-up. I put the model online so anyone can try it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5EHcsSnSgO1c28oU2c7nw.gif" /><figcaption><em>From amino-acid sequence to thermal fingerprint : Link: </em><a href="https://enzyme-topt-frontend-production.up.railway.app/">https://enzyme-topt-frontend-production.up.railway.app/</a></figcaption></figure><h3><em>Going back to something I made years ago</em></h3><p>There’s a particular feeling that comes with reopening old work. You brace yourself, half-expecting to be embarrassed by it. But when I reopened my master’s thesis, <em>A Machine Learning Approach Towards Optimum Temperature Prediction for Enzymes</em>, done at <strong>KU Leuven</strong>, I didn’t feel embarrassment. I felt something closer to unfinished business.</p><p>The thesis answered a genuinely interesting question. It sat in a PDF. And then, like most theses, it went quiet.</p><p>The thing that kept pulling at me wasn’t the model. It was that <strong>nobody could actually use it.</strong> A model that lives only inside a results chapter is a bit like a recipe you never cook. Technically complete, practically inert. So I decided to do the part I never did back then. I wrapped it in an API, put a proper interface on top, and made the whole thing something you can <em>poke at</em> with your own protein sequence.</p><p>This post is both a walk through the science and an honest account of dragging a years-old model into the daylight.</p><h3>The problem: why an enzyme’s favourite temperature is worth predicting</h3><p>Every enzyme has a temperature at which it works best, its <strong>optimum temperature</strong>, or <strong>Topt</strong>. Go below it and the chemistry slows down. Go too far above it and the protein starts to unfold and quit. That single number matters enormously in the real world. Industrial biocatalysis, protein engineering, and screening large enzyme libraries all hinge on knowing how an enzyme behaves thermally.</p><p>Here’s the catch. <strong>Measuring Topt in a lab is slow and expensive.</strong> You express the protein, purify it, and run assays across a temperature gradient. Multiply that by thousands of candidate enzymes and the cost becomes the bottleneck.</p><p>Meanwhile, the <em>sequence</em> of an enzyme, the string of amino acids that defines it, is cheap and abundant. UniProt and genome-sequencing projects have given us protein sequences by the million.</p><p>So the thesis boiled down to one stubborn question:</p><blockquote><strong><em>Can we predict an enzyme’s optimum temperature from its amino-acid sequence alone, with no wet lab and no organism data, just the letters?</em></strong></blockquote><p>If the answer is yes, you get to <em>triage</em> enzyme libraries in silico. You can rank thousands of candidates in seconds and only send the promising ones to the bench.</p><h3>The data, and turning a sequence into numbers</h3><p>A model can’t read MKALIV…. It needs numbers. So the first real job was <strong>feature extraction</strong>, converting each protein sequence into a vector of numerical descriptors that capture its composition and physicochemical character.</p><p>I built this on the <strong>protlearn</strong> library, and the result was almost comically high-dimensional: roughly <strong>9,969 features per sequence</strong>. These aren&#39;t arbitrary. They come in interpretable families:</p><ul><li><strong>Amino-acid composition (AAC).</strong> How often each of the 20 amino acids appears.</li><li><strong>AAIndex1 physicochemical scales.</strong> Hundreds of properties like hydrophobicity, polarity and charge, z-score standardised.</li><li><strong>Di- and tripeptide n-grams.</strong> 400 dipeptide plus 8,000 tripeptide patterns. This is where most of that dimensionality co</li><li>mes from.</li><li><strong>CTD descriptors.</strong> Composition, Transition and Distribution of grouped properties.</li><li><strong>Autocorrelation</strong> (Moreau-Broto, Moran, Geary). How properties correlate along the chain.</li><li><strong>PAAC / APAAC, CKSAAP, SOCN, QSO.</strong> Pseudo amino-acid composition and sequence-order couplings that try to smuggle <em>positional</em> information into a fixed-length vector.</li></ul><p>The curated dataset paired <strong>2,917 enzyme sequences</strong> with measured optimum temperatures, and a combined set pushed this toward ~12,000. It spanned a remarkable <strong>0 to 120 °C</strong>, from psychrophilic enzymes that work in near-freezing water to hyperthermophilic ones happy above the boiling point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lL1lH8KWvFRWvtZ9DicUUw.png" /><figcaption><em>The real thesis dataset (n = 2,917), each bar coloured cold-to-hot. Most enzymes pile up in the 20–40 °C “low” band, and the hot ones thin out toward 100 °C. That imbalance is exactly why, later, the low-temperature ranges turned out hardest to pull apart.</em></figcaption></figure><p>Nearly ten thousand features for under three thousand samples is a textbook recipe for overfitting. Which leads straight to the next problem.</p><h3>Step 1 — Taming ~10,000 dimensions</h3><p>When you have far more features than samples, and those features are wildly redundant (tripeptide counts overlap heavily), you have to compress. I explored the usual suspects: <strong>PCA, Kernel PCA, autoencoders, and t-SNE.</strong></p><p>The finding was clean and a little humbling. <strong>PCA captured ~94% of the variance in about 2,000 components, and just ~79 components already crossed an 80% variance threshold.</strong> In other words, those 9,969 features were mostly saying the same things in different accents.</p><p>But the more <em>biologically</em> interesting result came from looking at how the enzymes arranged themselves in this compressed space:</p><blockquote><strong><em>Enzymes above 60 °C cluster together, and enzymes below 40 °C cluster very tightly.</em></strong></blockquote><p>That was an early warning. The cold-loving enzymes sit almost on top of each other in feature space. It was a hint, well before any model was trained, that <strong>low-temperature ranges would be the hardest to tell apart.</strong> Foreshadowing, in data form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y59Ta8KcGuNPbq6PfeS9aA.png" /><figcaption><em>In reduced space, high-temperature and low-temperature enzymes clump, an early sign of which ranges would be easy or hard</em></figcaption></figure><h3>Step 2 — Regression: predicting the exact temperature</h3><p>The first instinct is always regression: predict Topt as a continuous number in °C. I trained an <strong>XGBoost regressor</strong>, gradient-boosted decision trees, and evaluated it with k-fold cross-validation.</p><p>The headline numbers:</p><ul><li><strong>R²:</strong> 0.66 on average, and up to <strong>0.72</strong> at its best.</li><li><strong>RMSE:</strong> roughly <strong>11.6 °C</strong> on average, down to <strong>10.6 °C</strong> at its best.</li></ul><p>An R² around 0.7 from sequence alone is a real signal. The sequence genuinely <em>carries</em> thermal information. But an RMSE of ~11 °C also tells you the honest truth. Predict 55 °C and the reality might be 45 °C or 66 °C. Useful for ranking, not for a spec sheet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*ED8tvwuCI7hv7C7vuIHYUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*GOTLhl6VO1g_a8UNgLOW1g.png" /><figcaption><em>Predicted vs. measured Topt. The trend is there; the scatter is the ~11 °C RMSE.”</em></figcaption></figure><h3>Step 3 — The reframe that actually worked: classification</h3><p>Here’s the pivot I’m still proud of. Instead of forcing the model to name an exact temperature, I asked it an easier, and more useful, question. <strong>Which temperature <em>band</em> does this enzyme fall into?</strong></p><p>I split Topt into five ranges:</p><ul><li><strong>0 to 20 °C</strong> — very low</li><li><strong>20 to 40 °C</strong> — low</li><li><strong>40 to 60 °C</strong> — medium</li><li><strong>60 to 80 °C</strong> — high</li><li><strong>80 to 120 °C</strong> — very high</li></ul><p>A boosted-forest XGBoost classifier predicts the band, and I compared <strong>CatBoost</strong> and <strong>LightGBM</strong> as alternatives inside a cascade ensemble. <strong>Classification turned out to be meaningfully more robust than exact regression,</strong> which makes sense. Asking “is this a hot enzyme or a cold one?” is a question the sequence can answer more confidently than “is this 57 °C or 61 °C?”</p><p>The results matched the earlier foreshadowing almost perfectly:</p><ul><li><strong>Micro-averaged ROC-AUC ≈ 0.94.</strong> Strong overall separability.</li><li><strong>The very-high-temperature class (&gt;80 °C) hit an AUC of ~0.94.</strong> The model is <em>excellent</em> at spotting hyperthermophiles.</li><li><strong>The low-temperature ranges were the weakest,</strong> exactly the tightly-clustered enzymes PCA had flagged.</li></ul><p>The model, in other words, is best precisely where industry often cares most, which is finding the heat-tolerant enzymes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*gPX1C1v73ujEVo18pMbAGg.png" /><figcaption><em>Per-class ROC. The high-temperature class is the star; the cold classes lag.</em></figcaption></figure><p><strong>Model, briefly, for the curious.</strong> XGBoost, up to 300 parallel trees, learning rate 0.01, tree depth 10, 50% row subsampling and 20% feature subsampling. Deliberately heavy regularisation to survive that feature-to-sample ratio.</p><h3>Making the model explain itself: SHAP and LIME</h3><p>A prediction you can’t interrogate is a prediction you can’t trust. That’s doubly true in biology, where a reviewer will (rightly) ask <em>why</em>.</p><p>So both then and now, the pipeline leans on two explainability tools:</p><ul><li><strong>SHAP</strong> attributes each prediction back to the features that pushed it. It’s grounded in game theory, giving a consistent per-feature contribution.</li><li><strong>LIME</strong> builds a simple local surrogate around a single prediction to show which features mattered <em>for this specific sequence</em>.</li></ul><p>Together they turn the model from a black box into something closer to a colleague that shows its work. <em>This enzyme reads as high-temperature largely because of these compositional and physicochemical features.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jz6B9hXdxFcvqSJlWP5yWQ.png" /><figcaption><em>Left: the features that move the five-band classifier, coloured by class. Right: how each feature pushes the continuous Topt prediction up or down. SHAP turns “the model said so” into “the model said so because of these features.”</em></figcaption></figure><h3>The part I never did back then: making it usable</h3><p>This is where revisiting the thesis stopped being nostalgia and became a build. Back then the model lived as a pile of pickled files and a notebook that only ran on my machine. This time I wrapped it in a proper stack: a FastAPI backend serving the models, and a Next.js playground on top, deployed so it has a real URL instead of living on localhost.</p><p>Honestly, the best way to get it is to <em>use</em> it. Paste a protein sequence and you get a predicted temperature, a probability across the five bands, and the SHAP and LIME explanations side by side. So rather than describe it any further, I’ll just say: <strong>go try it for yourself.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MqXFKRdbQPk4GewshDtgZw.png" /></figure><p>🔗 <strong>Try it live:</strong> https://enzyme-topt-frontend-production.up.railway.app 🔗</p><h3>How the field moved while I was away</h3><p>Revisiting old work means seeing how far everyone else has walked. Predicting enzyme Topt from sequence has become a small, active niche, and it’s worth situating my thesis honestly against it:</p><ul><li><strong>TOMER</strong> reaches an impressive R² ≈ 0.94, but it <em>requires the organism’s optimal growth temperature (OGT)</em> as an input, and analysis shows OGT contributes ~50% of its predictive power. Powerful, but not sequence-<em>only</em>.</li><li><strong>Preoptem</strong>, a sequence-only CNN, is fully sequence-based but lands around R² ≈ 0.36.</li><li><strong>DeepET</strong> leans on transfer learning from OGT and reports RMSE ≈ 12.2 °C.</li><li><strong>Seq2Topt</strong> (2024) brings the modern hammer, a pre-trained <strong>protein language model (ESM-2)</strong> with attention, reaching RMSE ≈ 12.26 °C, MAE ≈ 8.89 °C, R² ≈ 0.57 on its test set, and outperforming the earlier sequence-only tools.</li></ul><p>What strikes me is this. My old, <strong>sequence-only</strong> XGBoost pipeline, with no OGT crutch, posted a best RMSE of <strong>~10.6 °C</strong> and R² up to <strong>0.72</strong>. That’s genuinely in the same conversation as approaches published years later, and on RMSE it holds its ground against even the language-model methods. Classical feature engineering plus gradient boosting was not a bad bet.</p><p>It also makes the road ahead obvious. <strong>If I were starting today, I’d start where Seq2Topt is.</strong> Protein-language-model embeddings (ESM-2) instead of ~10,000 hand-crafted descriptors, and I’d treat OGT as an optional signal rather than a dependency. The thesis was a strong classical baseline. The next version should be a modern one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ge_EiSc9VufPmn4OO03ApA.png" /><figcaption><em>Where the thesis stands. On R², TOMER leads, but it leans on organism growth temperature (OGT); among the sequence-only methods the thesis holds up well. On RMSE it’s actually the lowest of the group at 10.6 °C. (Each number is that method’s own reported figure, not a shared test split.)</em></figcaption></figure><h3>What I’d tell my thesis-writing self</h3><p>A few things crystallised in the re-visit:</p><ul><li><strong>Reframing the question beats forcing the model.</strong> Range classification quietly outperformed exact regression, because it asked the sequence a question it could actually answer.</li><li><strong>The data warned me before the model did.</strong> The PCA clustering of cold enzymes predicted the model’s weak spot before a single classifier was trained. Look at your data’s geometry early.</li><li><strong>Explainability isn’t a garnish.</strong> SHAP and LIME were what made the predictions defensible, then for the thesis, now for anyone who uses the API.</li></ul><h3>Closing the loop</h3><p>I didn’t revisit this thesis to change its conclusions. They’ve aged fine. I revisited it because a model that no one can run is a question left half-answered. Now the loop is closed. Paste a sequence, get a temperature and an explanation, in seconds, from a browser.</p><p>If you work with enzymes, or you just want to feed it a protein and watch it reason about heat, go try it. And if you build the ESM-2 successor before I do, I’d genuinely love to read <em>that</em> post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KDi6Qhy8iImIRw64ZqCz1A.jpeg" /></figure><p><em>— Venkatesh Manikantan</em> 🔗 <a href="https://www.linkedin.com/in/venkateshmanikantan/">LinkedIn</a> · <a href="https://enzyme-topt-frontend-production.up.railway.app/">Live app</a></p><h3>Sources &amp; further reading</h3><ul><li>Seq2Topt: a sequence-based deep learning predictor of enzyme optimal temperature, <em>Briefings in Bioinformatics</em>, 2024. <a href="https://academic.oup.com/bib/article/doi/10.1093/bib/bbaf114/8074761">https://academic.oup.com/bib/article/doi/10.1093/bib/bbaf114/8074761</a></li><li>Seq2Topt (open access, PMC): <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC11904407/">https://pmc.ncbi.nlm.nih.gov/articles/PMC11904407/</a></li><li>TOMER, Python package to predict enzyme catalytic optimum temperature: <a href="https://github.com/jafetgado/tomer/">https://github.com/jafetgado/tomer/</a></li><li>Enhancing ML Prediction of Enzyme Catalytic Temperature Optima through Amino Acid Conservation Analysis, <em>IJMS</em>, 2024. <a href="https://www.mdpi.com/1422-0067/25/11/6252">https://www.mdpi.com/1422-0067/25/11/6252</a></li><li>protlearn (protein feature extraction library): <a href="https://github.com/tadorfer/protlearn">https://github.com/tadorfer/protlearn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61d0b13a1935" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Static Graph to Agent Tool: Wiring a Knowledge Graph for Consumption with FastMCP]]></title>
            <link>https://medium.com/@venkateshvishwanath99/from-static-graph-to-agent-tool-wiring-a-knowledge-graph-for-consumption-with-fastmcp-cbb9e1f5f2c2?source=rss-ce3412136ece------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbb9e1f5f2c2</guid>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[deep-agent]]></category>
            <category><![CDATA[fastmcp]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <dc:creator><![CDATA[Venkatesh Manikantan]]></dc:creator>
            <pubDate>Fri, 19 Jun 2026 22:07:07 GMT</pubDate>
            <atom:updated>2026-06-19T22:07:07.052Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*jCXsEqbr3txWCrlN6bsYgQ.gif" /></figure><p>Over the last several months I have been digging into knowledge graphs, and not so much the building side of it. There is already a lot written about ontology design and the different principles you can apply when you model a domain. What kept pulling at me was the other end of the pipeline, the consumption layer, the part that an agent or a deep agent actually reaches into when it wants to use all that connected structure.</p><p>Here is the thing I kept coming back to. The methodology for building a KG ontology changes from one domain to another, and that is fine, that is expected. You model healthcare differently from how you model a supply chain. But once the graph exists, the question that matters is how anything is supposed to read it. What use is a rich, connected repository if nothing can harness the traversals running through it? A graph that cannot be queried in the way an agent thinks is just a very expensive database nobody talks to.</p><p>So my quest in this exploration led me into FastMCP, and into how quickly you can stand up custom, modular tools that a deep agent can call to walk a graph on its own terms.</p><h3>A quick intro to FastMCP</h3><p>FastMCP is a Python framework that turns plain functions into MCP (Model Context Protocol) tools. Once a function is registered as a tool, a client like Claude Code, Claude Desktop, or your own agent can call it. The framework reads your type hints to build the input schema and reads your docstring to tell the model what the tool does and how to use it, so you write normal Python and the protocol plumbing gets generated for you (<a href="https://gofastmcp.com/getting-started/welcome">gofastmcp.com</a>).</p><p>A bit of context that is worth knowing. FastMCP 1.0 was folded into the official MCP Python SDK back in 2024. What people install today is the standalone, actively maintained project from Prefect, and it has gone well beyond the base protocol with auth, clients, deployment, server composition, and more (<a href="https://github.com/PrefectHQ/fastmcp">github.com/PrefectHQ/fastmcp</a>). The reach is not small either. By the project’s own numbers it is downloaded around a million times a day and some version of FastMCP sits behind roughly 70 percent of MCP servers across all languages (<a href="https://gofastmcp.com/getting-started/welcome">gofastmcp.com</a>). So this is not a fringe library, it is close to the default way people expose tools to LLMs in Python.</p><p>FastMCP gives you three building blocks to work with. Tools are executable functions the model can call to do something, like run a query or walk a graph. Resources are read only data the client can pull in as context. Prompts are reusable templates that steer the model’s behaviour. For graph consumption, tools are where most of the action is (<a href="https://www.kdnuggets.com/fastmcp-the-pythonic-way-to-build-mcp-servers-and-clients">kdnuggets.com</a>).</p><h3>Step 1: Define a server</h3><pre>from fastmcp import FastMCP<br>mcp = FastMCP(&quot;Your server name&quot;)</pre><p>That single object represents your whole MCP application. Everything else hangs off it.</p><h3>Step 2: Register the tools</h3><pre>from .tools.graph_tools import tool_1, tool_2, tool_3<br>mcp.tool()(tool_1)<br>mcp.tool()(tool_2)<br>mcp.tool()(tool_3)</pre><p>mcp.tool()(fn) is exactly the same as decorating fn with @mcp.tool(). I like the explicit registration style when the tools live in their own module, because it keeps the graph logic separate from the server wiring. FastMCP then reads the type hints to build the JSON input schema and the docstring to tell the model what the tool is for and how to call it (<a href="https://mcpcat.io/guides/building-mcp-server-python-fastmcp/">mcpcat.io</a>). So your docstring is not just documentation anymore, it is the instruction the agent reads before it decides to use the tool. Worth writing carefully.</p><h3>Step 3: Run</h3><pre>mcp.run()                                  # stdio (default)<br>mcp.run(transport=..., host=..., port=...) # HTTP/SSE</pre><pre># Launch: python -m mcp_plugin</pre><p>By default FastMCP runs over stdio, which is what you want for a local client like Claude Desktop. When you need to serve it over the network for a remote agent, you switch the transport to HTTP or SSE and pass a host and port (<a href="https://www.danilchenko.dev/posts/fastmcp-mcp-server/">danilchenko.dev</a>). Same code, different reach.</p><h3>What a tool actually looks like</h3><p>Here is the kind of thing I mean when I talk about consuming a graph. This is a tool that finds the semantic path between two nodes of interest in a KG. A simple example: Find Path</p><pre>def _node_exists(graph, name: str) -&gt; str:<br>    &quot;&quot;&quot;Resolve a node name, falling back to a case-insensitive match.&quot;&quot;&quot;<br>    if name in graph:<br>        return name<br>    for n in graph.nodes():<br>        if n.lower() == name.lower():<br>            return n<br>    return &quot;&quot;<br><br>def find_path(source: str, target: str, all_routes: bool = False) -&gt; str:<br>    &quot;&quot;&quot;Find semantic path(s) between *source* and *target* in the KG.<br>    Parameters<br>    ----------<br>    source     : start node name<br>    target     : end node name<br>    all_routes : if True, return up to 5 distinct paths instead of just the shortest<br>    Returns the sequence of nodes and relations connecting the two nodes.<br>    &quot;&quot;&quot;<br>    graph = kg_cache.graph<br>    # Resolve names to real node ids (case-insensitive), with clear errors<br>    src = _node_exists(graph, source)<br>    tgt = _node_exists(graph, target)<br>    if not src:<br>        return json.dumps({&quot;error&quot;: f&quot;Source node &#39;{source}&#39; not found&quot;})<br>    if not tgt:<br>        return json.dumps({&quot;error&quot;: f&quot;Target node &#39;{target}&#39; not found&quot;})<br>    if all_routes:<br>        paths = all_paths(graph, src, tgt, max_depth=6, max_paths=5)<br>        return json.dumps({<br>            &quot;source&quot;: src,<br>            &quot;target&quot;: tgt,<br>            &quot;paths_found&quot;: len(paths),<br>            &quot;paths&quot;: paths,<br>        }, indent=2)<br>    path = shortest_path(graph, src, tgt)<br>    if path is None:<br>        return json.dumps({&quot;error&quot;: f&quot;No path found between &#39;{src}&#39; and &#39;{tgt}&#39;&quot;})<br>    return json.dumps({<br>        &quot;source&quot;: src,<br>        &quot;target&quot;: tgt,<br>        &quot;path_length&quot;: len(path) - 1,<br>        &quot;path&quot;: path,<br>    }, indent=2)</pre><h3>The local dev loop, and UIs in the chat</h3><p>This is the part that genuinely surprised me. People tend to compare MCP servers to FastAPI, and the analogy holds further than I expected. The way FastAPI gives you Swagger UI to poke at your endpoints, FastMCP gives you a local preview. Running fastmcp dev apps launches a browser based preview where you pick a tool, fill in the arguments, and see what it returns, without connecting to a real MCP host. It also ships an MCP message inspector so you can watch the protocol traffic underneath while you debug (<a href="https://jlowin.dev/blog/fastmcp-3-2">jlowin.dev</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*ILbv6D9XfzAzu6DtTPIjOw.png" /><figcaption>FAST MCP: Running on local Host</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p35A93SaMSuwpjSHqH7GPg.png" /><figcaption>Output of FAST MCP</figcaption></figure><h3>Why this matters for deep agents</h3><p>The reason I went down this road in the first place is consumption, and deep agents are where it pays off. A simple agent calls a tool in a loop and that works for small tasks. Deep agents are the ones built for the harder jobs, the multi step research, the analysis that needs planning, context management, and delegation (<a href="https://medium.com/data-science-collective/building-deep-agents-with-langchain-1-0s-middleware-architecture-7fdbb3e47123">medium.com</a>).</p><p>The clean part is that MCP tools plug straight into them. With LangChain’s deepagents library you connect to your MCP servers, pull the tools, and hand them to the agent in one parameter:</p><pre>from langchain_mcp_adapters.client import MultiServerMCPClient<br>from deepagents import create_deep_agent<br><br>mcp_client = MultiServerMCPClient({<br>    &quot;kg&quot;: {&quot;url&quot;: &quot;http://localhost:8000/sse&quot;, &quot;transport&quot;: &quot;sse&quot;},<br>})<br>mcp_tools = await mcp_client.get_tools()<br>agent = create_deep_agent(<br>    tools=mcp_tools,<br>    instructions=&quot;You can traverse the knowledge graph using the provided tools...&quot;,<br>)</pre><p>Deep Agents support MCP directly through that same tools= parameter, so any custom function, LangChain tool, or tool from any MCP server drops in the same way (<a href="http://docs.langchain.com/oss/python/deepagents/overview">docs.langchain.com</a>). That is the whole point. Your graph traversal logic lives in one FastMCP server, and any MCP compliant agent in any framework or language can consume it. There is a real trade here worth being honest about. In process LangChain tools add zero network overhead, while MCP tools live in a separate process and add somewhere around 10 to 50 milliseconds per call (<a href="https://dev.to/nikhil_ramank_152ca48266/-tool-calling-in-langchain-langgraph-and-mcp-three-layers-one-intelligent-system-4jf7">dev.to</a>). For graph consumption that latency is nothing next to what you gain in portability.</p><h3>Where I landed</h3><p>What I came away with is simple. FastMCP is a quick way to turn any set of functions into tools an agent can call, and that set does not have to be about knowledge graphs at all. Mine happened to be. The graph stays where it is, the traversal logic gets wrapped once, and from then on any deep agent can walk it through clean, well described tools without ever touching the underlying query language.</p><p>The building side of knowledge graphs will keep being domain specific and that is fine. But the consumption side, the part that decides whether all that connected structure ever gets used, is where I think more of us should be spending time.</p><p>FastMCP made that side feel approachable, and that is why I keep reaching for it.</p><h3>References</h3><ul><li>FastMCP, Welcome and overview, gofastmcp.com, <a href="https://gofastmcp.com/getting-started/welcome">https://gofastmcp.com/getting-started/welcome</a></li><li>FastMCP, PrefectHQ repository, github.com, <a href="https://github.com/PrefectHQ/fastmcp">https://github.com/PrefectHQ/fastmcp</a></li><li>FastMCP, Apps overview, gofastmcp.com, <a href="https://gofastmcp.com/apps/overview">https://gofastmcp.com/apps/overview</a></li><li>Prefab, FastMCP integration docs, prefab.prefect.io, <a href="https://prefab.prefect.io/docs/running/fastmcp">https://prefab.prefect.io/docs/running/fastmcp</a></li><li>Jeremiah Lowin, FastMCP 3.2 release notes, jlowin.dev, <a href="https://jlowin.dev/blog/fastmcp-3-2">https://jlowin.dev/blog/fastmcp-3-2</a></li><li>Model Context Protocol blog, MCP Apps announcement, blog.modelcontextprotocol.io, <a href="https://blog.modelcontextprotocol.io/posts/2026-01-26-mcp-apps/">https://blog.modelcontextprotocol.io/posts/2026-01-26-mcp-apps/</a></li><li>KDnuggets, FastMCP the Pythonic way to build MCP servers and clients, <a href="https://www.kdnuggets.com/fastmcp-the-pythonic-way-to-build-mcp-servers-and-clients">https://www.kdnuggets.com/fastmcp-the-pythonic-way-to-build-mcp-servers-and-clients</a></li><li>MCPcat, Build MCP servers in Python with FastMCP, <a href="https://mcpcat.io/guides/building-mcp-server-python-fastmcp/">https://mcpcat.io/guides/building-mcp-server-python-fastmcp/</a></li><li>danilchenko.dev, FastMCP in Python, build a real MCP server, <a href="https://www.danilchenko.dev/posts/fastmcp-mcp-server/">https://www.danilchenko.dev/posts/fastmcp-mcp-server/</a></li><li>LangChain, Deep Agents overview, docs.langchain.com, <a href="http://docs.langchain.com/oss/python/deepagents/overview">http://docs.langchain.com/oss/python/deepagents/overview</a></li><li>Debal B, Building production ready deep agents with LangChain 1.0, Medium, <a href="https://medium.com/data-science-collective/building-deep-agents-with-langchain-1-0s-middleware-architecture-7fdbb3e47123">https://medium.com/data-science-collective/building-deep-agents-with-langchain-1-0s-middleware-architecture-7fdbb3e47123</a></li><li>Tool calling in LangChain, LangGraph and MCP, dev.to, <a href="https://dev.to/nikhil_ramank_152ca48266/-tool-calling-in-langchain-langgraph-and-mcp-three-layers-one-intelligent-system-4jf7">https://dev.to/nikhil_ramank_152ca48266/-tool-calling-in-langchain-langgraph-and-mcp-three-layers-one-intelligent-system-4jf7</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BnoYOdBd6J0bJBiLbKzFnQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbb9e1f5f2c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP in Generative AI: Necessary Discipline or Redundant Detail?]]></title>
            <link>https://medium.com/@venkateshvishwanath99/mcp-in-generative-ai-necessary-discipline-or-redundant-detail-1742c3f33caa?source=rss-ce3412136ece------2</link>
            <guid isPermaLink="false">https://medium.com/p/1742c3f33caa</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[ai-governance]]></category>
            <category><![CDATA[model-context-protocol]]></category>
            <dc:creator><![CDATA[Venkatesh Manikantan]]></dc:creator>
            <pubDate>Sun, 18 May 2025 18:42:28 GMT</pubDate>
            <atom:updated>2025-05-18T18:42:28.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*Depsh47BcB351h-s" /><figcaption>source: <a href="https://www.descope.com/learn/post/mcp">https://www.descope.com/learn/post/mcp</a></figcaption></figure><p>As an AI professional, I can’t help but notice the rapid developments in new frameworks and designs emerging daily. To stay ahead in the fast-evolving Gen-AI software ecosystem, it’s crucial to grasp the underlying governance. In this blog, I’ll be diving into Model Context Protocol (MCP) and its role in shaping the future of Gen-AI workflows. Tools like Pydantic, Langchain, and LlamaIndex are key to generating structured outputs, driving consistency across everything from simple RAG pipelines to more complex, comprehensive systems. Understanding how MCP integrates with these tools helps ensure reliable and scalable AI solutions.</p><h3><strong>What is MCP ?</strong></h3><p><strong>MCP </strong>(Model Context Protocol) is an open protocol that standardizes how applications provide context to large language models (LLMs). Think of it like a <strong><em>USB-C</em></strong> port for AI: just as<em> USB-C simplifies connecting devices to different peripherals, MCP makes it easy for AI models to interact with various data sources and tools.</em></p><h3>Why do we need MCP ?</h3><p>MCP is essential because it provides a unified framework that simplifies how tools and applications interact with AI models. Without it, developers would need to create and maintain custom APIs for each integration, which is time-consuming and prone to errors. By offering a standard structure, MCP eliminates this complexity, allowing for smoother integrations with minimal overhead.</p><p>From a user experience perspective, MCP also helps generative applications request permission to access user systems in a secure and consistent way. This ensures that users can confidently control what data and tools are shared with AI models.</p><p>For developers, this standardization means quicker integration of existing software, whether it’s a database, simple file I/O, or even full applications like Microsoft PowerPoint. MCP streamlines how Gen-AI applications interact with these client &amp; server side artifacts.</p><h3><strong>Let us look into some of these MCPs</strong></h3><p><strong>Jupyter MCP Server</strong></p><p>To give a more concrete example let us look into Jupyter MCP server. The Jupyter MCP Server lets AI assistants connect with Jupyter notebooks using the Model Context Protocol (MCP). This makes it possible for tools like Claude or any other LLM to read from and modify notebooks in any JupyterLab environment, including those running on your local machine.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnPllCQxtaxQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnPllCQxtaxQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnPllCQxtaxQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c9ed41c1cd256a7455d17fa0b0fe7cd/href">https://medium.com/media/7c9ed41c1cd256a7455d17fa0b0fe7cd/href</a></iframe><p><strong>Github Link</strong>: <a href="https://github.com/jjsantos01/jupyter-notebook-mcp">https://github.com/jjsantos01/jupyter-notebook-mcp</a></p><p><strong>Excel MCP Server</strong></p><p>The <strong>Excel MCP Server</strong> enables seamless interaction with MS Excel data via the Model Context Protocol (MCP). It allows AI applications to read and write data<strong> </strong>in Excel files, including both text values and<strong> </strong>formulas, making it ideal for automating tasks and integrating Excel into your AI workflows.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fo9xstV5Yi2w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Do9xstV5Yi2w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fo9xstV5Yi2w%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1454e4c884cad57476e817bb8c9f3c57/href">https://medium.com/media/1454e4c884cad57476e817bb8c9f3c57/href</a></iframe><p>Github Link: <a href="https://github.com/negokaz/excel-mcp-server">https://github.com/negokaz/excel-mcp-server</a></p><h3><strong>MCP Servers Don’t Have to Be Complex</strong></h3><p>I know what you’re probably thinking: “This sounds like a lot of work! I’m just building a simple application, and I don’t have the time or resources to incorporate all these principles into my workflow.”</p><p>But here’s the good news:<strong> MCP servers don’t have to be complicated</strong>. You can easily build a simple MCP server to wrap basic tools and still give your project that extra layer of governance and stability.</p><p>Now, let’s dive into the basic source code to see how you can get started.</p><p><strong>Creating a MCP Server</strong></p><p>Install MCP before trying out: (pip install mcp)</p><ol><li><strong>Creating the MCP Server</strong></li></ol><pre># math_server.py<br>from mcp.server.fastmcp import FastMCP<br><br># Create an MCP server<br>mcp = FastMCP(&quot;MATH&quot;)</pre><p>2. <strong>Adding Tools: Add &amp; Multiply Function</strong></p><pre># math_server.py<br>@mcp.tool()<br>def add(a: int, b: int) -&gt; int:<br>    &quot;&quot;&quot;Add two numbers&quot;&quot;&quot;<br>    return a + b<br><br>@mcp.tool()<br>def multiply(a: int, b: int) -&gt; int:<br>    &quot;&quot;&quot;Multiply two numbers&quot;&quot;&quot;<br>    return a * b</pre><p>3. <strong>Running the Server</strong></p><pre># math_server.py<br># Entry point to run the server<br>if __name__ == &quot;__main__&quot;:<br>    mcp.run(transport=&quot;stdio&quot;)<br><br>############ To Note ##################################<br># stdio stands for Standard Input/Output. <br># This means that the MCP server will use the terminal <br># (or command-line interface) <br># for input and output communication.<br>######################################################</pre><pre># agent.py<br><br>from langchain_mcp_adapters.client import MultiServerMCPClient<br>from langgraph.prebuilt import create_react_agent<br><br>client = MultiServerMCPClient(<br>    {<br>        &quot;math&quot;: {<br>            &quot;command&quot;: &quot;python&quot;,<br>            # Replace with absolute path to your math_server.py file<br>            &quot;args&quot;: [&quot;/path/to/math_server.py&quot;],<br>            &quot;transport&quot;: &quot;stdio&quot;,<br>        }<br>    }<br>)<br>tools = await client.get_tools()<br>agent = create_react_agent(&quot;anthropic:claude-3-7-sonnet-latest&quot;,tools)<br><br>math_response = await agent.ainvoke(<br>    {&quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;what&#39;s (3 + 5) x 12?&quot;}]}<br>)</pre><h3>Conclusion</h3><p>In conclusion, <strong>Model Context Protocol (MCP)</strong> is proving to be a transformative force in the Gen-AI ecosystem, offering a much-needed standard for integrating AI models with various data sources and tools. By providing a unified framework, MCP eliminates the complexity of building custom APIs for every integration, allowing for more efficient and reliable AI workflows. Whether you’re working with <strong>Jupyter notebooks</strong>, <strong>Excel</strong>, or even developing simple applications, MCP ensures a streamlined process for connecting and interacting with external tools, while maintaining governance and stability.</p><p>For developers, MCP brings speed and consistency to their projects, enabling rapid integration of existing software without reinventing the wheel</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1742c3f33caa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>