python-sdk

Activity, over time

Daily observations from the public event archive.

Attention

Daily stars & forks

Loading attention chart

Star accumulation

Cumulative stars

Loading star accumulation chart

Pull requests

Daily opens & merges

Loading pull requests chart

Conversations

Daily issues & comments

Loading conversations chart

Community

Daily accounts & reviews

Loading community chart

Releases

Daily releases

Loading releases chart

Mentions

27posts · 30d
Nov 40 posts
  1. Your MCP server may be accepting tokens that were never issued to it, and patching won't fix that on its own. The [MCP Python SDK advisory](github.com/modelcontextprotocol/python-sdk/securi…) (CVSS 6.8) says the server's bearer auth never checked the token's audience claim (aud). If one authorization server issues tokens for several services, a valid token for service A also opens your MCP server. The [AWS API MCP Server](github.com/awslabs/mcp/security/advisories/GHSA-4…) disclosed the same kind of bug on Oct 27. It's the classic confused-deputy problem, now with an agent holding cloud credentials. Here's the detail that matters. Upgrading to mcp 1.30.0 or 2.2.0 changes nothing until you set validate_token_resource=True and return the audience from verify_token(). It only turns on by default in 3.0. Boards keep missing this gap. "We patched" is a statement about versions. Assurance is a statement about controls, backed by evidence. Directors should put three questions to the CISO this quarter. How many MCP servers and agent tools are running in production, and who owns that inventory? Is audience validation proven by a test, or just set in a config? Which agent actions need a human approval, and is that approval logged? That's why I build TrustModel in the open: eval, monitor, and govern for AI systems, plus an MCP server for trust evaluation and red-teaming. Does your org actually know its agent count, or is it a guess? The code is at karlmehta/trustmodel and the platform is at trustmodel.ai. Follow me here and on X at @karlmehta. #AISecurity #AIGovernance #MCP

    2 likes · 734 views
  2. Reddit · · r/mcp · u/Mr_Unknown_Hero

    MPC server with Python, confused about current packages which are newest and should be used? I have made now test MCP server on my machine and it works fine. Then I thought I will start to do MCP server over HTTP/SSE to test it next since that would be more useful for me on some cases. Anyway long story short, when I start creating from scratch this with Python, I am soooo confused about the actual packages and what is currently most recent way to do it. There is package "mcp[cli]", then there is package "mpc"- On modelcontextprotocol/python-sdk they use mpc[cli] but my test server does not work with it, I need to install mcp. Is MCP current modern package, or MCP[cli] instead? What I should use when I start from scratch?

    1 point · 8 comments
  3. If one authorization server issues tokens for several services, your MCP server may accept a token meant for another one. The MCP Python SDK fix is opt-in. Upgrading alone changes nothing: set validate_token_resource too. github.com/modelcontextprotocol/python-sdk/securi…

    6 likes · 196 views
  4. YouTube · · YouTube description · Skill MD

    MCP Server Tutorial (Python + Ollama): My Local AI Stopped Guessing MCP server tutorial in Python: build one tool with the official MCP Python SDK v2, test it, and give a free local AI (Ollama + qwen3:4b) live data. Code + prompts (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Without the tool, my local model guessed "approximately 12,158" GitHub stars. With one MCP tool it answered 183,721, live from the GitHub API. Everything is a real run on a Mac with no GPU: real terminal, real timings (sped up and labeled), model output unedited. Three things broke along the way, and I show each fix. What you'll learn: - What MCP (Model Context Protocol) is, in one picture - Set up the MCP Python SDK 2.3 with uv, and pull qwen3:4b in Ollama - Why old FastMCP tutorials crash on v2 (FastMCP is now MCPServer) - Build an MCP server in Python with one decorator, no JSON schema - Test an MCP server with a tiny Python client (and why structured_content came back None) - Connect MCP tools to Ollama tool calling with a small agent script - Why qwen2.5-coder:3b printed the tool call instead of making one - Before vs after: guess vs live data - Use the same MCP server in Claude Code (claude mcp add) Chapters: 00:00 A free local AI guessed. One MCP tool fixed it 00:36 What is MCP? (the USB-C analogy) 01:03 How an MCP server, client and model fit together 01:25 Step 1: set up uv, the MCP Python SDK and Ollama 02:00 What went wrong #1: FastMCP import crashes on v2 02:35 Step 2: write the MCP server in Python 03:08 Step 3: test it (what went wrong #2: None) 03:42 Step 4: the agent, MCP tools to Ollama tools 04:13 What went wrong #3: the model printed the tool call 04:40 Step 5: qwen3:4b makes the tool call 05:17 Before and after: guess vs live data 05:45 Bonus: the same server in Claude Code 06:10 My takeaway Resources mentioned: MCP intro: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk What's new in v2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 on Ollama: ollama.com uv: docs.astral.sh Episode 1 (Ollama builds a game): youtube.com Licenses: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python library (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License). Not sponsored. AI voice (my cloned voice) and generated visuals; all terminal runs and pages are real captures from 18 Oct 2026. The hands-on, show-every-step style is inspired by FreeAIVault: youtube.com Have you built an MCP server yet? Tell me in the comments which tool you'd give your local AI first. Subscribe to skill.md for hands-on AI tutorials, GitHub repo breakdowns and AI news. #mcp #ollama #python #localai #aiagents #claudecode [ar] دليل خادم MCP (بايثون + Ollama): ذكائي الاصطناعي المحلي توقف عن التخمين برنامج تعليمي لخادم MCP باستخدام بايثون: قم ببناء أداة واحدة باستخدام حزمة تطوير البرامج الرسمية MCP Python SDK v2، واختبرها، وقدّم بيانات مباشرة لنموذج ذكاء اصطناعي محلي مجاني (Ollama + qwen3:4b). الكود + التعليمات (الحلقة 2): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… بدون الأداة، قدّر نموذجي المحلي عدد نجوم GitHub بحوالي 12,158 نجمة. باستخدام أداة MCP، أجاب بـ 183,721 نجمة، مباشرةً من واجهة برمجة تطبيقات GitHub. تم تشغيل كل شيء على جهاز Mac بدون وحدة معالجة رسومية: طرفية حقيقية، أوقات حقيقية (مُسرّعة ومُصنّفة)، مخرجات النموذج دون تعديل. واجهتُ ثلاثة مشاكل أثناء العمل، وسأشرح كل حل. ما ستتعلمه: - ما هو بروتوكول سياق النموذج (MCP) في صورة واحدة - إعداد حزمة تطوير البرمجيات (SDK) الخاصة بـ MCP Python 2.3 باستخدام uv، وسحب qwen3:4b في Ollama - لماذا تتعطل دروس FastMCP القديمة على الإصدار 2 (FastMCP أصبح الآن MCPServer) - بناء خادم MCP بلغة Python باستخدام مُزخرف واحد، بدون مخطط JSON - اختبار خادم MCP باستخدام عميل Python صغير (ولماذا كانت قيمة structured_content تساوي None) - ربط أدوات MCP باستدعاء أداة Ollama باستخدام نص برمجي صغير - لماذا طبع qwen2.5-coder:3b استدعاء الأداة بدلاً من إجرائه؟ - قبل وبعد: التخمين مقابل البيانات الحية - استخدام خادم MCP نفسه في Claude Code (claude mcp add) الفصول: 00:00 خمّن ذكاء اصطناعي محلي مجاني. أداة MCP واحدة أصلحته 00:36 ما هو MCP؟ (تشبيه USB-C) 01:03 كيفية عمل خادم MCP والعميل والنموذج معًا 01:25 الخطوة 1: إعداد uv، وMCP Python SDK، وOllama 02:00 الخطأ الأول: تعطل استيراد FastMCP في الإصدار 2 02:35 الخطوة 2: كتابة خادم MCP بلغة Python 03:08 الخطوة 3: اختباره (الخطأ الثاني: لا يوجد) 03:42 الخطوة 4: ربط الوكيل وأدوات MCP بأدوات Ollama 04:13 الخطأ الثالث: قام النموذج بطباعة استدعاء الأداة 04:40 الخطوة 5: يقوم qwen3:4b باستدعاء الأداة 05:17 قبل وبعد: التخمين مقابل البيانات الفعلية 05:45 إضافة: نفس الخادم في كود Claude 06:10 استنتاجي الموارد المذكورة: مقدمة عن MCP: modelcontextprotocol.io MCP مجموعة أدوات تطوير البرمجيات (SDK) لـ Python: modelcontextprotocol/python-sdk ما الجديد في الإصدار 2: py.sdk.modelcontextprotocol.io أولاما: ollama.com qwen3 على أولاما: ollama.com uv: docs.astral.sh الحلقة 1 (أولاما تبني لعبة): youtube.com التراخيص: mcp 2.3.0 (MIT)، أولاما (MIT)، مكتبة أولاما لـ Python (MIT)، qwen3:4b (Apache 2.0)، qwen2.5-coder:3b (رخصة Qwen البحثية). غير مدعوم. صوت الذكاء الاصطناعي (صوتي المُستنسخ) والرسومات المُولّدة؛ جميع عمليات تشغيل الطرفية والصفحات هي لقطات حقيقية من ١٨ أكتوبر ٢٠٢٦. أسلوب العرض العملي، الذي يُظهر كل خطوة، مستوحى من FreeAIVault: youtube.com هل أنشأتَ خادم MCP بعد؟ أخبرني في التعليقات ما هي الأداة التي ستُزوّد ​​بها نظام الذكاء الاصطناعي المحلي لديك أولًا. اشترك في skill.md للحصول على دروس عملية في الذكاء الاصطناعي، وتحليلات لمستودعات GitHub، وآخر أخبار الذكاء الاصطناعي. #mcp #ollama #python #localai #aiagents #claudecode [bn] এমসিপি সার্ভার টিউটোরিয়াল (পাইথন + ওলামা): আমার স্থানীয় এআই অনুমান করা বন্ধ করে দিয়েছে পাইথনে এমসিপি সার্ভার টিউটোরিয়াল: অফিসিয়াল এমসিপি পাইথন এসডিকে ভি২ (v2) ব্যবহার করে একটি টুল তৈরি করুন, এটি পরীক্ষা করুন এবং একটি ফ্রি লোকাল এআই (Ollama + qwen3:4b)-কে লাইভ ডেটা দিন। কোড + প্রম্পট (পর্ব ০0২): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… টুলটি ছাড়া, আমার লোকাল মডেল "আনুমানিক ১২,১৫৮" গিটহাব স্টার অনুমান করেছিল। এমসিপি-র একটি টুলের সাহায্যে এটি গিটহাব এপিআই থেকে সরাসরি ১৮৩,৭২১ স্টার উত্তর দিয়েছে। সবকিছুই জিপিইউ ছাড়া একটি ম্যাক-এ চালানো আসল পরীক্ষা: আসল টার্মিনাল, আসল টাইমিং (গতি বাড়ানো এবং লেবেল করা), মডেলের আউটপুট অপরিবর্তিত। এই প্রক্রিয়ার মধ্যে তিনটি জিনিস ভেঙে গিয়েছিল, এবং আমি প্রতিটি সমাধান দেখিয়েছি। আপনি যা শিখবেন: MCP (মডেল কনটেক্সট প্রোটোকল) কী, তা এক কথায় - uv ব্যবহার করে MCP পাইথন SDK 2.3 সেট আপ করুন, এবং Ollama-তে qwen3:4b পুল করুন - কেন পুরোনো FastMCP টিউটোরিয়ালগুলো v2-তে ক্র্যাশ করে (FastMCP এখন MCPServer) - কোনো JSON স্কিমা ছাড়াই, একটি মাত্র ডেকোরেটর ব্যবহার করে পাইথনে একটি MCP সার্ভার তৈরি করুন - একটি ছোট পাইথন ক্লায়েন্ট দিয়ে MCP সার্ভার পরীক্ষা করুন (এবং কেন structured_content-এর রিটার্ন ভ্যালু None ছিল) - একটি ছোট এজেন্ট স্ক্রিপ্ট ব্যবহার করে Ollama টুল কলিং-এর সাথে MCP টুলগুলোকে সংযুক্ত করুন - কেন qwen2.5-coder:3b টুল কল করার পরিবর্তে সেটি প্রিন্ট করেছিল - আগে বনাম পরে: অনুমান বনাম লাইভ ডেটা - Claude Code-এ একই MCP সার্ভার ব্যবহার করুন (claude mcp add) অধ্যায়সমূহ: ০০:০০ একটি ফ্রি লোকাল AI অনুমান করেছিল। একটি MCP টুল এটি ঠিক করে দিয়েছে ০০:৩৬ MCP কী? (ইউএসবি-সি উপমা) ০১:০৩ একটি এমসিপি সার্ভার, ক্লায়েন্ট এবং মডেল কীভাবে একসাথে কাজ করে ০১:২৫ ধাপ ১: ইউভি, এমসিপি পাইথন এসডিকে এবং ওলামা সেট আপ করুন ০২:০০ কী ভুল হয়েছে #১: v2-তে ফাস্টএমসিপি ইম্পোর্ট ক্র্যাশ করে ০২:৩৫ ধাপ ২: পাইথনে এমসিপি সার্ভারটি লিখুন ০৩:০৮ ধাপ ৩: এটি পরীক্ষা করুন (কী ভুল হয়েছে #২: কিছুই না) ০৩:৪২ ধাপ ৪: এজেন্ট, এমসিপি টুলস থেকে ওলামা টুলস ০৪:১৩ কী ভুল হয়েছে #৩: মডেলটি টুল কলটি প্রিন্ট করেছে ০৪:৪০ ধাপ ৫: qwen3:4b টুল কলটি করে ০৫:১৭ আগে এবং পরে: অনুমান বনাম লাইভ ডেটা ০৫:৪৫ বোনাস: ক্লড কোডে একই সার্ভার ০৬:১০ আমার উপলব্ধি উল্লেখিত রিসোর্সসমূহ: এমসিপি পরিচিতি: modelcontextprotocol.io এমসিপি পাইথন এসডিকে: modelcontextprotocol/python-sdk v2-তে নতুন কী আছে: py.sdk.modelcontextprotocol.io ওলামা: ollama.com ওলামাতে qwen3: ollama.com ইউভি: docs.astral.sh পর্ব ১ (ওলামা একটি গেম তৈরি করে): youtube.com লাইসেন্স: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python library (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License)। স্পনসরকৃত নয়। এআই ভয়েস (আমার ক্লোন করা ভয়েস) এবং জেনারেটেড ভিজ্যুয়াল; সমস্ত টার্মিনাল রান এবং পেজগুলো ১৮ অক্টোবর ২০২৬ তারিখের আসল ক্যাপচার। এই হাতে-কলমে, প্রতিটি ধাপ দেখানোর পদ্ধতিটি FreeAIVault থেকে অনুপ্রাণিত: youtube.com আপনি কি এখনও কোনো MCP সার্ভার তৈরি করেছেন? কমেন্টে জানান, আপনার লোকাল AI-কে প্রথমে কোন টুলটি দেবেন। হাতে-কলমে AI টিউটোরিয়াল, GitHub রিপো বিশ্লেষণ এবং AI খবরের জন্য skill.md-এ সাবস্ক্রাইব করুন। #mcp #ollama #python #localai #aiagents #claudecode [de-DE] MCP-Server-Tutorial (Python + Ollama): Meine lokale KI hört auf zu raten MCP-Server-Tutorial in Python: Entwickeln Sie ein Tool mit dem offiziellen MCP Python SDK v2, testen Sie es und stellen Sie einer lokalen KI (Ollama + qwen3:4b) Live-Daten zur Verfügung. Code + Eingabeaufforderungen (Folge 002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Ohne das Tool schätzte mein lokales Modell „ungefähr 12.158“ GitHub-Sterne. Mit dem MCP-Tool antwortete es live über die GitHub-API mit 183.721 Sternen. Alles wurde auf einem Mac ohne GPU real ausgeführt: echtes Terminal, echte Zeitmessungen (beschleunigt und beschriftet), unbearbeitete Modellausgabe. Drei Fehler traten auf, deren Behebung ich zeige. Was Sie lernen werden: - Was MCP (Model Context Protocol) ist – kurz erklärt - Das MCP Python SDK 2.3 mit uv einrichten und qwen3:4b in Ollama einbinden - Warum ältere FastMCP-Tutorials unter v2 abstürzen (FastMCP heißt jetzt MCPServer) - Einen MCP-Server in Python mit einem Decorator und ohne JSON-Schema erstellen - Einen MCP-Server mit einem kleinen Python-Client testen (und warum structured_content None zurückgibt) - MCP-Tools mit einem kleinen Agenten-Skript mit Ollama-Toolaufrufen verbinden - Warum qwen2.5-coder:3b den Toolaufruf ausgibt, anstatt ihn auszuführen Vorher vs. Nachher: ​​Vermutung vs. Live-Daten Denselben MCP-Server in Claude Code verwenden (claude mcp add) Kapitel: 00:00 Eine kostenlose lokale KI hat geraten. Ein MCP-Tool hat es korrigiert 00:36 Was ist MCP? (Die USB-C-Analogie) 01:03 Wie ein MCP-Server, Client und Modell zusammenwirken 01:25 Schritt 1: UV, das MCP Python SDK und Ollama einrichten 02:00 Fehler #1: FastMCP-Import stürzt in Version 2 ab 02:35 Schritt 2: MCP-Server in Python schreiben 03:08 Schritt 3: Testen (Fehler #2: Keiner) 03:42 Schritt 4: Agent, MCP-Tools zu Ollama-Tools 04:13 Fehler #3: Das Modell gab den Tool-Aufruf aus 04:40 Schritt 5: qwen3:4b führt den Tool-Aufruf aus 05:17 Vorher und nachher: ​​Schätzung vs. Live-Daten 05:45 Bonus: Derselbe Server in Claude-Code 06:10 Fazit Erwähnte Ressourcen: MCP-Einführung: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk Neuerungen in Version 2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 auf Ollama: ollama.com uv: docs.astral.sh Folge 1 (Ollama entwickelt ein Spiel): youtube.com Lizenzen: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python-Bibliothek (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License). Nicht gesponsert. KI-Stimme (meine geklonte Stimme) und generierte Grafiken. Alle Terminalausgaben und Seiten sind Originalaufnahmen vom 18. Oktober 2026. Der praxisorientierte Stil, bei dem jeder Schritt gezeigt wird, ist von FreeAIVault inspiriert: youtube.com Hast du schon einen MCP-Server eingerichtet? Schreib mir in den Kommentaren, welches Tool du deiner lokalen KI als erstes geben würdest. Abonniere skill.md für praxisnahe KI-Tutorials, GitHub-Repo-Analysen und KI-News. #mcp #ollama #python #localai #aiagents #claudecode [es-US] Tutorial del servidor MCP (Python + Ollama): Mi IA local dejó de adivinar Tutorial del servidor MCP en Python: crea una herramienta con el SDK oficial de MCP para Python v2, pruébala y proporciona datos en tiempo real a una IA local gratuita (Ollama + qwen3:4b). Código y sugerencias (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Sin la herramienta, mi modelo local estimó "aproximadamente 12 158" estrellas de GitHub. Con una herramienta de MCP, respondió 183 721, directamente desde la API de GitHub. Todo se ejecutó en una Mac sin GPU: terminal real, tiempos reales (acelerados y etiquetados), salida del modelo sin editar. Se produjeron tres fallos durante el proceso, y muestro cómo solucionarlos. Lo que aprenderás: - Qué es MCP (Protocolo de Contexto de Modelo), en una imagen - Configurar el SDK de Python 2.3 de MCP con uv y extraer qwen3:4b en Ollama - Por qué fallan los tutoriales antiguos de FastMCP en la versión 2 (FastMCP ahora es MCPServer) - Crear un servidor MCP en Python con un decorador, sin esquema JSON - Probar un servidor MCP con un cliente Python pequeño (y por qué structured_content devolvió None) - Conectar herramientas MCP con la llamada a herramientas de Ollama mediante un pequeño script de agente - Por qué qwen2.5-coder:3b imprimió la llamada a la herramienta en lugar de realizarla - Antes vs. después: adivinación vs. datos reales - Usar el mismo servidor MCP en Claude Code (claude mcp add) Capítulos: 00:00 Una IA local gratuita adivinó. Una herramienta MCP lo corrigió 00:36 ¿Qué es MCP? (La analogía del USB-C) 01:03 Cómo se integran un servidor, un cliente y un modelo MCP 01:25 Paso 1: configurar uv, el SDK de Python para MCP y Ollama 02:00 Problema n.° 1: la importación de FastMCP falla en la versión 2 02:35 Paso 2: escribir el servidor MCP en Python 03:08 Paso 3: probarlo (problema n.° 2: ninguno) 03:42 Paso 4: el agente, las herramientas MCP y las herramientas Ollama 04:13 Problema n.° 3: el modelo imprimió la llamada a la herramienta 04:40 Paso 5: qwen3:4b realiza la llamada a la herramienta 05:17 Antes y después: estimación vs. datos reales 05:45 Extra: el mismo servidor en Claude Code 06:10 Conclusiones Recursos mencionados: Introducción a MCP: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk Novedades de la versión 2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 en Ollama: ollama.com uv: docs.astral.sh Episodio 1 (Ollama crea un juego): youtube.com Licencias: mcp 2.3.0 (MIT), Ollama (MIT), biblioteca Python de Ollama (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Licencia de Investigación de Qwen). Sin patrocinio. Voz de IA (mi voz clonada) y efectos visuales generados. Todas las ejecuciones de terminal y páginas son capturas reales del 18 de octubre de 2026. El estilo práctico y paso a paso está inspirado en FreeAIVault: youtube.com ¿Ya has creado un servidor MCP? Cuéntame en los comentarios qué herramienta le darías primero a tu IA local. Suscríbete a skill.md para tutoriales prácticos de IA, análisis de repositorios de GitHub y noticias sobre IA. #mcp #ollama #python #localai #aiagents #claudecode [fr-FR] Tutoriel serveur MCP (Python + Ollama) : Mon IA locale a cessé de deviner Tutoriel serveur MCP en Python : créez un outil avec le SDK Python officiel MCP v2, testez-le et fournissez gratuitement des données réelles d'IA locale (Ollama + qwen3:4b). Code et invites (ep002) : github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Sans l'outil, mon modèle local estimait le nombre d'étoiles GitHub à « environ 12 158 ». Avec l'outil MCP, il a obtenu 183 721 étoiles, directement depuis l'API GitHub. Tout a été testé sur un Mac sans GPU : terminal réel, chronométrage réel (accéléré et annoté), sortie du modèle non modifiée. Trois problèmes sont survenus en cours de route ; je détaille chaque solution. Ce que vous apprendrez : - Présentation du protocole MCP (Model Context Protocol) - Configuration du SDK Python MCP 2.3 avec uv et intégration de qwen3:4b dans Ollama - Pourquoi les anciens tutoriels FastMCP plantent sur la v2 (FastMCP est désormais MCPServer) - Création d'un serveur MCP en Python avec un seul décorateur, sans schéma JSON - Test d'un serveur MCP avec un client Python minimal (et pourquoi structured_content renvoie None) - Connexion des outils MCP à l'appel d'outils Ollama via un petit script agent - Pourquoi qwen2.5-coder:3b a affiché l'appel d'outil au lieu de l'exécuter - Comparaison entre les résultats de la simulation et les données réelles - Utilisation du même serveur MCP dans Claude Code (claude mcp add) Chapitres : 00:00 Une IA locale gratuite a fait une supposition. Un outil MCP a résolu le problème. 00:36 Qu'est-ce que MCP ? (Analogie avec l'USB-C) 01:03 Comment un serveur MCP, un client et un modèle s'articulent 01:25 Étape 1 : Configuration des UV, du SDK Python MCP et d'Ollama 02:00 Problème n° 1 : Plantage de l'importation FastMCP sur la v2 02:35 Étape 2 : Écriture du serveur MCP en Python 03:08 Étape 3 : Test (Problème n° 2 : Aucun) 03:42 Étape 4 : L'agent, conversion des outils MCP en outils Ollama 04:13 Problème n° 3 : Le modèle a affiché l'appel d'outil 04:40 Étape 5 : qwen3:4b effectue l'appel d'outil 05:17 Avant et après : estimations vs données réelles 05:45 Bonus : Le même serveur dans Claude Code 06:10 Conclusion Ressources mentionnées : Introduction à MCP : modelcontextprotocol.io MCP Python Kit de développement logiciel (SDK) : modelcontextprotocol/python-sdk Nouveautés de la v2 : py.sdk.modelcontextprotocol.io Ollama : ollama.com qwen3 sur Ollama : ollama.com uv : docs.astral.sh Épisode 1 (Ollama crée un jeu) : youtube.com Licences : mcp 2.3.0 (MIT), Ollama (MIT), bibliothèque Python Ollama (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Licence de recherche Qwen). Non sponsorisé. Voix IA (ma voix clonée) et visuels générés. Toutes les captures d'écran du terminal et des pages web datent du 18 octobre 2026. Ce tutoriel interactif, qui détaille chaque étape, s'inspire de FreeAIVault : youtube.com Avez-vous déjà créé un serveur MCP ? Dites-moi en commentaire quel outil vous utiliseriez en premier pour votre IA locale. Abonnez-vous à skill.md pour des tutoriels pratiques sur l'IA, des analyses de dépôts GitHub et des actualités sur l'IA. #mcp #ollama #python #localai #aiagents #claudecode [hi] MCP सर्वर ट्यूटोरियल (Python + Ollama): मेरे लोकल AI ने अंदाज़ा लगाना बंद किया पायथन में MCP सर्वर ट्यूटोरियल: आधिकारिक MCP पायथन SDK v2 का उपयोग करके एक टूल बनाएं, उसका परीक्षण करें और एक निःशुल्क स्थानीय AI (Ollama + qwen3:4b) को लाइव डेटा प्रदान करें। कोड + निर्देश (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… टूल के बिना, मेरे स्थानीय मॉडल ने GitHub स्टार्स का अनुमान "लगभग 12,158" लगाया। MCP टूल के साथ इसने GitHub API से लाइव डेटा के आधार पर 183,721 स्टार्स का उत्तर दिया। यह सब बिना GPU वाले Mac पर वास्तविक परीक्षण है: वास्तविक टर्मिनल, वास्तविक समय (तेज़ गति और लेबल के साथ), मॉडल आउटपुट बिना किसी संपादन के। इस प्रक्रिया में तीन समस्याएं आईं, और मैंने प्रत्येक समाधान दिखाया है। आप क्या सीखेंगे: - MCP (मॉडल कॉन्टेक्स्ट प्रोटोकॉल) क्या है, एक उदाहरण में - uv के साथ MCP Python SDK 2.3 सेटअप करना और Ollama में qwen3:4b फ़ाइल को पुल करना - FastMCP के पुराने ट्यूटोरियल v2 पर क्रैश क्यों होते हैं (FastMCP अब MCPServer है) - बिना JSON स्कीमा के, केवल एक डेकोरेटर के साथ Python में एक MCP सर्वर बनाना - एक छोटे Python क्लाइंट के साथ MCP सर्वर का परीक्षण करना (और structured_content का मान None क्यों आया) - एक छोटे एजेंट स्क्रिप्ट के साथ MCP टूल्स को Ollama टूल कॉलिंग से कनेक्ट करना - qwen2.5-coder:3b ने टूल कॉल करने के बजाय उसे प्रिंट क्यों किया - पहले और बाद में: अनुमान बनाम लाइव डेटा - Claude Code में उसी MCP सर्वर का उपयोग करना (claude mcp add) अध्याय: 00:00 एक मुफ़्त स्थानीय AI ने अनुमान लगाया। एक MCP टूल ने इसे ठीक किया 00:36 MCP क्या है? (USB-C सादृश्य) 01:03 MCP सर्वर, क्लाइंट और मॉडल एक साथ कैसे काम करते हैं 01:25 चरण 1: uv, MCP Python SDK और Ollama को सेट अप करें 02:00 पहली समस्या: FastMCP v2 पर इंपोर्ट क्रैश हो गया 02:35 चरण 2: MCP सर्वर को Python में लिखें 03:08 चरण 3: इसका परीक्षण करें (दूसरी समस्या: कुछ नहीं) 03:42 चरण 4: एजेंट, MCP टूल्स को Ollama टूल्स में एकीकृत करें 04:13 तीसरी समस्या: मॉडल ने टूल कॉल प्रिंट किया 04:40 चरण 5: qwen3:4b टूल कॉल करता है 05:17 पहले और बाद में: अनुमानित बनाम वास्तविक डेटा 05:45 बोनस: क्लाउड कोड में वही सर्वर 06:10 मेरा निष्कर्ष उल्लेखित संसाधन: MCP परिचय: modelcontextprotocol.io MCP पायथन SDK: modelcontextprotocol/python-sdk संस्करण 2 में नया क्या है: py.sdk.modelcontextprotocol.io ओलामा: ollama.com ओलामा पर qwen3: ollama.com uv: docs.astral.sh एपिसोड 1 (ओलामा द्वारा गेम निर्माण): youtube.com लाइसेंस: mcp 2.3.0 (MIT), ओलामा (MIT), ओलामा पायथन लाइब्रेरी (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen रिसर्च लाइसेंस)। प्रायोजित नहीं। कृत्रिम आवाज (मेरी क्लोन की गई आवाज) और जेनरेट किए गए दृश्य; सभी टर्मिनल रन और पेज 18 अक्टूबर 2026 के वास्तविक स्क्रीनशॉट हैं। यह प्रैक्टिकल और चरण-दर-चरण प्रस्तुति FreeAIVault से प्रेरित है: youtube.com क्या आपने अभी तक MCP सर्वर बनाया है? मुझे कमेंट्स में बताएं कि आप अपने लोकल AI को सबसे पहले कौन सा टूल देंगे। AI ट्यूटोरियल, GitHub रेपो विश्लेषण और AI समाचारों के लिए skill.md को सब्सक्राइब करें। #mcp #ollama #python #localai #aiagents #claudecode [id] Tutorial Server MCP (Python + Ollama): AI Lokal Saya Berhenti Menebak-nebak Tutorial server MCP dalam Python: membangun satu alat dengan SDK Python MCP v2 resmi, mengujinya, dan memberikan data langsung gratis kepada AI lokal (Ollama + qwen3:4b). Kode + petunjuk (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Tanpa alat tersebut, model lokal saya menebak "sekitar 12.158" bintang GitHub. Dengan satu alat MCP, ia menjawab 183.721, langsung dari API GitHub. Semuanya adalah hasil nyata yang dijalankan di Mac tanpa GPU: terminal nyata, waktu nyata (dipercepat dan diberi label), output model tanpa diedit. Tiga hal rusak di sepanjang jalan, dan saya menunjukkan setiap perbaikannya. Apa yang akan Anda pelajari: - Apa itu MCP (Model Context Protocol), dalam satu gambar - Menyiapkan MCP Python SDK 2.3 dengan uv, dan menarik qwen3:4b di Ollama - Mengapa tutorial FastMCP lama mengalami crash pada v2 (FastMCP sekarang menjadi MCPServer) - Membangun server MCP di Python dengan satu decorator, tanpa skema JSON - Menguji server MCP dengan klien Python kecil (dan mengapa structured_content mengembalikan None) - Menghubungkan alat MCP ke alat Ollama yang memanggil dengan skrip agen kecil - Mengapa qwen2.5-coder:3b mencetak panggilan alat alih-alih membuatnya - Sebelum vs sesudah: tebakan vs data langsung - Menggunakan server MCP yang sama di Claude Code (claude mcp add) Bab: 00:00 AI lokal gratis menebak. Satu alat MCP memperbaikinya 00:36 Apa itu MCP? (analogi USB-C) 01:03 Bagaimana server, klien, dan model MCP saling terkait 01:25 Langkah 1: menyiapkan uv, MCP Python SDK, dan Ollama 02:00 Apa yang salah #1: Impor FastMCP mengalami crash pada v2 02:35 Langkah 2: menulis server MCP dalam Python 03:08 Langkah 3: mengujinya (apa yang salah #2: Tidak ada) 03:42 Langkah 4: agen, alat MCP ke alat Ollama 04:13 Apa yang salah #3: model mencetak panggilan alat 04:40 Langkah 5: qwen3:4b melakukan panggilan alat 05:17 Sebelum dan sesudah: tebakan vs data langsung 05:45 Bonus: server yang sama di Claude Code 06:10 Kesimpulan saya Sumber daya yang disebutkan: Pengantar MCP: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk Apa yang baru di v2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 di Ollama: ollama.com uv: docs.astral.sh Episode 1 (Ollama membuat game): youtube.com Lisensi: mcp 2.3.0 (MIT), Ollama (MIT), pustaka Python ollama (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Lisensi Penelitian Qwen). Tidak disponsori. Suara AI (suara kloningan saya) dan visual yang dihasilkan; Semua eksekusi terminal dan halaman adalah tangkapan layar asli dari tanggal 18 Oktober 2026. Gaya praktis dan demonstrasi langkah demi langkah ini terinspirasi oleh FreeAIVault: youtube.com Apakah Anda sudah membangun server MCP? Beri tahu saya di kolom komentar alat mana yang akan Anda berikan kepada AI lokal Anda terlebih dahulu. Berlangganan ke skill.md untuk tutorial AI praktis, uraian repositori GitHub, dan berita AI. #mcp #ollama #python #localai #aiagents #claudecode [it] Tutorial Server MCP (Python + Ollama): La mia AI locale ha smesso di tirare a indovinare Tutorial sul server MCP in Python: crea uno strumento con l'SDK Python ufficiale MCP v2, testalo e fornisci gratuitamente dati live a un'IA locale (Ollama + qwen3:4b). Codice + prompt (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Senza lo strumento, il mio modello locale ha stimato "circa 12.158" stelle su GitHub. Con uno strumento MCP ha risposto 183.721, in tempo reale dall'API di GitHub. Tutto è stato eseguito su un Mac senza GPU: terminale reale, tempi reali (accelerati ed etichettati), output del modello non modificato. Tre cose si sono guastate durante l'esecuzione e mostro come risolverle. Cosa imparerai: - Cos'è MCP (Model Context Protocol), spiegato in un'immagine - Configurare l'SDK Python 2.3 di MCP con uv e scaricare qwen3:4b in Ollama - Perché i vecchi tutorial di FastMCP si bloccano sulla versione 2 (FastMCP ora si chiama MCPServer) - Creare un server MCP in Python con un solo decoratore, senza schema JSON - Testare un server MCP con un piccolo client Python (e perché structured_content ha restituito None) - Collegare gli strumenti MCP alla chiamata degli strumenti Ollama con un piccolo script agente - Perché qwen2.5-coder:3b ha stampato la chiamata allo strumento invece di effettuarla - Prima vs dopo: supposizioni vs dati reali - Utilizzare lo stesso server MCP in Claude Code (claude mcp add) Capitoli: 00:00 Un'IA locale gratuita ha fatto una supposizione. Uno strumento MCP ha risolto il problema 00:36 Cos'è MCP? (l'analogia USB-C) 01:03 Come si integrano un server, un client e un modello MCP 01:25 Fase 1: configurare uv, l'SDK Python di MCP e Ollama 02:00 Cosa è andato storto #1: l'importazione di FastMCP si blocca sulla v2 02:35 Fase 2: scrivere il server MCP in Python 03:08 Fase 3: testarlo (cosa è andato storto #2: niente) 03:42 Fase 4: l'agente, gli strumenti MCP con gli strumenti Ollama 04:13 Cosa è andato storto #3: il modello ha stampato la chiamata allo strumento 04:40 Fase 5: qwen3:4b effettua la chiamata allo strumento 05:17 Prima e dopo: supposizioni vs dati reali 05:45 Bonus: lo stesso server in Claude Code 06:10 Le mie conclusioni Risorse menzionate: Introduzione a MCP: modelcontextprotocol.io MCP SDK Python: modelcontextprotocol/python-sdk Novità della versione 2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 su Ollama: ollama.com uv: docs.astral.sh Episodio 1 (Ollama crea un gioco): youtube.com Licenze: mcp 2.3.0 (MIT), Ollama (MIT), libreria Python Ollama (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License). Non sponsorizzato. Voce AI (la mia voce clonata) e grafica generata; Tutte le esecuzioni del terminale e le pagine sono screenshot reali del 18 ottobre 2026. Lo stile pratico, che mostra ogni passaggio, è ispirato a FreeAIVault: youtube.com Hai già creato un server MCP? Scrivimi nei commenti quale strumento daresti per primo alla tua IA locale. Iscriviti a skill.md per tutorial pratici sull'IA, analisi di repository GitHub e notizie sull'IA. #mcp #ollama #python #localai #aiagents #claudecode [iw] מדריך לשרת MCP (פייתון + Ollama): ה-AI המקומי שלי הפסיק לנחש מדריך לשרת MCP בפייתון: בנה כלי אחד עם ערכת פיתוח התוכנה הרשמית של MCP Python גרסה 2, בדוק אותו, וספק בינה מלאכותית מקומית חינמית (Ollama + qwen3:4b) עם נתונים בזמן אמת. קוד + הנחיות (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… ללא הכלי, המודל המקומי שלי ניחש "כ-12,158" כוכבים ב-GitHub. עם כלי MCP אחד הוא ענה על 183,721, בזמן אמת מ-API של GitHub. הכל רץ אמיתי על מק ללא GPU: טרמינל אמיתי, תזמונים אמיתיים (מואצים ומתויגים), פלט מודל לא ערוך. שלושה דברים התקלקלו ​​בדרך, ואני מראה כל תיקון. מה תלמדו: - מהו MCP (Model Context Protocol), בתמונה אחת - הגדר את MCP Python SDK 2.3 עם uv, ומשוך את qwen3:4b ב-Ollama - מדוע מדריכי FastMCP ישנים קורסים בגרסה 2 (FastMCP הוא כעת MCPServer) - בניית שרת MCP ב-Python עם מעצב אחד, ללא סכימת JSON - בדיקת שרת MCP עם לקוח Python זעיר (ומדוע structured_content חזר ללא) - חיבור כלי MCP לקריאה לכלי Ollama עם סקריפט סוכן קטן - מדוע qwen2.5-coder:3b הדפיס את הקריאה לכלי במקום לבצע אחת - לפני לעומת אחרי: ניחוש לעומת נתונים חיים - שימוש באותו שרת MCP ב-Claude Code (claude mcp add) פרקים: 00:00 בינה מלאכותית מקומית חינמית ניחשה. כלי MCP אחד תיקן את זה 00:36 מה זה MCP? (האנלוגיה של USB-C) 01:03 כיצד שרת MCP, לקוח ומודל משתלבים יחד 01:25 שלב 1: הגדרת uv, ערכת פיתוח התוכנה של MCP Python ואולמה 02:00 מה השתבש #1: ייבוא ​​FastMCP קורס בגרסה 2 02:35 שלב 2: כתיבת שרת MCP בפייתון 03:08 שלב 3: בדיקה (מה השתבש #2: אין) 03:42 שלב 4: הסוכן, כלי MCP לכלי אולמה 04:13 מה השתבש #3: המודל הדפיס את קריאת הכלי 04:40 שלב 5: qwen3:4b מבצע את קריאת הכלי 05:17 לפני ואחרי: ניחוש לעומת נתונים חיים 05:45 בונוס: אותו שרת בקוד קלוד 06:10 המסקנה שלי משאבים שהוזכרו: מבוא ל-MCP: modelcontextprotocol.io ערכת פיתוח תוכנה של MCP Python: modelcontextprotocol/python-sdk מה חדש בגרסה 2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 על Ollama: ollama.com uv: docs.astral.sh פרק 1 (Ollama בונה משחק): youtube.com רישיונות: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python library (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (רישיון מחקר Qwen). ללא חסות. קול בינה מלאכותית (הקול המשובט שלי) ויזואליה שנוצרה; כל ריצות הטרמינל והדפים הם לכידות אמיתיות מ-18 באוקטובר 2026. הסגנון המעשי, המציג כל שלב, נוצר בהשראת FreeAIVault: youtube.com האם כבר בניתם שרת MCP? ספרו לי בתגובות איזה כלי הייתם נותנים לבינה המלאכותית המקומית שלכם קודם. הירשמו ל-skill.md לקבלת הדרכות מעשיות על בינה מלאכותית, פירוט מאגרים ב-GitHub וחדשות על בינה מלאכותית. #mcp #ollama #python #localai #aiagents #claudecode [ja] MCPサーバー入門(Python + Ollama):ローカルAIが「推測」をやめた理由 PythonによるMCPサーバーチュートリアル:公式MCP Python SDK v2を使用してツールを1つ構築し、テストを行い、ローカルAI(Ollama + qwen3:4b)にライブデータを提供します。 コードとプロンプト(ep002):github.com/SYasJ/skillmd-tutorials/tree/main/ep00… ツールを使用しない場合、ローカルモデルはGitHubスター数を「約12,158」と推測しました。MCPツールを使用すると、GitHub APIから取得したライブデータである183,721と回答しました。 すべてGPU非搭載のMac上で実行した実際のデータです。実際のターミナル、実際のタイミング(高速化してラベル付け)、編集されていないモデル出力。開発中に3つの問題が発生しましたが、それぞれの修正方法を示します。 学習内容: - MCP(モデルコンテキストプロトコル)とは何か(図解) - uvを使用してMCP Python SDK 2.3をセットアップし、Ollamaでqwen3:4bをプルする - 古いFastMCPチュートリアルがv2でクラッシュする理由(FastMCPは現在MCPServer) - デコレータ1つとJSONスキーマなしでPythonでMCPサーバーを構築する - 小さなPythonクライアントでMCPサーバーをテストする(そしてstructured_contentがNoneを返す理由) - 小さなエージェントスクリプトを使用して、MCPツールをOllamaツール呼び出しに接続する - qwen2.5-coder:3bがツール呼び出しを行う代わりにツール呼び出しを出力する理由 - 前後比較:推測データとライブデータ - Claude Codeで同じMCPサーバーを使用する(claude mcp add) チャプター: 00:00 無料のローカルAIが推測した。MCPツール1つで修正 00:36 MCPとは? (USB-Cの例え) 01:03 MCPサーバー、クライアント、モデルの連携方法 01:25 ステップ1:uv、MCP Python SDK、Ollamaのセットアップ 02:00 問題点その1:v2でFastMCPインポートがクラッシュ 02:35 ステップ2:PythonでMCPサーバーを記述 03:08 ステップ3:テスト(問題点その2:なし) 03:42 ステップ4:エージェント、MCPツールからOllamaツールへ 04:13 問題点その3:モデルがツール呼び出しを出力 04:40 ステップ5:qwen3:4bがツール呼び出しを実行 05:17 前後比較:推測データと実データ 05:45 ボーナス:Claude Codeでの同じサーバー 06:10 私の感想 参考資料: MCP入門:modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk v2の新機能: py.sdk.modelcontextprotocol.io Ollama: ollama.com Ollama上のqwen3: ollama.com uv: docs.astral.sh エピソード1(Ollamaでゲームを作る): youtube.com ライセンス: mcp 2.3.0 (MIT)、Ollama (MIT)、Ollama Pythonライブラリ (MIT)、qwen3:4b (Apache 2.0)、qwen2.5-coder:3b (Qwen Research License)。 スポンサー提供ではありません。AI音声(私のクローン音声)および生成されたビジュアルを使用しています。全てのターミナル実行とページは、2026年10月18日の実際のキャプチャです。 実践的で、全てのステップを解説するスタイルは、FreeAIVault(youtube.com MCPサーバーはもう構築しましたか?ローカルAIに最初にどのツールを導入するか、コメントで教えてください。 実践的なAIチュートリアル、GitHubリポジトリの解説、AIニュースについては、skill.mdを購読してください。 #mcp #ollama #python #localai #aiagents #claudecode [ko] MCP 서버 튜토리얼 (Python + Ollama): 로컬 AI가 더 이상 추측을 하지 않습니다 파이썬으로 MCP 서버를 구축하는 튜토리얼: 공식 MCP 파이썬 SDK v2를 사용하여 도구를 만들고, 테스트하고, 로컬 AI(Ollama + qwen3:4b) 실시간 데이터를 무료로 제공합니다. 코드 및 프롬프트(ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… 도구를 사용하지 않았을 때, 제 로컬 모델은 GitHub 스타 수를 "약 12,158개"로 추측했습니다. 하지만 MCP 도구를 사용하니 GitHub API에서 가져온 실시간 데이터로 183,721개라고 답했습니다. 모든 과정은 GPU가 없는 Mac에서 실제 실행을 통해 진행되었습니다. 실제 터미널, 실제 실행 시간(속도 조절 및 레이블 표시), 모델 출력은 편집 없이 그대로 사용되었습니다. 진행 과정에서 세 가지 문제가 발생했고, 각각의 해결 과정을 보여드립니다. 이 강의에서 배우게 될 내용: - MCP(모델 컨텍스트 프로토콜)란 무엇인가 (한 그림으로 설명) - uv를 사용하여 MCP Python SDK 2.3을 설정하고 Ollama에서 qwen3:4b를 가져오는 방법 - 이전 FastMCP 튜토리얼이 v2에서 충돌하는 이유 (FastMCP는 이제 MCPServer로 이름이 변경됨) - 데코레이터 하나만으로 JSON 스키마 없이 Python에서 MCP 서버 구축하기 - 간단한 Python 클라이언트로 MCP 서버 테스트하기 (structured_content가 None을 반환하는 이유 포함) - 간단한 에이전트 스크립트를 사용하여 MCP 도구를 Ollama 도구 호출에 연결하는 방법 - qwen2.5-coder:3b에서 도구 호출을 실행하는 대신 도구 호출 결과를 출력하는 이유 - 이전과 이후: 추측 vs. 실제 데이터 - Claude Code에서 동일한 MCP 서버 사용하기 (claude mcp add) 목차: 00:00 무료 로컬 AI가 추측한 결과. MCP 도구 하나로 수정 00:36 MCP란 무엇인가? (USB-C 비유) 01:03 MCP 서버, 클라이언트 및 모델의 구성 방식 01:25 1단계: uv, MCP Python SDK 및 Ollama 설정 02:00 문제 #1: FastMCP 가져오기 시 v2에서 충돌 발생 02:35 2단계: Python으로 MCP 서버 작성 03:08 3단계: 테스트 (문제 #2: 없음) 03:42 4단계: 에이전트, MCP 도구를 Ollama 도구로 변환 04:13 문제 #3: 모델이 도구 호출을 출력함 04:40 5단계: qwen3:4b가 도구 호출 실행 05:17 전후 비교: 추측 데이터 vs 실제 데이터 05:45 보너스: Claude Code에서 동일한 서버 실행 06:10 결론 참고 자료: MCP 소개: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk v2의 새로운 기능: py.sdk.modelcontextprotocol.io Ollama: ollama.com Ollama의 qwen3: ollama.com uv: docs.astral.sh 에피소드 1 (Ollama가 게임을 만듭니다): youtube.com 라이선스: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python 라이브러리 (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen 연구 라이선스). 스폰서 없음. AI 음성(제 목소리를 복제한 것) 및 생성된 시각 자료; 모든 터미널 실행 및 페이지는 2026년 10월 18일에 실제로 캡처된 것입니다. 모든 단계를 보여주는 실습 스타일은 FreeAIVault(youtube.com)에서 영감을 받았습니다. MCP 서버를 구축해 보셨나요? 로컬 AI에 어떤 도구를 먼저 제공하고 싶은지 댓글로 알려주세요. skill.md를 구독하시면 실습 AI 튜토리얼, GitHub 저장소 분석 및 AI 뉴스를 받아보실 수 있습니다. #mcp #ollama #python #localai #aiagents #claudecode [ml] MCP സർവർ ട്യൂട്ടോറിയൽ (Python + Ollama): എന്റെ ലോക്കൽ AI ഊഹിക്കുന്നത് നിർത്തി പൈത്തണിലെ MCP സെർവർ ട്യൂട്ടോറിയൽ: ഔദ്യോഗിക MCP Python SDK v2 ഉപയോഗിച്ച് ഒരു ടൂൾ നിർമ്മിക്കുക, അത് പരീക്ഷിക്കുക, സൗജന്യ ലോക്കൽ AI (Ollama + qwen3:4b) ലൈവ് ഡാറ്റ നൽകുക. കോഡ് + പ്രോംപ്റ്റുകൾ (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… ടൂൾ ഇല്ലാതെ, എന്റെ ലോക്കൽ മോഡൽ "ഏകദേശം 12,158" GitHub നക്ഷത്രങ്ങൾ ഊഹിച്ചു. ഒരു MCP ടൂൾ ഉപയോഗിച്ച് അത് 183,721 ന് ഉത്തരം നൽകി, GitHub API-യിൽ നിന്ന് തത്സമയം. GPU ഇല്ലാത്ത ഒരു Mac-ൽ എല്ലാം ഒരു യഥാർത്ഥ റൺ ആണ്: യഥാർത്ഥ ടെർമിനൽ, യഥാർത്ഥ സമയക്രമങ്ങൾ (വേഗതയേറിയതും ലേബൽ ചെയ്തതും), മോഡൽ ഔട്ട്‌പുട്ട് എഡിറ്റ് ചെയ്യാത്തതും. വഴിയിൽ മൂന്ന് കാര്യങ്ങൾ തകർന്നു, ഞാൻ ഓരോ പരിഹാരവും കാണിക്കുന്നു. നിങ്ങൾക്ക് പഠിക്കാൻ കഴിയുന്ന കാര്യങ്ങൾ: - ഒരു ചിത്രത്തിൽ MCP (മോഡൽ കോൺടെക്സ്റ്റ് പ്രോട്ടോക്കോൾ) എന്താണ് - uv ഉപയോഗിച്ച് MCP പൈത്തൺ SDK 2.3 സജ്ജീകരിക്കുക, ഒല്ലാമയിൽ qwen3:4b വലിക്കുക - പഴയ FastMCP ട്യൂട്ടോറിയലുകൾ v2-ൽ ക്രാഷ് ചെയ്യുന്നത് എന്തുകൊണ്ട് (FastMCP ഇപ്പോൾ MCPServer ആണ്) - JSON സ്കീമ ഇല്ലാതെ, ഒരു ഡെക്കറേറ്റർ ഉപയോഗിച്ച് പൈത്തണിൽ ഒരു MCP സെർവർ നിർമ്മിക്കുക - ഒരു ചെറിയ പൈത്തൺ ക്ലയന്റ് ഉപയോഗിച്ച് ഒരു MCP സെർവർ പരീക്ഷിക്കുക (കൂടാതെ structured_content തിരികെ വന്നത് എന്തുകൊണ്ട് ഒന്നുമില്ല) - ഒരു ചെറിയ ഏജന്റ് സ്ക്രിപ്റ്റ് ഉപയോഗിച്ച് Ollama ടൂൾ കോളിംഗിലേക്ക് MCP ടൂളുകൾ ബന്ധിപ്പിക്കുക - qwen2.5-coder:3b ടൂൾ കോൾ ചെയ്യുന്നതിന് പകരം പ്രിന്റ് ചെയ്തത് എന്തുകൊണ്ട് - മുമ്പും ശേഷവും: ഊഹവും vs ലൈവ് ഡാറ്റയും - ക്ലോഡ് കോഡിൽ അതേ MCP സെർവർ ഉപയോഗിക്കുക (claude mcp add) അധ്യായങ്ങൾ: 00:00 ഒരു സൗജന്യ ലോക്കൽ AI ഊഹിച്ചു. ഒരു MCP ടൂൾ അത് പരിഹരിച്ചു 00:36 MCP എന്താണ്? (USB-C സാമ്യം) 01:03 ഒരു MCP സെർവർ, ക്ലയന്റ്, മോഡൽ എന്നിവ എങ്ങനെ യോജിക്കുന്നു 01:25 ഘട്ടം 1: uv, MCP പൈത്തൺ SDK, Ollama എന്നിവ സജ്ജീകരിക്കുക 02:00 എന്താണ് തെറ്റ് സംഭവിച്ചത് #1: v2-ൽ FastMCP ഇറക്കുമതി ക്രാഷുകൾ 02:35 ഘട്ടം 2: പൈത്തണിൽ MCP സെർവർ എഴുതുക 03:08 ഘട്ടം 3: അത് പരീക്ഷിക്കുക (എന്താണ് തെറ്റ് സംഭവിച്ചത് #2: ഒന്നുമില്ല) 03:42 ഘട്ടം 4: ഏജന്റ്, MCP ഉപകരണങ്ങൾ Ollama ടൂളുകളിലേക്ക് 04:13 എന്താണ് തെറ്റ് സംഭവിച്ചത് #3: മോഡൽ ടൂൾ കോൾ പ്രിന്റ് ചെയ്തു 04:40 ഘട്ടം 5: qwen3:4b ടൂൾ കോൾ ചെയ്യുന്നു 05:17 മുമ്പും ശേഷവും: ഊഹിക്കുക vs ലൈവ് ഡാറ്റ 05:45 ബോണസ്: ക്ലോഡ് കോഡിലെ അതേ സെർവർ 06:10 എന്റെ ടേക്ക്അവേ പരാമർശിച്ച ഉറവിടങ്ങൾ: MCP ആമുഖം: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk v2-ൽ പുതിയതെന്താണ്: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 on Ollama: ollama.com uv: docs.astral.sh എപ്പിസോഡ് 1 (Ollama ഒരു ഗെയിം നിർമ്മിക്കുന്നു): youtube.com ലൈസൻസുകൾ: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python library (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License). സ്പോൺസർ ചെയ്തിട്ടില്ല. AI വോയ്‌സും (എന്റെ ക്ലോൺ ചെയ്‌ത ശബ്‌ദം) ജനറേറ്റുചെയ്‌ത വിഷ്വലുകളും; എല്ലാ ടെർമിനൽ റണ്ണുകളും പേജുകളും 2026 ഒക്ടോബർ 18 മുതൽ യഥാർത്ഥ ക്യാപ്‌ചറുകളാണ്. ഹാൻഡ്-ഓൺ, ഷോ-എവർ-സ്റ്റെപ്പ് ശൈലി FreeAIVault-ൽ നിന്ന് പ്രചോദനം ഉൾക്കൊണ്ടതാണ്: youtube.com നിങ്ങൾ ഇതുവരെ ഒരു MCP സെർവർ നിർമ്മിച്ചിട്ടുണ്ടോ? നിങ്ങളുടെ ലോക്കൽ AI ആദ്യം ഏത് ടൂളാണ് നൽകേണ്ടതെന്ന് അഭിപ്രായങ്ങളിൽ എന്നോട് പറയുക. പ്രായോഗിക AI ട്യൂട്ടോറിയലുകൾ, GitHub repo ബ്രേക്ക്‌ഡൗണുകൾ, AI വാർത്തകൾ എന്നിവയ്ക്കായി skill.md സബ്‌സ്‌ക്രൈബുചെയ്യുക. #mcp #ollama #python #localai #aiagents #claudecode [nl-NL] MCP Server-tutorial (Python + Ollama): Mijn lokale AI is gestopt met gokken MCP-serverhandleiding in Python: bouw een tool met de officiële MCP Python SDK v2, test deze en geef een lokale AI (Ollama + qwen3:4b) gratis live data. Code + prompts (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Zonder de tool schatte mijn lokale model "ongeveer 12.158" GitHub-sterren. Met één MCP-tool antwoordde het 183.721, live via de GitHub API. Alles is een echte test op een Mac zonder GPU: echte terminal, echte timing (versneld en gelabeld), modeluitvoer onbewerkt. Er zijn drie dingen misgegaan, en ik laat elke oplossing zien. Wat je leert: - Wat MCP (Model Context Protocol) is, in één afbeelding - De MCP Python SDK 2.3 instellen met uv en qwen3:4b ophalen in Ollama - Waarom oude FastMCP-tutorials crashen op v2 (FastMCP heet nu MCPServer) - Een MCP-server bouwen in Python met één decorator, zonder JSON-schema - Een MCP-server testen met een kleine Python-client (en waarom structured_content None teruggaf) - MCP-tools verbinden met Ollama-toolaanroepen met een klein agentscript - Waarom qwen2.5-coder:3b de toolaanroep afdrukte in plaats van er een te doen - Voor en na: gokken versus live data - Dezelfde MCP-server gebruiken in Claude Code (claude mcp add) Hoofdstukken: 00:00 Een gratis lokale AI gokte. Eén MCP-tool corrigeerde het 00:36 Wat is MCP? (de USB-C-analogie) 01:03 Hoe een MCP-server, -client en -model samenwerken 01:25 Stap 1: uv, de MCP Python SDK en Ollama instellen 02:00 Wat ging er mis #1: FastMCP-import crasht op v2 02:35 Stap 2: de MCP-server schrijven in Python 03:08 Stap 3: testen (wat ging er mis #2: niets) 03:42 Stap 4: de agent, MCP-tools naar Ollama-tools 04:13 Wat ging er mis #3: het model printte de tool-aanroep 04:40 Stap 5: qwen3:4b voert de tool-aanroep uit 05:17 Voor en na: schatting versus live data 05:45 Bonus: dezelfde server in Claude Code 06:10 Mijn conclusie Genoemde bronnen: MCP-introductie: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk Nieuw in v2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 op Ollama: ollama.com uv: docs.astral.sh Aflevering 1 (Ollama bouwt een spel): youtube.com Licenties: mcp 2.3.0 (MIT), Ollama (MIT), ollama Python-bibliotheek (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen Research License). Niet gesponsord. AI-stem (mijn gekloonde stem) en gegenereerde visuals; Alle terminaluitvoer en pagina's zijn echte schermafbeeldingen van 18 oktober 2026. De praktische, stapsgewijze aanpak is geïnspireerd op FreeAIVault: youtube.com Heb je al een MCP-server gebouwd? Laat me in de reacties weten welke tool je als eerste aan je lokale AI zou geven. Abonneer je op skill.md voor praktische AI-tutorials, analyses van GitHub-repositories en AI-nieuws. #mcp #ollama #python #localai #aiagents #claudecode [pa] MCP ਸਰਵਰ ਟਿਊਟੋਰਿਅਲ (Python + Ollama): ਮੇਰੇ ਲੋਕਲ AI ਨੇ ਅੰਦਾਜ਼ੇ ਲਗਾਉਣੇ ਬੰਦ ਕਰ ਦਿੱਤੇ ਪਾਈਥਨ ਵਿੱਚ MCP ਸਰਵਰ ਟਿਊਟੋਰਿਅਲ: ਅਧਿਕਾਰਤ MCP ਪਾਈਥਨ SDK v2 ਨਾਲ ਇੱਕ ਟੂਲ ਬਣਾਓ, ਇਸਦੀ ਜਾਂਚ ਕਰੋ, ਅਤੇ ਇੱਕ ਮੁਫਤ ਸਥਾਨਕ AI (Ollama + qwen3:4b) ਲਾਈਵ ਡੇਟਾ ਦਿਓ। ਕੋਡ + ਪ੍ਰੋਂਪਟ (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… ਟੂਲ ਤੋਂ ਬਿਨਾਂ, ਮੇਰੇ ਸਥਾਨਕ ਮਾਡਲ ਨੇ "ਲਗਭਗ 12,158" GitHub ਸਟਾਰਾਂ ਦਾ ਅਨੁਮਾਨ ਲਗਾਇਆ। ਇੱਕ MCP ਟੂਲ ਨਾਲ ਇਸਨੇ GitHub API ਤੋਂ ਲਾਈਵ 183,721 ਦਾ ਜਵਾਬ ਦਿੱਤਾ। GPU ਤੋਂ ਬਿਨਾਂ Mac 'ਤੇ ਸਭ ਕੁਝ ਇੱਕ ਅਸਲ ਰਨ ਹੈ: ਅਸਲ ਟਰਮੀਨਲ, ਅਸਲ ਸਮਾਂ (ਸਪੀਡ ਅੱਪ ਅਤੇ ਲੇਬਲ ਕੀਤਾ ਗਿਆ), ਮਾਡਲ ਆਉਟਪੁੱਟ ਬਿਨਾਂ ਸੰਪਾਦਿਤ। ਰਸਤੇ ਵਿੱਚ ਤਿੰਨ ਚੀਜ਼ਾਂ ਟੁੱਟ ਗਈਆਂ, ਅਤੇ ਮੈਂ ਹਰੇਕ ਫਿਕਸ ਦਿਖਾਉਂਦਾ ਹਾਂ। ਤੁਸੀਂ ਕੀ ਸਿੱਖੋਗੇ: - ਇੱਕ ਤਸਵੀਰ ਵਿੱਚ, MCP (ਮਾਡਲ ਕੰਟੈਕਸਟ ਪ੍ਰੋਟੋਕੋਲ) ਕੀ ਹੈ - UV ਨਾਲ MCP Python SDK 2.3 ਸੈਟ ਅਪ ਕਰੋ, ਅਤੇ Ollama ਵਿੱਚ qwen3:4b ਖਿੱਚੋ - ਪੁਰਾਣੇ FastMCP ਟਿਊਟੋਰਿਅਲ v2 'ਤੇ ਕਿਉਂ ਕ੍ਰੈਸ਼ ਹੁੰਦੇ ਹਨ (FastMCP ਹੁਣ MCPServer ਹੈ) - ਇੱਕ ਡੈਕੋਰੇਟਰ ਨਾਲ Python ਵਿੱਚ ਇੱਕ MCP ਸਰਵਰ ਬਣਾਓ, ਕੋਈ JSON ਸਕੀਮਾ ਨਹੀਂ - ਇੱਕ ਛੋਟੇ Python ਕਲਾਇੰਟ ਨਾਲ ਇੱਕ MCP ਸਰਵਰ ਦੀ ਜਾਂਚ ਕਰੋ (ਅਤੇ structured_content ਵਾਪਸ ਕਿਉਂ ਆਇਆ ਕੋਈ ਨਹੀਂ) - MCP ਟੂਲਸ ਨੂੰ ਇੱਕ ਛੋਟੇ ਏਜੰਟ ਸਕ੍ਰਿਪਟ ਨਾਲ Ollama ਟੂਲ ਕਾਲਿੰਗ ਨਾਲ ਕਨੈਕਟ ਕਰੋ - qwen2.5-coder:3b ਨੇ ਇੱਕ ਬਣਾਉਣ ਦੀ ਬਜਾਏ ਟੂਲ ਕਾਲ ਕਿਉਂ ਛਾਪੀ - ਪਹਿਲਾਂ ਬਨਾਮ ਬਾਅਦ: ਅੰਦਾਜ਼ਾ ਬਨਾਮ ਲਾਈਵ ਡੇਟਾ - ਕਲਾਉਡ ਕੋਡ ਵਿੱਚ ਉਹੀ MCP ਸਰਵਰ ਵਰਤੋ (claude mcp add) ਅਧਿਆਇ: 00:00 ਇੱਕ ਮੁਫਤ ਸਥਾਨਕ AI ਅਨੁਮਾਨ ਲਗਾਇਆ। ਇੱਕ MCP ਟੂਲ ਨੇ ਇਸਨੂੰ ਠੀਕ ਕੀਤਾ 00:36 MCP ਕੀ ਹੈ? (USB-C ਸਮਾਨਤਾ) 01:03 ਇੱਕ MCP ਸਰਵਰ, ਕਲਾਇੰਟ ਅਤੇ ਮਾਡਲ ਇਕੱਠੇ ਕਿਵੇਂ ਫਿੱਟ ਹੁੰਦੇ ਹਨ 01:25 ਕਦਮ 1: uv, MCP Python SDK ਅਤੇ Ollama ਸੈਟ ਅਪ ਕਰੋ 02:00 ਕੀ ਗਲਤ ਹੋਇਆ #1: v2 'ਤੇ FastMCP ਆਯਾਤ ਕਰੈਸ਼ ਹੋ ਗਿਆ 02:35 ਕਦਮ 2: Python ਵਿੱਚ MCP ਸਰਵਰ ਲਿਖੋ 03:08 ਕਦਮ 3: ਇਸਦੀ ਜਾਂਚ ਕਰੋ (ਕੀ ਗਲਤ ਹੋਇਆ #2: ਕੋਈ ਨਹੀਂ) 03:42 ਕਦਮ 4: ਏਜੰਟ, MCP ਟੂਲਸ ਨੂੰ Ollama ਟੂਲਸ ਵਿੱਚ 04:13 ਕੀ ਗਲਤ ਹੋਇਆ #3: ਮਾਡਲ ਨੇ ਟੂਲ ਕਾਲ ਪ੍ਰਿੰਟ ਕੀਤੀ 04:40 ਕਦਮ 5: qwen3:4b ਟੂਲ ਕਾਲ ਕਰਦਾ ਹੈ 05:17 ਪਹਿਲਾਂ ਅਤੇ ਬਾਅਦ ਵਿੱਚ: ਅੰਦਾਜ਼ਾ ਲਗਾਓ ਬਨਾਮ ਲਾਈਵ ਡੇਟਾ 05:45 ਬੋਨਸ: ਕਲਾਉਡ ਕੋਡ ਵਿੱਚ ਉਹੀ ਸਰਵਰ 06:10 ਮੇਰਾ ਲੈਣ-ਦੇਣ ਜ਼ਿਕਰ ਕੀਤੇ ਸਰੋਤ: MCP ਜਾਣ-ਪਛਾਣ: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk v2 ਵਿੱਚ ਨਵਾਂ ਕੀ ਹੈ: py.sdk.modelcontextprotocol.io ਓਲਾਮਾ: ollama.com qwen3 ਓਲਾਮਾ 'ਤੇ: ollama.com uv: docs.astral.sh ਐਪੀਸੋਡ 1 (ਓਲਾਮਾ ਇੱਕ ਗੇਮ ਬਣਾਉਂਦਾ ਹੈ): youtube.com ਲਾਇਸੈਂਸ: mcp 2.3.0 (MIT), ਓਲਾਮਾ (MIT), ਓਲਾਮਾ ਪਾਈਥਨ ਲਾਇਬ੍ਰੇਰੀ (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (Qwen ਰਿਸਰਚ ਲਾਇਸੈਂਸ)। ਸਪਾਂਸਰ ਨਹੀਂ ਕੀਤਾ ਗਿਆ। AI ਵੌਇਸ (ਮੇਰੀ ਕਲੋਨ ਕੀਤੀ ਵੌਇਸ) ਅਤੇ ਤਿਆਰ ਕੀਤੇ ਵਿਜ਼ੂਅਲ; ਸਾਰੇ ਟਰਮੀਨਲ ਰਨ ਅਤੇ ਪੰਨੇ 18 ਅਕਤੂਬਰ 2026 ਤੋਂ ਅਸਲ ਕੈਪਚਰ ਹਨ। ਹੱਥ-ਚਾਲੂ, ਸ਼ੋਅ-ਐਵਰੀ-ਸਟੈਪ ਸ਼ੈਲੀ FreeAIVault ਤੋਂ ਪ੍ਰੇਰਿਤ ਹੈ: youtube.com ਕੀ ਤੁਸੀਂ ਅਜੇ ਤੱਕ ਇੱਕ MCP ਸਰਵਰ ਬਣਾਇਆ ਹੈ? ਮੈਨੂੰ ਟਿੱਪਣੀਆਂ ਵਿੱਚ ਦੱਸੋ ਕਿ ਤੁਸੀਂ ਪਹਿਲਾਂ ਆਪਣਾ ਸਥਾਨਕ AI ਕਿਹੜਾ ਟੂਲ ਦਿਓਗੇ। ਹੱਥ-ਚਾਲੂ AI ਟਿਊਟੋਰਿਅਲ, GitHub ਰੈਪੋ ਬ੍ਰੇਕਡਾਊਨ ਅਤੇ AI ਖ਼ਬਰਾਂ ਲਈ skill.md ਦੀ ਗਾਹਕੀ ਲਓ। #mcp #ollama #python #localai #aiagents #claudecode [pl] Poradnik serwera MCP (Python + Ollama): Moja lokalna sztuczna inteligencja przestała zgadywać Samouczek serwera MCP w Pythonie: zbuduj jedno narzędzie z oficjalnym pakietem MCP Python SDK v2, przetestuj je i udostępnij darmowe dane na żywo lokalnej sztucznej inteligencji (Ollama + qwen3:4b). Kod + podpowiedzi (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Bez narzędzia mój lokalny model odgadł „około 12 158” gwiazdek GitHub. Z jednym narzędziem MCP odpowiedział na 183 721, na żywo z API GitHub. Wszystko działa na komputerze Mac bez GPU: prawdziwy terminal, rzeczywiste czasy (przyspieszone i oznaczone), nieedytowane dane wyjściowe modelu. Po drodze zepsuły się trzy rzeczy i pokazuję każdą z nich. Czego się nauczysz: - Czym jest MCP (Model Context Protocol) na jednym obrazku - Skonfigurujesz MCP Python SDK 2.3 z uv i pobierzesz qwen3:4b w Ollama - Dlaczego stare samouczki FastMCP ulegają awarii w wersji 2 (FastMCP to teraz MCPServer) - Zbudujesz serwer MCP w Pythonie z jednym dekoratorem, bez schematu JSON - Przetestujesz serwer MCP za pomocą małego klienta Pythona (i dlaczego structured_content zwróciło None) - Połączysz narzędzia MCP z wywołaniem narzędzia Ollama za pomocą małego skryptu agenta - Dlaczego qwen2.5-coder:3b wyświetliło wywołanie narzędzia zamiast je wykonać - Przed i po: zgadywanie a dane na żywo - Użyj tego samego serwera MCP w Claude Code (dodanie Claude mcp) Rozdziały: 00:00 Darmowa lokalna sztuczna inteligencja zgadła. Jedno narzędzie MCP to naprawiło 00:36 Czym jest MCP? (analogia USB-C) 01:03 Jak serwer MCP, klient i model do siebie pasują 01:25 Krok 1: konfiguracja uv, zestawu SDK MCP Python i Ollama 02:00 Co poszło nie tak nr 1: Import FastMCP ulega awarii w wersji 2 02:35 Krok 2: napisanie serwera MCP w Pythonie 03:08 Krok 3: przetestowanie (co poszło nie tak nr 2: brak) 03:42 Krok 4: agent, narzędzia MCP do narzędzi Ollama 04:13 Co poszło nie tak nr 3: model wydrukował wywołanie narzędzia 04:40 Krok 5: qwen3:4b wykonuje wywołanie narzędzia 05:17 Przed i po: zgadywanie kontra dane rzeczywiste 05:45 Bonus: ten sam serwer w Claude Code 06:10 Moje wnioski Wspomniane zasoby: Wprowadzenie do MCP: modelcontextprotocol.io MCP Python SDK: modelcontextprotocol/python-sdk Co nowego w wersji 2: py.sdk.modelcontextprotocol.io Ollama: ollama.com qwen3 o Ollama: ollama.com uv: docs.astral.sh Odcinek 1 (Ollama tworzy grę): youtube.com Licencje: mcp 2.3.0 (MIT), Ollama (MIT), biblioteka Ollama Python (MIT), qwen3:4b (Apache 2.0), qwen2.5-coder:3b (licencja Qwen Research). Niesponsorowane. Głos AI (mój sklonowany głos) i wygenerowane wizualizacje; wszystkie uruchomienia terminala i strony to rzeczywiste przechwyty z 18 października 2026 r. Praktyczny styl pokazowy krok po kroku jest inspirowany FreeAIVault: youtube.com Zbudowałeś już serwer MCP? Daj znać w komentarzach, jakie narzędzie dałbyś swojej lokalnej AI jako pierwsze. Subskrybuj skill.md, aby uzyskać dostęp do praktycznych samouczków AI, zestawień repozytoriów GitHub i nowości ze świata AI. #mcp #ollama #python #localai #aiagents #claudecode [pt-BR] Tutorial de Servidor MCP (Python + Ollama): Minha IA Local Parou de Chutar Tutorial do servidor MCP em Python: crie uma ferramenta com o SDK oficial do MCP para Python v2, teste-a e forneça dados locais gratuitos para uma IA (Ollama + qwen3:4b) em tempo real. Código + instruções (ep002): github.com/SYasJ/skillmd-tutorials/tree/main/ep00… Sem a ferramenta, meu modelo local estimou "aproximadamente 12.158" estrelas no GitHub. Com uma ferramenta MCP, ele respondeu 183.721, diretamente da API do GitHub. Tudo foi executado em um Mac sem GPU: terminal real, tempos reais (acelerados e com legendas), saída do modelo sem edição. Três coisas quebraram durante o processo, e mostro cada correção. O que você aprenderá: - O que é MCP (Model Context Protocol), em uma imagem - Configurar o SDK Python do MCP 2.3 com uv e usar qwen3:4b no Ollama - Por que os tutoriais antigos do FastMCP travam na versão 2 (FastMCP agora é MCPServer) - Criar um servidor MCP em Python com um único decorador, sem esquema JSON - Testar um servidor MCP com um pequeno cliente Python (e por que structured_content retornou None) - Conectar ferramentas MCP à chamada de ferramentas do Ollama com um pequeno script de agente - Por que qwen2.5-coder:3b imprimiu a chamada da ferramenta em vez de fazer uma - Antes e depois: palpite versus dados reais - Usar o mesmo servidor MCP no Claude Code (claude mcp add) Capítulos: 00:00 Uma IA local gratuita fez um palpite. Uma ferramenta MCP corrigi

    2 likes · 85 views
  5. MCP Python SDK CVE-2026-59951: stateful Streamable HTTP (the FastMCP default) never freed sessions. No expiry, no cap, DELETE didn't drop them. Any client reaching the endpoint can grow memory until restart. Fix: mcp 1.30.0 / 2.2.0, or stateless_http=True. github.com/modelcontextprotocol/python-sdk/securi…

    1 like · 55 views
  6. YouTube · · YouTube description · Everything For AI

    Python Sdk 🤖 AI Tools Daily — October 19, 2026 Your daily roundup of LLM tools, AI skills, and MCP updates. Subscribe and hit 🔔 so you never miss a story. ───────────────────────────────── ⚙️ LLM TOOLS ───────────────────────────────── 00:08 — Import AI 476: Creativity and RSI; worse-than-China open weight models; AI goes to space 📰 ImportAI 🔗 importai.substack.com 01:08 — I'm testing small local models, is MetriLLM considered to be a good benchmark, or are there other test suites that I should use? 📰 Reddit r/LocalLLaMA 🔗 reddit.com 02:19 — LSearch - Spotlight for windows with embedding 📰 Reddit r/LocalLLaMA 🔗 reddit.com 03:59 — Show HN: Organ – Autonomous AI executives that build and operate businesses 📰 Hacker News 🔗 organ.app 04:53 — I Built a Trap for AI Image Judges. They Walked Into a Different One. 📰 Towards Data Science 🔗 towardsdatascience.com ───────────────────────────────── 🎯 SKILLS ───────────────────────────────── 06:04 — We Specified an AI Agent in 2016. We Called It Analytics. 📰 Towards Data Science 🔗 towardsdatascience.com 07:28 — Show HN: Ctxvitals – a vitals check for your AI agent stack (npx ctxvitals) 📰 Hacker News 🔗 princejain756/ctxvitals 08:29 — 10 Hugging Face Models Worth Knowing in 2026 📰 KDNuggets 🔗 kdnuggets.com 09:37 — Show HN: I built Airlock, to sandbox your AI agent and know what it's doing 📰 Hacker News 🔗 airlock.sorrel.systems 10:39 — Article: When Should You Use Liquid Clustering? Benchmarking Lakehouse Layout Strategies 📰 InfoQ AI/ML 🔗 infoq.com 12:05 — Podcast: What Does It Really Mean To Program With AI: A Conversation with Joy Ebertz 📰 InfoQ AI/ML 🔗 infoq.com ───────────────────────────────── 🔌 MCP ───────────────────────────────── 13:34 — Python Sdk 🐙 GitHub · Python · ⭐ 24,550 stars 🔗 modelcontextprotocol/python-sdk ───────────────────────────────── ▶ AI TOOLS ───────────────────────────────── 14:47 — Prompt: AI agents are running into the limits of access 📰 AI Business 🔗 aibusiness.com ───────────────────────────────── 📌 Subscribe for daily AI tools updates 🔔 Bell icon → All notifications 👍 Like if this was useful #LLMTools #AITools #MCP #ModelContextProtocol #AISkills #LangChain #PromptEngineering #AIAgents #Anthropic #OpenAI #HuggingFace #AIWorkflow Auto-generated daily AI tools digest. All article links above belong to their respective publishers.

    5 views
  7. If you're running an MCP server on the Python SDK, go update it. The HTTP and auth endpoints were reading request bodies with no size limit, so one giant request could knock your server over. Fix is mcp 1.29.1 or 2.1.0+ github.com/modelcontextprotocol/python-sdk/securi…

    1 like · 13 views
  8. YouTube · · YouTube description · AI Skill Vault

    Build Standardized AI Agent Tools with the Official MCP Python SDK! 💻⚡ (Open Source) Today we brought another repo called MCP Python SDK — the official Anthropic SDK for Model Context Protocol! 💻⚡ Stop creating custom, fragile glue code for every tool your AI agents need. In Day 37 of our GitHub Repo Series on AI Skill Vault, we explore how the official MCP Python SDK standardizes tool discovery, prompt templates, and local resource servers over stdio and SSE connections in Python. ⭐ GitHub Repository: modelcontextprotocol/python-sdk 💻 Language: Python 🛠️ Key Features: Clean `@mcp.tool()` and `@mcp.resource()` decorators, stdio & SSE transport protocols, async server/client architecture, and native integration with Claude Code, Cursor, and Goose. 📌 TIMESTAMPS: 0:00 - Today we brought another repo called MCP Python SDK 0:10 - How It Helps: Standardizing tool discovery & protocol servers for AI models 0:20 - Code Demo: `pip install mcp`, writing `@mcp.tool()` functions & server execution 0:30 - Subscribe to AI Skill Vault Want more practical AI repos, agents and automation? Subscribe to AI Skill Vault. #github #developer #ai #python #mcp #modelcontextprotocol #aiagents #opensource #coding #aiskillvault

    5 likes · 216 views
  9. DEV · · @sampop3

    Your MCP server probably accepts tokens that were never meant for it Your MCP server probably accepts tokens that were never meant for it. In the official Python SDK, that's what happens when you leave one setting unset. And the tool someone adds six months from now will probably skip your scope check, unless a test stops it. This matters now because Atlassian's rebuilt MCP server is generally available, and it shows the pattern that's becoming the norm. It uses OAuth 2.1 with PKCE so the agent only gets the user's own permissions, it sorts tools into read, write and destructive, and it adds admin scopes and audit logging. You can build the same controls into your own server with the official Python SDK and the current MCP specification (2026-07-28). The example is a small "tickets" server, and the code below runs in CI against mcp 2.3.0, the current release. Reject tokens issued for someone else Your MCP server is an OAuth 2.1 resource server. It never logs anyone in. It validates tokens issued by your authorization server (Okta, Entra ID, Keycloak and the like). The spec makes two checks mandatory: servers MUST validate that a token was issued for them as the audience (RFC 8707), and MUST NOT accept or pass on any other tokens. from pydantic import AnyHttpUrl from mcp.server import MCPServer from mcp.server.auth.provider import AccessToken, TokenVerifier from mcp.server.auth.settings import AuthSettings RESOURCE = "https://mcp.example.com/mcp" # canonical URI of this server, no trailing slash class JwtVerifier(TokenVerifier): async def verify_token(self, token: str) -> AccessToken | None: claims = validate_jwt(token) # YOUR code: JWKS signature, exp, iss checks if claims is None: return None return AccessToken( token=token, client_id=claims["client_id"], scopes=claims.get("scope", "").split(), expires_at=claims["exp"], resource=claims["aud"], # RFC 8707 resource indicator / audience subject=claims["sub"], ) mcp = MCPServer( "tickets", token_verifier=JwtVerifier(), auth=AuthSettings( issuer_url=AnyHttpUrl("https://auth.example.com"), resource_server_url=AnyHttpUrl(RESOURCE), required_scopes=["tickets:read"], validate_token_resource=True, ), ) Set validate_token_resource=True explicitly. In mcp 2.3.0, leaving it unset while resource_server_url is set logs a warning and behaves as False, so tokens minted for other services get accepted. The SDK says 3.0 will flip the default. If your verifier already checks the audience, set it to False on purpose rather than leaving it unset. If your IdP issues multi-audience tokens, the SDK's docstring says to set resource to the entry that equals resource_server_url. resource_server_url also drives discovery. The SDK uses it as the base route for OAuth Protected Resource Metadata (RFC 9728), which the spec requires so clients can find your authorization server from the WWW-Authenticate header on a 401. Check scopes inside every tool required_scopes gates the whole server. Real systems need more: read for search, write for updates, a separate scope for deletes. The SDK exposes the current token inside a tool: from mcp.server.auth.middleware.auth_context import get_access_token from mcp.server.mcpserver.exceptions import ToolError def require_scope(scope: str) -> AccessToken: token = get_access_token() if token is None or scope not in token.scopes: # no token fails closed raise ToolError(f"This action needs the '{scope}' scope. Re-authorize to grant it.") return token Raise ToolError, not a generic exception. The SDK turns ToolError into an isError: true result the model can read and act on. Anything else is treated as a crash, and the model sees only Error executing tool <name>, which gives the agent nothing to recover from. Keep the token is None branch. Writing the check as if token and scope not in token.scopes reads almost the same, but it lets every call without a token straight through. At the HTTP level, the spec describes the full step-up flow: respond 403 with WWW-Authenticate: Bearer error="insufficient_scope", scope="...", resource_metadata="...", and list all the scopes the operation needs in one challenge, not one per retry. If a gateway in front of the server can see which tool is being called, issue the challenge there. The in-tool check is the minimum. Annotations are hints, not security from mcp.types import ToolAnnotations @mcp.tool(title="Search tickets", annotations=ToolAnnotations(read_only_hint=True, open_world_hint=False)) def search_tickets(query: str) -> list[dict]: require_scope("tickets:read") ... @mcp.tool(title="Close ticket", annotations=ToolAnnotations(read_only_hint=False, destructive_hint=False, idempotent_hint=True)) def close_ticket(ticket_id: str) -> str: require_scope("tickets:write") ... @mcp.tool(title="Delete ticket", annotations=ToolAnnotations(read_only_hint=False, destructive_hint=True)) def delete_ticket(ticket_id: str) -> str: require_scope("tickets:admin") ... Annotations let a client ask for confirmation before delete_ticket runs, the same read/write/destructive split Atlassian describes. But destructive_hint=False on close_ticket is a claim the client has to take on trust, and the spec tells clients to treat annotations from untrusted servers as untrusted. The SDK docs say not to rely on clients honouring them. Your scope check is the control. destructive_hint and idempotent_hint only mean something on tools that write, which is why the read-only tool leaves them out. Hints aren't purely decorative, which is exactly why they can't be trusted. VS Code skips its confirmation prompt for tools marked readOnlyHint and asks for every other tool, so a write tool mislabelled as read-only runs with no prompt at all. Most clients do far less: in March the MCP project's own blog noted that no client surfaces annotations in its approval prompts. The strongest version of this rule isn't a hint. If a deployment doesn't need write tools, don't register them, and turn them on only through server config. A tool that doesn't exist can't be called. Make the scope check impossible to forget A scope check that lives in each tool body is only as good as the next person who adds a tool. So test the rule, not the tools you have today, and don't let annotations decide what gets tested. Declare the scope each tool needs next to its registration: # tickets_server.py, next to the tools REQUIRED_SCOPE = {"search_tickets": "tickets:read", "close_ticket": "tickets:write", "delete_ticket": "tickets:admin"} Then enumerate the registry, check that the matrix covers exactly the registered tools, and call each tool with every scope except its own: import asyncio import pytest from mcp.server import MCPServer from mcp.server.auth.middleware.auth_context import auth_context_var from mcp.server.auth.middleware.bearer_auth import AuthenticatedUser from mcp.server.auth.provider import AccessToken from mcp.server.mcpserver.exceptions import ToolError from tickets_server import REQUIRED_SCOPE, TICKETS, mcp async def as_caller(scopes, fn, *args): user = AuthenticatedUser(AccessToken(token="t", client_id="test", scopes=scopes)) reset = auth_context_var.set(user) # what the auth middleware does per request try: return await fn(*args) finally: auth_context_var.reset(reset) def assert_every_tool_needs_its_scope(server, required, store): # enumerate the registry itself: a scope-filtered tools/list override can't hide a tool from this tools = asyncio.run(MCPServer.list_tools(server)) assert {t.name for t in tools} == set(required), "every registered tool needs an entry in REQUIRED_SCOPE" all_scopes = sorted(set(required.values())) for tool in tools: need = required[tool.name] if tool.annotations and tool.annotations.read_only_hint: assert need == "tickets:read", f"{tool.name} is marked read-only but needs {need}" args = {p: "T-1" for p in tool.input_schema.get("required", [])} before = dict(store) with pytest.raises(ToolError, match="scope"): # every scope except its own asyncio.run(as_caller([s for s in all_scopes if s != need], server.call_tool, tool.name, args)) assert store == before, f"{tool.name} changed data without its scope" asyncio.run(as_caller([need], server.call_tool, tool.name, args)) # and its own scope is enough def test_every_tool_needs_its_declared_scope(): assert_every_tool_needs_its_scope(mcp, REQUIRED_SCOPE, TICKETS) When someone adds reopen_ticket next year and forgets both require_scope and the matrix entry, the coverage line goes red before the tool ships. If they add the entry but not the check, the call with the wrong scopes doesn't raise and the test fails. If they mark it read_only_hint=True while it needs tickets:write, the annotation line fails. TICKETS is the example's stand-in for the ticketing backend, and comparing it before and after catches a tool that writes first and checks the scope second. This version replaces an earlier test that picked its targets by annotation: it called every tool not marked read-only with a tickets:read token. A reader showed the hole. Mark a write tool read_only_hint=True, skip require_scope, and that test never calls it, so it passes while a read token changes data. The annotation decided what got tested, which is backwards when annotations are the thing you can't trust. The new test also calls MCPServer.list_tools(server) directly, so a scope-filtered tools/list override (see below) can't hide a tool from it, and it builds the scope list from the matrix rather than from a hard-coded list that goes stale when you add a scope. The example repo has a mutation test for each of these cases. You could instead scan the registry for tools without require_scope in their source, which is cheaper. But that only proves the call appears somewhere in the function, not that it runs before the side effect. The behavioral test is the one to keep. Background work keeps a stale token get_access_token() reads a context variable that the SDK's auth middleware sets for each request and resets when the request ends. What your code sees depends on how it starts extra work: | Started with | Sees the token? | |---|---| | A sync tool (def), which the SDK runs via anyio.to_thread.run_sync | Yes, AnyIO copies the context to the worker thread | | asyncio.create_task() | Yes, and it keeps seeing it after the request ends | | asyncio.to_thread() | Yes | | loop.run_in_executor() | No, None | | threading.Thread | No, None | The None cases are the safe ones: require_scope fails closed and denies. The dangerous case is the task that outlives its request. It authorizes with a snapshot of the token, even after that token has expired or been revoked. So check scopes in the handler before you spawn anything, pass the values the background work needs explicitly, and never call require_scope from a task that can outlive the request. Spec details that cost you tokens The spec lets tools/list vary by the authorization on the request, so you can list only the tools the caller's scopes allow. Be careful what you hide. The spec has clients start with the minimal scopes_supported set and add scopes through step-up when a call fails with insufficient_scope. A tool the model never sees is never called, so the challenge never fires and a user who would happily grant tickets:write is never asked. Hide only the tools behind scopes this caller can't get at all, such as delete_ticket for users who will never hold tickets:admin. That still saves prompt tokens, since every tool definition the client loads costs context on every turn, and it doesn't break the upgrade path for the rest. Keep tool order stable. The spec says servers SHOULD return tools in the same order when the set hasn't changed, because it improves prompt-cache hit rates when tools sit in the model's context. A shuffled list quietly defeats prefix caching. Never forward the user's token downstream. If close_ticket calls your ticketing API, use the server's own credentials or a token from a proper exchange. Passing the incoming token through breaks the spec's "MUST NOT ... transit any other tokens" rule. Do this today Add the scope-matrix test above to your server's CI. It takes a few minutes, it catches the mistakes annotations can't, and it keeps protecting you as the tool list grows. Then check your server for the four basics: no token gets a 401 with resource_metadata in WWW-Authenticate; the protected resource metadata is served at that URL; a token for a different audience gets a 401; and a tickets:read token calling close_ticket gets an isError: true result that names the missing scope. Thanks to Arhan Canli, whose comment prompted the scope test and the background-task section, and to Edward Izgorodin and Moein, whose comments corrected the advice on hiding tools and hardened the test, and to tgapps, who showed that a write tool mislabelled as read-only slipped past the old test, which led to the scope matrix. Updated October 26, 2026. The code is tested in CI against mcp 2.3.0 on Python 3.13 (articles/examples/mcp-scopes in this site's repo). validate_jwt stands in for your identity provider's JWT validation. Pin your SDK version, because names like MCPServer replaced earlier ones. Sources - MCP specification 2026-07-28: Authorization - MCP specification 2026-07-28: Tools - MCP Python SDK docs: Authorization - MCP Python SDK docs: Tools - VS Code: MCP developer guide - MCP blog: Tool annotations as risk vocabulary - MCP Python SDK source (mcp 2.3.0): auth/settings.py, auth_context.py, bearer_auth.py, mcpserver/server.py, func_metadata.py - Python docs: asyncio tasks and to_thread context handling - AnyIO docs: running functions in worker threads (context is copied) - Atlassian: "Atlassian MCP brings more of your work within reach of any AI agent" (Oct 6, 2026) --- Originally published at inferprice.pages.dev.

    3 reactions · 9 comments
  10. DEV · · @xbill

    One MCP Server for Six AWS Inference Backends: Bedrock, SageMaker, GPUs, Inferentia and Trainium --- title: "One MCP Server for Six AWS Inference Backends: Bedrock, SageMaker, GPUs, Inferentia and Trainium" published: true description: "A step by step look at the MCP server that runs a six-backend Gemma 4 demo on AWS: one Python file over the demo's own code, eight tools marked read-only, write or destructive, SSM Run Command instead of open ports, and an agent that counts through the server and gets the same grade as in-process tools." tags: aws, mcp, python, ai cover_image: raw.githubusercontent.com --- This article provides a step by step guide to the MCP server that operates a six-backend inference demo on AWS: Amazon Bedrock, a SageMaker endpoint, vLLM on EC2 g6 and g5g, and Gemma 4 on Inferentia2 and Trainium. A suite of eight Python MCP tools lists, launches, health-checks, reads the logs of, asks, and tears down every backend from one chat session. xbill9/aws-inference-strands --- What Is the Problem? The demo behind this server puts one Strands agent in front of six ways to serve a model on AWS. Running it means five billable resources in up to four regions, two of them on AWS Neuron chips, and none of the instances reachable from the internet. The repository already has shell scripts for all of it: stage/up.sh, stage/forward.sh, stage/check.py, stage/ask.py and stage/down.sh. Each one prints for a person at a terminal. The MCP server gives the same operations to an agent. It answers "what is running and what is billing", "is inf2 serving yet", "show me the vLLM log on g6" and "tear it all down" with tools whose arithmetic and checks run in code, and it serves demo 1's counting tool to a Strands agent over the protocol itself. --- At This Point You Should Have… - An AWS account with the AWS CLI configured, and Bedrock model access for Amazon Nova Micro in us-east-1 - Python 3 (3.14.7 here) with mcp, strands-agents[openai,sagemaker] and boto3 installed - The instance profile and SSM-only security group stage/up.sh uses (it creates the security group on first use) - Claude Code, or any MCP client that can start a stdio server - The companion article for how each backend is built --- Step 1 — Register the Server The server is one file, mcp_server.py, started over stdio. .mcp.json in the repository root registers it for Claude Code: { "mcpServers": { "strands-demo": { "command": "python3", "args": ["mcp_server.py"] } } } Any MCP client can start it the same way. Three lines of JSON-RPC on stdin are enough to see what it offers: printf '%s\n' \ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"printf","version":"0"}}}' \ '{"jsonrpc":"2.0","method":"notifications/initialized"}' \ '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ | python3 mcp_server.py { "protocolVersion": "2025-11-25", "capabilities": {"tools": {"listChanged": false}, "prompts": {"listChanged": false}, "resources": {"listChanged": false, "subscribe": false}, "experimental": {}}, "serverInfo": {"name": "strands-demo", "version": ""} } The server runs on the MCP Python SDK 2.1.1 and its MCPServer class, and negotiates protocol version 2025-11-25. tools/list returns eight tools. --- Step 2 — One File Over the Demo's Own Code The server imports the two modules the demos already use and adds AWS calls around them. Claude Code / Strands MCPClient │ stdio, JSON-RPC 2.0 ▼ ┌──────────────────────── mcp_server.py ────────────────────────┐ │ list_backends backend_health backend_logs launch_log │ │ ask_backend count_ids launch_backends teardown │ └──┬───────────────┬───────────────┬───────────────┬────────────┘ │ boto3 │ backends.py │ demo1_ │ subprocess │ EC2, SSM, │ chat_once() │ counting.py │ stage/up.sh │ SageMaker │ │ count() │ stage/down.sh ▼ ▼ ▼ ▼ 4 US regions, Bedrock, the 11 ids, detached, by tag SageMaker, in memory output in SSM forwards stage/*.log Four design rules hold the file together: - Reuse, then wrap. ask_backend calls backends.chat_once, the function stage/ask.py, stage/check.py, the benchmark and demo 2 call. count_ids calls demo1_counting.count, the function the in-process tool calls. A number from the server and a number from the scripts come from the same line of code. - Launch and teardown run the stage scripts. launch_backends starts stage/up.sh and teardown starts stage/down.sh, so the MCP route and the documented route create and destroy the same resources. - No inbound ports. Every instance sits in a security group with no inbound rules. Tools that need the box run a shell command on it through SSM Run Command. - The tag is the inventory. stage/up.sh tags every instance ManagedBy=strands-demo-run, and every lookup in the server filters on that tag across us-east-2, us-east-1, us-west-2 and us-west-1. A backend that fell over to another region on a capacity error is still found. boto3 is synchronous, so each call runs in a worker thread through asyncio.to_thread. That lets one tool ask four regions at once with asyncio.gather: async def _instances() -> list[dict]: per_region = await asyncio.gather(*[_region_instances(r) for r in REGIONS]) return [i for found in per_region for i in found] --- Step 3 — Read-Only, Write and Destructive Every tool carries MCP tool annotations, so a client can tell an inventory call from one that bills or one that deletes before it calls anything. READ_ONLY = ToolAnnotations(readOnlyHint=True, idempotentHint=True) WRITE = ToolAnnotations(destructiveHint=False) DESTRUCTIVE = ToolAnnotations(destructiveHint=True) What tools/list returns, read back through the MCP client: | Tool | Annotation | Arguments | What it touches | |---|---|---|---| | list_backends | read-only | none | EC2, SSM and SageMaker describe calls in 4 regions | | backend_health | read-only | backend | one chat request, on the box via SSM for EC2 | | backend_logs | read-only | backend, tail | the serving log, via SSM | | ask_backend | read-only | backend, prompt, max_tokens | one chat request through the forwards | | count_ids | read-only | op, value | demo 1's ids, in memory | | launch_log | read-only | which, tail | stage/up.log or stage/down.log | | launch_backends | write | names | stage/up.sh; starts billing | | teardown | destructive | none | stage/down.sh; terminates everything | The rest of this article takes the tools in the order a demo day uses them. --- Step 4 — list_backends: What Is Running and What Is Billing list_backends searches the four regions for tagged instances, asks SSM whether each running one has checked in, asks SageMaker for the endpoint's status, and adds up what is billing. The counts are computed in the tool, so the agent quotes them. With nothing launched: { "backends": [ {"backend": "bedrock", "where": "us-east-1 (managed)", "state": "always on", "ssm": "-"}, {"backend": "sagemaker", "where": "us-east-2 endpoint gemma-4-e2b-strands", "state": "not found", "ssm": "-"}, {"backend": "g6", "where": "-", "state": "not launched", "ssm": "-"}, {"backend": "g5g", "where": "-", "state": "not launched", "ssm": "-"}, {"backend": "inf2", "where": "-", "state": "not launched", "ssm": "-"}, {"backend": "trn1", "where": "-", "state": "not launched", "ssm": "-"} ], "billing_now": 0, "ec2_running": 0, "sagemaker": "not found", "ask_backend_configured": ["bedrock", "g6", "g5g", "sagemaker", "inf2", "trn1"] } One call took 0.78 seconds for five AWS describe calls: one per region for EC2 and one for SageMaker. Each running instance adds an SSM call. ask_backend_configured lists all six backends while five are down. It names every backend with a URL in demo.env, the file stage/forward.sh writes into the stage directory, and that file outlives the forwards. The tool's description says so, and Step 8 shows what a call to one of those backends returns. --- Step 5 — launch_backends and launch_log: Start Billing, Then Read the Launch launch_backends takes any of g6, inf2, trn1, g5g and sm, checks the names, and starts stage/up.sh with them in the background: launch_backends {"names": ["g6", "inf2"]} started stage/up.sh g6 inf2 (pid 2362067); output in stage/up.log, read it with launch_log The call returns at once. The script picks an AMI, tries each zone in turn, then the next region, and writes what it did to stage/up.log. launch_log reads the log: strands-demo-g6: launched i-005ebaee08f191e7a us-east-2a strands-demo-inf2: no capacity in us-east-2 (subnet-0b0f0d29473b0a624), trying the next zone strands-demo-inf2: launched i-0bf43d9b77b321ec3 us-east-2b Next: stage/forward.sh (once the instances are up), then: source stage/demo.env && python3 stage/check.py inf2 had no capacity in the first zone and launched in the second. Half a minute later list_backends showed both instances running and billing, before either had registered with SSM: {"backend": "inf2", "where": "us-east-2 i-0bf43d9b77b321ec3 inf2.xlarge", "state": "running", "ssm": "not registered"}, {"backend": "g6", "where": "us-east-2 i-005ebaee08f191e7a g6.xlarge", "state": "running", "ssm": "not registered"}, ... "billing_now": 2, "ec2_running": 2 --- --- Step 6 — backend_health: Ask on the Box For the four EC2 backends, backend_health finds the instance by tag and sends one shell command through SSM Run Command. The command runs curl against the server's port on the instance and prints the HTTP code, the time and the body: cmd = (f"curl -s -m 90 -o /tmp/strands-health.json -w '%{{http_code}} %{{time_total}}' " f"-H 'content-type: application/json' -d {shlex.quote(body)} " f"http://localhost:{box['port']}/v1/chat/completions; echo; cat /tmp/strands-health.json") The request never leaves the instance, so the check needs no port forward and no inbound rule. Bedrock and SageMaker are called directly. SageMaker is checked for InService first. Polled once a minute from launch, the replies trace each instance coming up: 02:13:14Z g6 -> ❌ AWS InvalidInstanceId: Instances not in a valid state for account 02:14:21Z g6 -> ❌ RuntimeError: SSM Failed: 000 0.000140 ... 02:24:36Z g6 -> ✅ g6: answered 'Paris' in 1.21s, on i-005ebaee08f191e7a (us-east-2) via SSM 02:26:11Z inf2 -> ❌ RuntimeError: SSM Failed: 000 90.000889 ... 02:32:44Z inf2 -> ✅ inf2: answered 'Paris' in 0.27s, on i-0bf43d9b77b321ec3 (us-east-2) via SSM Each failure names a different stage: | Reply | Meaning | |---|---| | InvalidInstanceId | the SSM agent has not registered yet; nothing can run on the box | | 000 in under a millisecond | the box answers, the serving port is closed | | 000 after 90.0 s | the port is open and the request waited out curl -m 90 | | ✅ 'Paris' | the model is serving and answers correctly | The 90-second replies came from inf2 only. Its server opens port 8080 while it still loads the compiled model onto the NeuronCores, and holds requests until it is ready. g6 first passed 12.2 minutes after the launch call and inf2 20.4 minutes after it, with the checks a minute apart. g6's first answer took 1.21 seconds and the next three took 0.02 to 0.03 seconds. --- --- Step 7 — backend_logs: The Serving Log Without a Shell backend_logs runs the right log command for each backend through SSM: docker logs for the vLLM container on g6 and the Neuron container on inf2 and trn1, journalctl -u vllm.service on g5g. Until the container exists it falls back to the cloud-init log, which shows the image pull: g6 i-005ebaee08f191e7a (us-east-2) Error response from daemon: No such container: vllm --- serving log not available yet; cloud-init: ... 469e56fbf4cf: Pull complete Two minutes after g6's first health check passed, the same call returned vLLM's own log, with the health check's request in it: (APIServer pid=1) INFO: Application startup complete. (EngineCore pid=108) WARNING 10-13 02:24:34 [jit_monitor.py:141] Triton kernel JIT compilation during inference: kernel_unified_attention. This causes a latency spike; consider extending warmup to cover this shape/config. (APIServer pid=1) INFO: 172.17.0.1:34422 - "POST /v1/chat/completions HTTP/1.1" 200 OK The JIT warning matches the 1.21-second first answer. On inf2 the log showed the load in progress, then the result: HTTP listening on :8080 — /health=503 'loading' until ready; queue max=8, gen timeout 120.0s ... READY in 473.8s — serving on :8080 (SLIM host, peak RSS 14.45 GB) [req] pt=21 ct=1 5.8tok/s 0.17s finish=stop The first line explains the 90-second health check replies: the port opened before the model was ready. --- --- Step 8 — ask_backend: One Timed Request ask_backend sends one chat request through backends.chat_once and returns the text, the backend's own completion token count, and the time measured in the server. Tokens per second is that count over that time, so it includes the network and the prompt processing. Self-hosted backends are reached through the SSM port forwards stage/forward.sh opens. Before the forwards, with demo.env left over from an earlier session: ask_backend {"backend": "g6", "prompt": "hello"} ❌ URLError: <urlopen error [Errno 111] Connection refused> After stage/forward.sh rewrote demo.env, a new server process read it at start-up: {"backend": "g6", "label": "vLLM on EC2 g6 (L4)", "text": "Hello! How can I help you today? 😊", "completion_tokens": 11, "seconds": 0.14, "tokens_per_second": 78.6} {"backend": "inf2", "label": "Inferentia2 (inf2, hand-ported)", "text": "Hello! How can I help you today?", "completion_tokens": 9, "seconds": 0.423, "tokens_per_second": 21.3} ask_backend {"backend": "trn1", "prompt": "hello"} ❌ trn1 is not configured here; configured: bedrock, g6, inf2. Run stage/forward.sh. list_backends now reported ask_backend_configured: ["bedrock", "g6", "inf2"] and both instances Online in SSM. Replies this short are mostly prompt processing and network, so these rates describe one request each; the companion article has the 100-token benchmark. --- Step 9 — count_ids: Demo 1's Engine Over MCP Demo 1 asks how many of eleven ids are 10 or more. The answer is 8. count_ids takes a predicate and returns the exact count, minimum and maximum, and echoes the predicate it ran: count_ids {"op": ">=", "value": 10} -> {"where": "id >= 10", "count": 8, "min": 10, "max": 23} count_ids {"op": ">", "value": 10} -> {"where": "id > 10", "count": 7, "min": 11, "max": 23} count_ids {"op": "=>", "value": 10} -> {"error": "op must be one of ['<', '<=', '==', '>', '>=']"} The second line returns an exact, sourced 7 for a predicate the question did not ask for. The where field is in the response so the predicate can be checked along with the number. demo1_counting.py --tools mcp offers this tool to a Strands agent through the protocol. Strands' MCPClient starts the server over stdio and a tool filter exposes count_ids alone: MCPClient(lambda: stdio_client(StdioServerParameters(command=sys.executable, args=[server])), tool_filters={"allowed": ["count_ids"]}) The tool runs in the server's process, so the demo cannot record calls as they happen. It reads them back from the agent's conversation instead, and grades them with the same function the in-process run uses: def calls_from(messages: list) -> list: return [{"tool": c["toolUse"]["name"], **c["toolUse"].get("input", {})} for m in messages if m["role"] == "assistant" for c in m["content"] if "toolUse" in c] Twenty runs each on Bedrock, the in-process tool and then the MCP tool: BACKENDS=bedrock python3 demo1_counting.py --tools engine --runs 20 BACKENDS=bedrock python3 demo1_counting.py --tools mcp --runs 20 True answer: 8 tools: engine ... backend runs correct right-filter errors median s filters sent bedrock 20 20/20 20/20 0 1.07 id >= 10 True answer: 8 tools: mcp ... backend runs correct right-filter errors median s filters sent bedrock 20 20/20 20/20 0 1.07 id >= 10 Same answers, same filter, same median time. Starting the server costs once per demo run, outside the timed agent calls. --- Step 10 — teardown: Stop Everything That Bills teardown takes no arguments and starts stage/down.sh in the background. It is the one tool marked destructive. The script closes the forwards, terminates every instance tagged ManagedBy=strands-demo-run in all four regions, deletes the SageMaker endpoint when it exists, and then lists anything still running in any of the four regions. teardown {} started stage/down.sh (pid 2367066); output in stage/down.log, read it with launch_log Twenty-one seconds later, launch_log with which set to down: us-east-2: terminating i-0bf43d9b77b321ec3 i-005ebaee08f191e7a Sweep (anything listed here is still billing): (sweep done) and list_backends: "billing_now": 0, "ec2_running": 0, "sagemaker": "not found" The sweep and the inventory both read empty while the two instances were still in shutting-down, because both look only at pending, running, stopping and stopped instances. --- 🔎 Tip: Return the Error as Text the Agent Can Read Every tool catches its exceptions and returns one line that starts with ❌ and names the cause: an AWS error code and message, a ValueError for a bad backend name, a RuntimeError naming the four regions searched. backend_health {"backend": "tpu"} -> ❌ ValueError: backend must be one of bedrock, sagemaker, g6, g5g, inf2, trn1 launch_backends {"names": ["p5"]} -> ❌ unknown backend(s) ['p5']; use g6 inf2 trn1 g5g sm An agent reads the cause in the reply. The protocol-level isError flag stays false on all of them, so a client that branches on that flag treats a failed health check as a success. Set it where clients act on it. --- 🔎 Tip: Pass a Health Check on the Answer backend_health asks "What is the capital of France? Answer in one word." at temperature 0 with 16 tokens, and passes only when the reply contains "paris". A non-empty reply proves the port is open. A broken build of this model family has answered with repeated text, and that reply is non-empty too. --- 🔎 Tip: Clamp Every Number the Model Sends tail is clamped to 1 to 2000 lines and max_tokens to 1 to 1024. backend is checked against a fixed list before any AWS call, and launch_backends rejects an unknown name before stage/up.sh starts. A model that asks for a million log lines gets two thousand. --- 🔎 Tip: Run Long Jobs Detached and Hand Back a Log stage/up.sh and stage/down.sh each took under half a minute here, and the backends behind them take up to twenty minutes to serve. Both scripts run with start_new_session=True and their output in stage/up.log or stage/down.log, so the tool call returns at once and the job survives the MCP session closing. launch_log reads the log back. --- Compare and Contrast | | stage scripts | MCP server | |---|---|---| | Caller | a person at a terminal | any MCP client: Claude Code, a Strands agent | | Launch and teardown | stage/up.sh, stage/down.sh | the same scripts, detached, read back with launch_log | | Inventory | aws ec2 describe-instances per region | 🥇 one call, four regions in parallel, billing count computed | | Health | stage/check.py, needs the forwards | 🥇 on the box via SSM, no forwards | | Logs | aws ssm start-session, then docker logs | 🥇 backend_logs, cloud-init fallback | | One question | stage/ask.py, needs the forwards | ask_backend, needs the forwards | | Safety signal | the script's name | read-only, write, destructive annotations | --- So, Which One? 🥇 The MCP server to operate the demo from a chat session: inventory, health, logs and teardown in plain questions, with the billing count and the pass or fail computed in code. 🥈 The stage scripts for the talk itself and anything scripted, and for the port forwards, which ask_backend and the demos need and the server does not open. Both launch and stop the same resources, because one calls the other. --- Summary The goal of this article was to operate a six-backend AWS inference demo through MCP. The key to the solution was one server over the demo's own code, reaching instances through SSM Run Command and launching through the same scripts a person runs. The results were: - 🟢 Eight tools in one file over the demo's own code: the same chat_once and count functions the scripts call, and the same stage/up.sh and stage/down.sh. - 🟢 Every tool is marked read-only, write or destructive, and tools/list carries the marks to the client. - 🟢 Health checks and logs run on the instance through SSM Run Command, with no inbound rules and no port forwards; g6 passed 12.2 minutes after launch and inf2 20.4 minutes after. - 🟢 A launch, health checks, logs, requests and a teardown ran from one session, and list_backends read billing_now: 0 21 seconds after teardown. - 🟢 Demo 1 over MCP matched demo 1 in-process on Bedrock: 20 of 20 correct with the right filter both ways, median 1.07 seconds both ways. - ⚠️ Failed calls return a ❌ line with isError false, so a client that branches on the protocol flag treats them as successes. - ⚠️ ask_backend depends on demo.env, which outlives the forwards; it lists backends that are down until stage/forward.sh runs again. - ❌ The server opens no port forwards, so ask_backend and the demos still need stage/forward.sh from a terminal. Scope: one session on 2026-10-13 (UTC), us-east-2, two on-demand instances (g6.xlarge and inf2.xlarge) from launch to teardown, with Bedrock in us-east-1. trn1, g5g and the SageMaker endpoint were not launched, so their tools are shown only in their not-running replies. Health checks were one minute apart, so each time to ready is accurate to about a minute. Demo 1 ran 20 times per tool set on Bedrock only, with the MCP Python SDK 2.1.1, Strands Agents 1.55.0 and Python 3.14.7 on a laptop. The strategy for using MCP to operate Gemma 4 inference backends across AWS was validated with an incremental step by step approach. --- References - aws-inference-strands | GitHub - Gemma 4 Inference on AWS: Bedrock, SageMaker, GPUs, Inferentia and Trainium Behind One Strands Agent | DEV - Model Context Protocol specification, tools | modelcontextprotocol.io - MCP Python SDK | GitHub - Strands Agents, MCP tools | strandsagents.com - AWS Systems Manager Run Command | AWS

    2 reactions

Latest stargazers

The last 10 distinct accounts we observed this year.

Most active participants

PR, issue, comment & review events in the past year.

Packages

17
PackageVersionDownloads · 30dTrend · 30d
mcpv2.3.0
v2.3.0
≥253.2M
———
———
———
———
———
———
———
———
———
———
———
———
———
———
———
mcp-typesv2.3.0
v2.3.0
≥96M

README badges

Embed a badge in your README or website.

Live mentions · last 30 days
modelcontextprotocol/python-sdk mentions in the last 30 days