{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: Daniel Ainoko","description":"The latest articles on DEV Community by Daniel Ainoko (@thecodedaniel).","link":"https:\/\/dev.to\/thecodedaniel","image":{"url":"https:\/\/media2.dev.to\/dynamic\/image\/width=90,height=90,fit=cover,gravity=auto,format=auto\/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3766907%2F8c99f7d1-c627-45b4-ac4f-b3ae4a3301a9.jpg","title":"DEV Community: Daniel Ainoko","link":"https:\/\/dev.to\/thecodedaniel"},"language":"en","item":[{"title":"I Taught a Security Camera to Say \"I Don't Know\" \u2014 and It Got More Useful, Not Less","pubDate":"Mon, 20 Jul 2026 20:05:37 +0000","link":"https:\/\/dev.to\/thecodedaniel\/i-taught-a-security-camera-to-say-i-dont-know-and-it-got-more-useful-not-less-1d87","guid":"https:\/\/dev.to\/thecodedaniel\/i-taught-a-security-camera-to-say-i-dont-know-and-it-got-more-useful-not-less-1d87","description":"<p>Somewhere around day four of building a doorbell-camera AI for a hackathon,<br>\nI caught my own system lying to me. Not maliciously \u2014 it was just guessing,<br>\nthe way all of us do when we don't want to say \"I don't know\" out loud. The<br>\nfix for that turned out to be more interesting than anything else in the<br>\nbuild, so this post is mostly about that, with some genuinely funny\/painful<br>\nbug stories along the way.<\/p>\n\n<h2>\n  \n  \n  The problem nobody built a camera to solve\n<\/h2>\n\n<p>Every doorbell camera on the market answers one question: <em>was there<br>\nmotion?<\/em> That's the wrong question. The right question \u2014 the one a human<br>\nactually wants answered at 11pm when their phone buzzes \u2014 is <em>should I<br>\ncare about this?<\/em> Cameras don't answer that, so people train themselves to<br>\nswipe the notification away without looking. The alert becomes noise. The<br>\none time it isn't noise, you've already stopped paying attention.<\/p>\n\n<p>So the project \u2014 I called it <strong>Kenbunshoku<\/strong> (\u898b\u805e\u8272, roughly \"the art of<br>\nperceiving,\" a term from certain martial traditions for reading a<br>\nsituation before it becomes obvious) \u2014 tries to add one missing layer:<br>\n<em>context<\/em>. Not \"something moved.\" Something closer to \"a person in a<br>\ndelivery uniform is standing at your door with a package,\" or \"someone is<br>\nlingering by the entrance at an unusual hour without a clear reason to be<br>\nthere.\"<\/p>\n\n<p>The architecture, in one breath: a local YOLOv8n detector watches a camera<br>\nstream and only forwards frames that actually contain a person. Those<br>\nframes go to a cloud backend that calls Qwen-VL (Alibaba Cloud's<br>\nvision-language model) to reason about what's actually happening in the<br>\nimage. A lightweight memory layer checks whether this is a recurring<br>\npattern. A push notification goes to the homeowner's phone with the<br>\nreasoning attached, in plain language. That's the whole system. No part of<br>\nit ever acts on your behalf \u2014 no locks, no alarms, no calls to anyone. It<br>\ntells you things. You decide.<\/p>\n\n<p>That last sentence is doing more work than it looks like, and I'll come<br>\nback to it.<\/p>\n\n<p>Here it is actually running, filmed on my phone with zero production<br>\nvalues whatsoever \u2014 a real detection, a real Qwen-VL classification, a<br>\nreal push notification landing on a real device:<\/p>\n\n<p><a href=\"https:\/\/youtu.be\/6j4ZZhUeahY\" rel=\"noopener noreferrer\">https:\/\/youtu.be\/6j4ZZhUeahY<\/a><\/p>\n\n<p>(Judge the system, not the cinematography.)<\/p>\n\n<h2>\n  \n  \n  The lie I caught it telling\n<\/h2>\n\n<p>Early on, the classification prompt just asked Qwen-VL to look at a frame<br>\nand decide: is this person \"familiar,\" \"delivery-like,\" or \"anomalous\"? I<br>\ntested it against a deliberately ugly, blurry, low-detail image \u2014 barely a<br>\nsilhouette \u2014 expecting either a refusal or an honest \"unclear.\" Instead I<br>\ngot:<\/p>\n\n<blockquote>\n<p>\"familiar\" \u2014 <em>\"...suggesting they are a known individual.\"<\/em><\/p>\n<\/blockquote>\n\n<p>Read that again. The model had no reference photo of anyone who lives at<br>\nthis house. It had never seen this \"known individual\" before in its<br>\nexistence. It could not possibly know that. And yet it produced a<br>\nconfident, specific, entirely fabricated claim of recognition \u2014 because I<br>\nhad asked it a question shaped like an identity question, and it answered<br>\nin kind, filling the gap with plausible-sounding language instead of<br>\nadmitting the gap existed.<\/p>\n\n<p>This is, if you squint, the exact same failure mode as a person who<br>\ndoesn't want to look uninformed in a meeting. The information isn't<br>\nthere, but the <em>shape of a confident answer<\/em> is easy to produce, and<br>\nconfident-shaped answers get rewarded more often than \"I don't know\"<br>\nones \u2014 right up until the moment they're wrong in a way that matters.<\/p>\n\n<p>The fix wasn't a bigger model or a longer prompt lecture. It was<br>\nredefining what \"familiar\" was even allowed to mean:<\/p>\n\n<blockquote>\n<p>\"familiar\" means the visit <em>presents as<\/em> expected and low-concern \u2014<br>\ncalm demeanor, ordinary daytime approach, no unusual items \u2014 not that<br>\nyou recognize the person's identity. You have no reference photos.<\/p>\n<\/blockquote>\n\n<p>And one more line that did almost all of the actual work:<\/p>\n\n<blockquote>\n<p>If the visual evidence doesn't clearly support \"familiar\" or<br>\n\"delivery-like,\" choose \"anomalous\" rather than guessing.<\/p>\n<\/blockquote>\n\n<p>Same blurry test image, same model, new prompt:<\/p>\n\n<blockquote>\n<p>\"anomalous\" \u2014 <em>\"The image is too blurry to determine any clear<br>\nbehavior, carried items, or context, making it impossible to classify<br>\nas familiar or delivery-like.\"<\/em><\/p>\n<\/blockquote>\n\n<p>That's not a worse answer. It's a <em>categorically more honest<\/em> one. The<br>\nmodel went from confabulating a memory it didn't have to correctly<br>\nreporting the limits of what it could see. For a home security system,<br>\n\"I'm not sure, so I'm erring cautious\" is strictly better than a<br>\nconfident wrong guess in either direction \u2014 and it only took giving the<br>\nmodel permission to say so.<\/p>\n\n<h2>\n  \n  \n  Refusing to build the \"creepier, more expensive\" version\n<\/h2>\n\n<p>The natural next question, if you're chasing \"familiar\" as identity<br>\nrecognition, is: why not just do real face matching? Store embeddings,<br>\ncompare against known visitors, get an actual identity-confidence score<br>\nback.<\/p>\n\n<p>I sat with that question for a while and landed on: no, deliberately,<br>\npermanently, not out of laziness but out of principle.<\/p>\n\n<p>Here's the reasoning. A system that stores biometric-adjacent data about<br>\neveryone who walks up to your door is a fundamentally different kind of<br>\nobject than one that doesn't \u2014 different risk if it leaks, different<br>\nethical weight, different relationship to the people it observes (some of<br>\nwhom never consented to being in <em>anyone's<\/em> facial recognition database,<br>\nlet alone a hackathon project's). And critically: it wasn't necessary. The<br>\nactual product need \u2014 \"don't wake me up for the same delivery guy every<br>\nTuesday\" \u2014 is fully satisfied by a much cheaper, much more honest<br>\nmechanism: pattern-matching on <em>visits<\/em>, not identity.<\/p>\n\n<p>The memory layer just asks: has this camera seen a similar classification,<br>\non the same day of week, at a similar time, repeatedly, in the last two<br>\nweeks? If yes, that's a \"recognized pattern\" \u2014 still logged, but the push<br>\nnotification gets quietly suppressed instead of buzzing your phone for the<br>\nfifth Tuesday in a row. If a genuinely unrecognized, anomalous visit<br>\nhappens even in a pattern-matched slot, it still gets through \u2014 the system<br>\nnever goes quiet on \"anomalous,\" patterned or not.<\/p>\n\n<p>This costs nothing extra. No embeddings, no vector database, no additional<br>\nmodel calls, no image storage beyond what's needed for the one live<br>\nclassification. It's just a SQLite table and a modest SQL query. And it<br>\nnever claims to know something it doesn't. \"This time slot has a routine\"<br>\nis a true, verifiable, honest claim. \"I recognize this specific human<br>\nbeing\" is not a claim this system is entitled to make, so I made sure it<br>\nnever could.<\/p>\n\n<p>Cheap and honest turned out to be the same design decision twice.<\/p>\n\n<h2>\n  \n  \n  Restraint as the actual feature\n<\/h2>\n\n<p>The system never takes autonomous action. Not \"rarely\" \u2014 never, as a hard<br>\nrule I refused to relax even when it would have been a more impressive<br>\ndemo. No auto-locking doors on \"anomalous,\" no auto-calls to anyone, no<br>\ncontrol signal of any kind, ever. Just a notification with reasoning<br>\nattached, to a human, who decides.<\/p>\n\n<p>It would be easy to read that as a limitation \u2014 \"the AI could do more but<br>\nwe held it back.\" I'd argue the opposite: the restraint <em>is<\/em> the design.<br>\nA system that watches your front door and occasionally gets it wrong (all<br>\nof them do) is tolerable precisely because the cost of being wrong is \"a<br>\nslightly annoying notification,\" not \"the system did something to a real<br>\ndoor because a vision model was 73% confident.\" Keeping a human in the<br>\nloop isn't a feature you bolt on later. It's the thing that makes<br>\neverything upstream of it \u2014 including the confident-sounding mistakes \u2014<br>\nsurvivable.<\/p>\n\n<h2>\n  \n  \n  The bugs that only existed once I stopped trusting the diff\n<\/h2>\n\n<p>Every single one of these passed a code review. All of them looked fine on<br>\nthe page. None of them were fine.<\/p>\n\n<ul>\n<li>\n<strong>An em dash crashed a push notification.<\/strong> The alert title used a\nplain em dash for style. HTTP header values have to be ASCII\/latin-1.\nThe request didn't fail loudly in a way that pointed at the cause \u2014 it\njust threw a <code>UnicodeEncodeError<\/code> deep inside a networking library, the\nfirst time a real alert actually tried to fire. Nothing about the code\n<em>looked<\/em> wrong.<\/li>\n<li>\n<strong>A mobile OS silently ate all outbound network traffic.<\/strong> The\nnotification client connected to nothing, showed no error, gave no\nsignal that anything was wrong \u2014 because macOS's App Sandbox was\nquietly blocking every request at the entitlement level, before it ever\nreached a socket. Android had the mirror-image problem: no <code>INTERNET<\/code>\npermission declared, same silent nothing. Static analysis had nothing\nto say about either one. Only running the actual app on actual hardware\nsurfaced them.<\/li>\n<li>\n<strong>The camera loop got stuck reprocessing the past.<\/strong> Point the camera\nat your hand, then a pen, then your face \u2014 and the system kept\nreporting the pen. Not broken, exactly: <code>cv2.VideoCapture<\/code> buffers\nincoming frames faster than a multi-second classification round-trip\ncan drain them, so the loop was dutifully working through a growing\nbacklog of <em>old<\/em> frames while the live scene moved on without it. The\nfix was a background thread that keeps only the newest frame and lets\neverything older get silently, deliberately discarded \u2014 the standard\nanswer to this exact class of problem, but only obvious once you've\nwatched it happen with your own hand in front of your own camera.<\/li>\n<li>\n<strong>The system got slower the more careful it became.<\/strong> A single request\nwas quietly doing two sequential network calls before responding \u2014 one\nto the vision model, one to the push service \u2014 with no timeout set on\neither. Most of the time it was fine. Occasionally, both hops had a\nslow moment at once, blew past the timeout budget, and the system fell\nback to a generic \"cloud unreachable\" alert instead of the real\nclassification it had actually computed a few seconds too late.<\/li>\n<\/ul>\n\n<p>None of these are exotic. Every one of them is a well-known category of<br>\nbug with a well-known fix. What they have in common is that <em>reading the<br>\ncode gave no signal anything was wrong.<\/em> The only way to find any of them<br>\nwas to run the actual thing, on actual hardware, against an actual<br>\nnetwork, and watch it fail in front of me.<\/p>\n\n<h2>\n  \n  \n  The recursive part\n<\/h2>\n\n<p>I built this with an AI pair programmer doing most of the typing. There's<br>\nan irony there I didn't fully appreciate until I was three days in:<br>\nI spent this entire project teaching one AI system to stop confidently<br>\nguessing and start admitting uncertainty \u2014 while collaborating, in real<br>\ntime, with a <em>different<\/em> AI system whose suggestions also needed<br>\nconstant grounding against reality rather than being trusted on the<br>\nstrength of how plausible they sounded. Code that compiles is not code<br>\nthat works. A plan that reads well is not a plan that survives contact<br>\nwith a real phone, a real Alibaba Cloud console, a real curl command<br>\nagainst a real server.<\/p>\n\n<p>The throughline for the whole build, human-authored parts and<br>\nAI-authored parts alike, ended up being the same single sentence: <em>verify<br>\nagainst reality, not against your own confidence.<\/em> That sentence is the<br>\nentire fix for the \"familiar\" hallucination. It's the entire fix for<br>\nevery bug in the list above. It's also, probably, decent advice for<br>\nanyone shipping anything, with or without a vision model attached.<\/p>\n\n\n\n\n<p><em>Kenbunshoku was built for the Global AI Hackathon Series with Qwen<br>\nCloud, running on Alibaba Cloud ECS with Qwen-VL for visitor reasoning.<br>\nCamera-agnostic by design, human-in-the-loop by principle, and \u2014 as of<br>\nthis week \u2014 a little more honest about what it doesn't know.<\/em><\/p>\n\n","category":["webdev","ai","computervision","buildinpublic"]},{"title":"Gemma-San \u2014 A Teacher in Every Pocket.","pubDate":"Tue, 19 May 2026 19:33:57 +0000","link":"https:\/\/dev.to\/thecodedaniel\/gemma-san-a-teacher-in-every-pocket-16g6","guid":"https:\/\/dev.to\/thecodedaniel\/gemma-san-a-teacher-in-every-pocket-16g6","description":"<p><em>This is a submission for the <a href=\"https:\/\/dev.to\/challenges\/google-gemma-2026-05-06\">Gemma 4 Challenge: Build with Gemma 4<\/a><\/em><\/p>\n\n<h2>\n  \n  \n  What I Built\n<\/h2>\n\n<p><strong>Gemma-San<\/strong> is an offline AI tutor for children aged 5\u201312, built for Nigerian kids first but speaking whatever language the child speaks. It runs Google's <a href=\"https:\/\/huggingface.co\/litert-community\/gemma-4-E2B-it-litert-lm\" rel=\"noopener noreferrer\">Gemma 4 E2B<\/a> model fully on-device on a sub-$200 Android phone \u2014 no cloud, no data plan after the one-time setup.<\/p>\n\n<p>A child taps the mic, talks (English, Pidgin, Yoruba, Hausa, Igbo \u2014 even Japanese), and Gemma-San responds with voice, illustrations, and patience. It knows when to ask a Socratic question and when to just explain. It remembers the child across sessions. It quizzes them on past lessons. It draws simple SVG diagrams when the topic isn't already in its illustration library.<\/p>\n\n<p>Built with <a href=\"https:\/\/flutter.dev\/\" rel=\"noopener noreferrer\">Flutter<\/a> + <a href=\"https:\/\/pub.dev\/packages\/flutter_gemma\" rel=\"noopener noreferrer\"><code>flutter_gemma 0.15.1<\/code><\/a> + <a href=\"https:\/\/github.com\/ggerganov\/whisper.cpp\" rel=\"noopener noreferrer\">Whisper.cpp<\/a> + <a href=\"https:\/\/pub.dev\/packages\/sqflite\" rel=\"noopener noreferrer\">sqflite<\/a>. Targets 4\u20136 GB RAM Android phones like the Tecno Spark 10 and Infinix Hot 30 \u2014 the phones African kids actually share with their families.<\/p>\n\n<p>The problem it solves: millions of kids in low-bandwidth regions have brilliant questions and no one to ask. Cloud tutors fail when the network does. Gemma-San lives inside the phone.<\/p>\n\n<p>Core features:<\/p>\n\n<ul>\n<li>Voice in (Whisper tiny on-device) \u2192 Gemma 4 \u2192 voice out (Android TTS)<\/li>\n<li>Six native function-calling tools: <code>socratic_teach<\/code>, <code>direct_teach<\/code>, <code>encourage<\/code>, <code>remember<\/code>, <code>try_drawing<\/code>, <code>show_illustration<\/code>\n<\/li>\n<li>22 hand-built SVG illustrations + an on-the-fly SVG drawing fallback<\/li>\n<li>Five-question quizzes and phonics practice with a spaced-repetition scheduler<\/li>\n<li>A three-tier memory system (working window + cross-session compaction + long-term facts) so the tutor knows the child<\/li>\n<li>Multilingual mirroring \u2014 the model replies in whatever language the child used, never imposes one<\/li>\n<\/ul>\n\n<h2>\n  \n  \n  Demo\n<\/h2>\n\n<p>  <iframe src=\"https:\/\/www.youtube.com\/embed\/FD7dJ33XGXc\">\n  <\/iframe>\n<\/p>\n\n<h2>\n  \n  \n  Code\n<\/h2>\n\n\n<div class=\"ltag-github-readme-tag\">\n  <div class=\"readme-overview\">\n    <h2>\n      <img src=\"https:\/\/assets.dev.to\/assets\/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg\" alt=\"GitHub logo\">\n      <a href=\"https:\/\/github.com\/TheCodeDaniel\" rel=\"noopener noreferrer\">\n        TheCodeDaniel\n      <\/a> \/ <a href=\"https:\/\/github.com\/TheCodeDaniel\/gemma_san\" rel=\"noopener noreferrer\">\n        gemma_san\n      <\/a>\n    <\/h2>\n    <h3>\n      \n    <\/h3>\n  <\/div>\n  <div class=\"ltag-github-body\">\n    \n<div id=\"readme\" class=\"md\"><div class=\"markdown-heading\">\n<h1 class=\"heading-element\">Gemma-San<\/h1>\n<\/div>\n<blockquote>\n<p>Offline AI tutor for Nigerian children, powered by Gemma 4 on-device.<\/p>\n<\/blockquote>\n<p>Hackathon submission \u2014 deadline May 18, 2026.<\/p>\n\n<div class=\"markdown-heading\">\n<h2 class=\"heading-element\">What It Is<\/h2>\n<\/div>\n<p>Gemma-San is a native Android app that acts as a patient, voice-first tutor for Nigerian children aged 5\u201312. It runs Google's Gemma 4 E2B model entirely on-device using flutter_gemma, so it works in classrooms with no internet after the initial model download. The tutor speaks in Nigerian Pidgin or English, uses the phone camera to annotate physical objects, and adapts to each child via a local memory system.<\/p>\n\n<div class=\"markdown-heading\">\n<h2 class=\"heading-element\">Why<\/h2>\n<\/div>\n<p>Millions of Nigerian children lack access to quality, personalized tutoring. Gemma-San brings Socratic and direct-teach pedagogy to a $100 Android phone, offline, in the child's own language.<\/p>\n\n<div class=\"markdown-heading\">\n<h2 class=\"heading-element\">Architecture<\/h2>\n\n<\/div>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\">\n<pre class=\"notranslate\"><code>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502                Flutter UI                   \u2502\n\u2502  (Riverpod state, feature-first widgets)    \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                     \u2502\n        \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n        \u2502     Domain \/ Use Cases  \u2502\n        \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                     \u2502\n   \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n   \u2502                 \u2502                  \u2502\n\u250c\u2500\u2500\u25bc\u2500\u2500\u2510         \u250c\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2510       \u250c\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2510\n\u2502sqflite\u2502       \u2502flutter_<\/code><\/pre>\u2026<\/div><\/div>\n  <\/div>\n  <div class=\"gh-btn-container\"><a class=\"gh-btn\" href=\"https:\/\/github.com\/TheCodeDaniel\/gemma_san\" rel=\"noopener noreferrer\">View on GitHub<\/a><\/div>\n<\/div>\n\n\n<h2>\n  \n  \n  How I Used Gemma 4\n<\/h2>\n\n<p><strong>Model: Gemma 4 E2B<\/strong> (<a href=\"https:\/\/huggingface.co\/litert-community\/gemma-4-E2B-it-litert-lm\" rel=\"noopener noreferrer\"><code>litert-community\/gemma-4-E2B-it.litertlm<\/code><\/a>).<\/p>\n\n<p><strong>Why E2B and not E4B or 31B Dense:<\/strong> E4B added roughly 1.5 GB to disk and tripped the OOM killer on my 8 GB target device once Whisper.cpp loaded alongside it. 31B Dense was never an option \u2014 these are phones, not workstations. E2B's 2-billion effective parameters fits in about 2.4 GB on disk, runs at ~25\u201335 tok\/s on the GPU backend via <a href=\"https:\/\/github.com\/google-ai-edge\/LiteRT-LM\" rel=\"noopener noreferrer\">LiteRT-LM<\/a>, and leaves headroom for STT\/TTS\/UI. The quality-vs-fit tradeoff was the entire bet.<\/p>\n\n<h3>\n  \n  \n  Native function calling \u2014 six tools, no plain text\n<\/h3>\n\n<p>Every model reply is a function call. There is no free-text path. The system prompt has a <a href=\"https:\/\/www.khanmigo.ai\/\" rel=\"noopener noreferrer\">Khanmigo<\/a>-style decision tree the model walks top-down on every turn (visual request \u2192 illustration if exact match else SVG \u2192 direct fact \u2192 Socratic ladder \u2192 escalate after 2 IDKs). Side effect: the UI gets a structured <code>TutorResponse<\/code> with a <code>mode<\/code> field, so I render a different colored mode pill for each teaching style.<\/p>\n\n<h3>\n  \n  \n  Selective thinking mode (the biggest discovery)\n<\/h3>\n\n<p>Gemma 4 supports thinking traces via <code>enableThinking: true<\/code>. I assumed \"more thinking = better answers\" and switched it on everywhere. That backfired.<\/p>\n\n<p><strong>Where thinking helps:<\/strong> routing across 6 tools. Without it (and with default <code>topK=1<\/code>), once Gemma's first JSON token commits, it can't recover.<\/p>\n\n<p><strong>Where thinking hurts:<\/strong> structured-output composition. My lesson-summary path enabled thinking and the model started spending its whole token budget on <code>&lt;|channel&gt;thought|&gt;<\/code> traces, never reaching the actual <code>lesson_summary<\/code> function call. Raw thinking JSON leaked into the cached summary and rendered to kids as <code>{\"role\":\"assistant\",\"channels\":{\"thought\":\"Thinking\"}}...<\/code>. Beautiful.<\/p>\n\n<p>I now apply thinking per-path:<\/p>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Path<\/th>\n<th>Thinking<\/th>\n<th>Reason<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<code>generate()<\/code> chat<\/td>\n<td>ON<\/td>\n<td>6-tool routing benefits from reasoning<\/td>\n<\/tr>\n<tr>\n<td><code>generateWithImage()<\/code><\/td>\n<td>ON<\/td>\n<td>Vision + routing<\/td>\n<\/tr>\n<tr>\n<td><code>generateLessonSummary()<\/code><\/td>\n<td>OFF<\/td>\n<td>Single tool, pure composition<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n<p>And I always pass explicit sampling \u2014 the defaults are a trap for small models:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight dart\"><code><span class=\"kd\">final<\/span> <span class=\"n\">session<\/span> <span class=\"o\">=<\/span> <span class=\"k\">await<\/span> <span class=\"n\">model<\/span><span class=\"o\">.<\/span><span class=\"na\">createSession<\/span><span class=\"p\">(<\/span>\n  <span class=\"nl\">tools:<\/span> <span class=\"n\">tools<\/span><span class=\"p\">,<\/span>\n  <span class=\"nl\">systemInstruction:<\/span> <span class=\"n\">sysPrompt<\/span><span class=\"p\">,<\/span>\n  <span class=\"nl\">enableThinking:<\/span> <span class=\"kc\">true<\/span><span class=\"p\">,<\/span>\n  <span class=\"nl\">temperature:<\/span> <span class=\"mf\">0.4<\/span><span class=\"p\">,<\/span> <span class=\"c1\">\/\/ not 0.8 default \u2014 too noisy for tool selection<\/span>\n  <span class=\"nl\">topK:<\/span> <span class=\"mi\">40<\/span><span class=\"p\">,<\/span>         <span class=\"c1\">\/\/ not 1 default \u2014 pure greedy locks in wrong tools<\/span>\n  <span class=\"nl\">topP:<\/span> <span class=\"mf\">0.9<\/span><span class=\"p\">,<\/span>\n  <span class=\"nl\">randomSeed:<\/span> <span class=\"mi\">1<\/span><span class=\"p\">,<\/span>\n<span class=\"p\">);<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h3>\n  \n  \n  Compressing the prompt for a 2B model\n<\/h3>\n\n<p>My first system prompt was 1,450 tokens \u2014 a beautifully written teaching ladder. Gemma E2B's attention horizon couldn't hold it together with 6 tool schemas and conversation history. It misrouted, hallucinated tool names, and sometimes emitted plain text.<\/p>\n\n<p>Rewriting it as a flat ~440-token decision tree with two worked examples (one Socratic, one direct-teach with the child speaking Pidgin and the model mirroring it back) took tool-call accuracy from \"frustrating\" to \"actually usable.\"<\/p>\n\n<h3>\n  \n  \n  Multilingual mirroring\n<\/h3>\n\n<p>Hard rule in the prompt: <strong>whatever language the child uses, the model uses back.<\/strong> English in, English out. Pidgin in, Pidgin out. Yoruba, Hausa, Igbo, Japanese \u2014 match it. The <code>language_code<\/code> <a href=\"https:\/\/www.rfc-editor.org\/info\/bcp47\" rel=\"noopener noreferrer\">BCP-47<\/a> field on every tool call propagates to Android TTS so the voice matches too (Google TTS preferred when installed; en-NG &gt; en-GB &gt; en-US fallback).<\/p>\n\n<h3>\n  \n  \n  Recovery loop, never an error\n<\/h3>\n\n<p>When parsing fails (rare, but real on a 2B model), Gemma-San retries once with a nudge appended \u2014 <code>\"Respond by calling exactly ONE function. No plain text.\"<\/code> \u2014 and falls back to a graceful <code>direct_teach<\/code> if the retry also fails. The child never sees an error message.<\/p>\n\n<h2>\n  \n  \n  Lessons Learned\n<\/h2>\n\n<ol>\n<li><p><strong>Thinking mode is a knife, not a hammer.<\/strong> ON for routing. OFF for composition. Mixing them in the same session causes JSON leaks and budget exhaustion.<\/p><\/li>\n<li><p><strong><code>topK=1<\/code> + thinking is the worst sampling combo on a small model.<\/strong> Pure greedy decoding can't recover from a bad first token even when the thinking trace has already considered alternatives. Bump <code>topK<\/code> to ~40 and <code>temperature<\/code> to ~0.4 for tool calling.<\/p><\/li>\n<li><p><strong>Compress your prompt brutally.<\/strong> A 2B model with 6 tool schemas + working memory + a 1,400-token system prompt has nothing left for attention. A flat Khanmigo-style decision tree with one or two worked examples beats verbose pedagogy every time.<\/p><\/li>\n<li><p><strong>Validate, don't reject.<\/strong> My SVG validator auto-fixes the model's malformed <code>viewBox<\/code>, injects missing <code>fill<\/code> attributes, and only rejects what truly can't render. Treat the model as a fragile partner, not a black box.<\/p><\/li>\n<li><p><strong>Mirror, don't impose.<\/strong> Telling the model \"respond in Pidgin\" forced bad output when kids spoke English. Telling it \"mirror the child's language\" produced fluent code-switching across five Nigerian languages out of the box.<\/p><\/li>\n<\/ol>\n\n<p>Built for the <a href=\"https:\/\/dev.to\/challenges\/google-gemma-2026-05-06\">Gemma 4 Challenge<\/a>. Feedback welcome \u2014 especially from anyone shipping on-device LLMs for low-resource contexts.<\/p>\n\n","category":["devchallenge","gemmachallenge","gemma"]},{"title":"From Notion Page to Figma Screens in Seconds","pubDate":"Sat, 28 Mar 2026 19:29:38 +0000","link":"https:\/\/dev.to\/thecodedaniel\/from-notion-page-to-figma-screens-in-seconds-1g59","guid":"https:\/\/dev.to\/thecodedaniel\/from-notion-page-to-figma-screens-in-seconds-1g59","description":"<h1>\n  \n  \n  I Turned Notion Into a UI Design Tool \u2014 Claude Reads Your Page and Draws the Screens in Figma\n<\/h1>\n\n<p><em>This is a submission for the <a href=\"https:\/\/dev.to\/challenges\/notion-2026-03-04\">Notion MCP Challenge<\/a><\/em><\/p>\n\n\n\n\n<h2>\n  \n  \n  What I Built\n<\/h2>\n\n<p><strong>NotionCanvas MCP<\/strong> \u2014 a Model Context Protocol server that creates a live pipeline from your Notion workspace directly into Figma.<\/p>\n\n<p>You write your app idea, feature spec, or product requirements in Notion \u2014 the way you normally would. Then you tell Claude:<\/p>\n\n<blockquote>\n<p><em>\"Read my Notion page and generate a mobile UI design in Figma\"<\/em><\/p>\n<\/blockquote>\n\n<p>And it does. Fully. Screens appear in Figma.<\/p>\n\n<p>No Figma experience required. No prompt engineering. No copy-pasting. No manually describing your idea to an AI. Your Notion page <strong>is<\/strong> the brief \u2014 and NotionCanvas turns it into a real, editable UI in seconds.<\/p>\n\n\n\n\n<h3>\n  \n  \n  The Problem It Solves\n<\/h3>\n\n<p>Every product builder knows this moment: you have a clear idea written up in Notion \u2014 user flows, feature descriptions, screen names, content \u2014 and then you spend the next hour either:<\/p>\n\n<ul>\n<li>Trying to describe that same idea to an AI image generator with mixed results<\/li>\n<li>Opening Figma and building frames manually from scratch<\/li>\n<li>Hiring a designer and waiting days for a first draft<\/li>\n<\/ul>\n\n<p>The idea is already written. Why describe it again?<\/p>\n\n<p>NotionCanvas closes that gap entirely. Your Notion page is the single source of truth \u2014 and Claude bridges it to Figma automatically.<\/p>\n\n\n\n\n<h3>\n  \n  \n  How It Works\n<\/h3>\n\n<p>The system has three parts working together:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>Your Notion Page\n      \u2502\n      \u25bc\n  notioncanvas-mcp  (Node.js MCP Server)\n      \u2502\n      \u251c\u2500\u2500 Notion API  \u2192  reads your page content\n      \u251c\u2500\u2500 Claude API  \u2192  interprets it, generates a Design IR (structured JSON)\n      \u2514\u2500\u2500 WebSocket   \u2192  sends commands to the Figma Bridge Plugin\n                                  \u2502\n                           Figma Desktop\n                      (NotionCanvas Bridge Plugin)\n                          draws frames on canvas\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p><strong>Step 1 \u2014 Notion Reader<\/strong>: Reads your page recursively \u2014 headings, paragraphs, lists, callouts, properties \u2014 and builds a clean structured content object.<\/p>\n\n<p><strong>Step 2 \u2014 Claude Interpreter<\/strong>: Claude receives the Notion content + your design preferences (mobile\/web, theme, color, design system) and outputs a <strong>Design Intermediate Representation (DIR)<\/strong> \u2014 a validated JSON schema describing every screen, every component, every coordinate, every color.<\/p>\n\n<p><strong>Step 3 \u2014 DIR Validator<\/strong>: Zod validates every component before anything touches Figma. Malformed AI output never reaches the canvas. Claude gets up to 2 automatic retries with targeted error feedback.<\/p>\n\n<p><strong>Step 4 \u2014 Figma Writer<\/strong>: The MCP server sends each screen to the Figma Bridge Plugin over a local WebSocket. The plugin executes Figma Plugin API calls \u2014 <code>createFrame()<\/code>, <code>createText()<\/code>, <code>createRectangle()<\/code> \u2014 and your screens appear live on the canvas.<\/p>\n\n\n\n\n<h3>\n  \n  \n  What It Can Generate\n<\/h3>\n\n<p>From a single Notion page, NotionCanvas produces:<\/p>\n\n<ul>\n<li>Full mobile screens (390\u00d7844) or web layouts (1440\u00d7900)<\/li>\n<li>Text components with font weight, size, alignment<\/li>\n<li>Input fields with placeholder text<\/li>\n<li>Buttons with variants (primary, secondary, ghost, destructive)<\/li>\n<li>Frames with Auto Layout support (vertical\/horizontal, padding, spacing)<\/li>\n<li>Rectangles with stroke, fill, corner radius<\/li>\n<li>Every component positioned absolutely with proper coordinates<\/li>\n<li>Background colors derived from your brand description<\/li>\n<\/ul>\n\n<p>All components land in Figma as <strong>native, editable nodes<\/strong> \u2014 not images, not embeds. You can grab any element and keep designing from there.<\/p>\n\n\n\n\n<h3>\n  \n  \n  The 6 MCP Tools\n<\/h3>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What it does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>generate_ui_design<\/code><\/td>\n<td>Full pipeline: reads your Notion page \u2192 Claude \u2192 Figma screens<\/td>\n<\/tr>\n<tr>\n<td><code>generate_screen<\/code><\/td>\n<td>Single screen from a plain-text description (no Notion needed)<\/td>\n<\/tr>\n<tr>\n<td><code>notion_read_page<\/code><\/td>\n<td>Read and return structured content of any Notion page<\/td>\n<\/tr>\n<tr>\n<td><code>notion_read_db<\/code><\/td>\n<td>Query a Notion database and return all entries<\/td>\n<\/tr>\n<tr>\n<td><code>list_figma_frames<\/code><\/td>\n<td>List all existing frames in a Figma file<\/td>\n<\/tr>\n<tr>\n<td><code>get_design_status<\/code><\/td>\n<td>Check if the Figma Bridge Plugin is connected and ready<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n\n\n\n<h3>\n  \n  \n  Real Example\n<\/h3>\n\n<p>I wrote this in Notion:<\/p>\n\n<blockquote>\n<p><em>\"I want a simple ride hailing application. Main color theme is red. Use Inter font.\"<\/em><\/p>\n<\/blockquote>\n\n<p>That's it. Two sentences.<\/p>\n\n<p>NotionCanvas read that page, sent it to Claude, generated a full DesignIR with an onboarding screen, a home screen with a map layout, a booking screen with input fields and a confirm button \u2014 and sent all of it to Figma as native frames.<\/p>\n\n<p>The whole pipeline ran in under 90 seconds.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Video Demo\n<\/h2>\n\n<p>  <iframe src=\"https:\/\/www.youtube.com\/embed\/6NajsdxjQXo\">\n  <\/iframe>\n<\/p>\n\n<p><a href=\"https:\/\/youtu.be\/6NajsdxjQXo\" rel=\"noopener noreferrer\">Watch on YouTube<\/a><\/p>\n\n\n\n\n<h2>\n  \n  \n  Show us the code\n<\/h2>\n\n<p><strong>GitHub:<\/strong> <a href=\"https:\/\/github.com\/TheCodeDaniel\/notion_canvas\" rel=\"noopener noreferrer\">github.com\/TheCodeDaniel\/notion_canvas<\/a><\/p>\n\n<h3>\n  \n  \n  Project structure\n<\/h3>\n\n\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>notioncanvas-mcp\/\n\u251c\u2500\u2500 src\/\n\u2502   \u251c\u2500\u2500 index.ts                    \u2190 MCP server entry point (stdio transport)\n\u2502   \u251c\u2500\u2500 clients\/\n\u2502   \u2502   \u251c\u2500\u2500 notion.ts               \u2190 Notion API + p-queue rate limiter (2.8 req\/s)\n\u2502   \u2502   \u251c\u2500\u2500 claude.ts               \u2190 Claude API + JSON retry logic (3 attempts)\n\u2502   \u2502   \u251c\u2500\u2500 figma-ws.ts             \u2190 WebSocket bridge server (localhost:9223)\n\u2502   \u2502   \u2514\u2500\u2500 figma-rest.ts           \u2190 Figma REST API (read-only frame listing)\n\u2502   \u251c\u2500\u2500 interpreter\/\n\u2502   \u2502   \u251c\u2500\u2500 schema.ts               \u2190 Zod DesignIR schema (5 component types)\n\u2502   \u2502   \u2514\u2500\u2500 prompt.ts               \u2190 Claude system\/user prompt builders\n\u2502   \u251c\u2500\u2500 tools\/                      \u2190 6 MCP tools\n\u2502   \u251c\u2500\u2500 types\/                      \u2190 TypeScript interfaces\n\u2502   \u2514\u2500\u2500 utils\/                      \u2190 logger, retry, PAT expiry checker\n\u2514\u2500\u2500 plugin\/\n    \u251c\u2500\u2500 manifest.json               \u2190 Figma plugin manifest\n    \u251c\u2500\u2500 plugin.js                   \u2190 Figma Plugin API (main thread)\n    \u2514\u2500\u2500 ui.html                     \u2190 WebSocket iframe (relay bridge)\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<h3>\n  \n  \n  Setup is one command after filling your <code>.env<\/code>\n<\/h3>\n\n\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code>npm <span class=\"nb\">install\n<\/span>npm run build\nnpm run setup   <span class=\"c\"># auto-detects Claude Desktop config path, merges entry, resolves absolute paths<\/span>\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>The <code>setup<\/code> command handles everything:<\/p>\n\n<ul>\n<li>Reads credentials from your <code>.env<\/code>\n<\/li>\n<li>Detects <code>claude_desktop_config.json<\/code> path for macOS or Windows<\/li>\n<li>Creates the file if it doesn't exist<\/li>\n<li>Merges the <code>notioncanvas<\/code> entry without touching your other MCP servers<\/li>\n<li>Auto-resolves the absolute path to <code>dist\/index.js<\/code> \u2014 nothing to edit manually<\/li>\n<\/ul>\n\n<h3>\n  \n  \n  Stack\n<\/h3>\n\n<ul>\n<li>\n<strong>TypeScript \/ Node.js<\/strong> \u2014 ESM, strict mode<\/li>\n<li>\n<strong><code>@modelcontextprotocol\/sdk<\/code><\/strong> \u2014 MCP server with stdio transport<\/li>\n<li>\n<strong><code>@notionhq\/client<\/code><\/strong> \u2014 Notion API with p-queue rate limiting<\/li>\n<li>\n<strong><code>@anthropic-ai\/sdk<\/code><\/strong> \u2014 Claude API (claude-sonnet-4-6)<\/li>\n<li>\n<strong><code>ws<\/code><\/strong> \u2014 WebSocket server for the Figma bridge<\/li>\n<li>\n<strong><code>zod<\/code><\/strong> \u2014 DesignIR schema validation before any Figma writes<\/li>\n<li>\n<strong>Figma Plugin API<\/strong> \u2014 native canvas writes via the bridge plugin<\/li>\n<\/ul>\n\n\n\n\n<h2>\n  \n  \n  How I Used Notion MCP\n<\/h2>\n\n<p>Notion MCP is the foundation that makes this whole idea possible \u2014 and not in a trivial way.<\/p>\n\n<h3>\n  \n  \n  Why Notion as the input source is actually powerful\n<\/h3>\n\n<p>Most AI design tools start with a blank text box. You describe your idea to the AI. The AI designs something. But that description lives nowhere \u2014 it's not connected to your roadmap, your feature specs, your user stories. It's a one-off prompt.<\/p>\n\n<p>Notion changes that. Your product thinking already lives there. Feature specs, screen flows, content requirements, user personas \u2014 structured, searchable, shareable with your team. With Notion MCP as the reader, that existing knowledge becomes the direct input to the design pipeline.<\/p>\n\n<p>You're not describing your idea <em>to<\/em> an AI. You're pointing an AI <em>at<\/em> your idea. That's a fundamentally different workflow.<\/p>\n\n<h3>\n  \n  \n  The specific integration\n<\/h3>\n\n<p>I used the <strong>Notion internal integration token<\/strong> (via <code>@notionhq\/client<\/code>) to:<\/p>\n\n<ol>\n<li><p><strong>Read pages<\/strong> recursively \u2014 the client traverses the full block tree, handling pagination (100 blocks per request), nested toggles, callouts, lists, and all block types. Pages with hundreds of blocks are handled cleanly.<\/p><\/li>\n<li><p><strong>Query databases<\/strong> \u2014 the <code>notion_read_db<\/code> tool lets you pull structured data from Notion databases and feed it into screen generation. Imagine a database of app screens with properties like \"screen type\", \"primary action\", \"user role\" \u2014 and generating each one automatically.<\/p><\/li>\n<li><p><strong>Handle the page-sharing security model correctly<\/strong> \u2014 Notion's integration tokens only work on pages explicitly shared with the integration. The server returns a helpful, specific error message when a 404 is returned, rather than a generic failure.<\/p><\/li>\n<\/ol>\n\n<h3>\n  \n  \n  What Notion MCP unlocks that nothing else does\n<\/h3>\n\n<p>The pipeline means your <strong>Notion page becomes a living design brief<\/strong>. Update the page \u2014 run the tool again \u2014 get updated screens. It's not a one-time export. It's a repeatable process driven by the content you're already maintaining.<\/p>\n\n<p>For solo founders, indie developers, and small product teams who live in Notion: this means going from written idea to visual screen without leaving your workflow or learning Figma from scratch.<\/p>\n\n<p>That's the unlock. Notion stops being a notes app and starts being a design input system.<\/p>\n\n\n\n\n<p><em>Built with Claude Code, <code>@modelcontextprotocol\/sdk<\/code>, <code>@notionhq\/client<\/code>, and the Figma Plugin API.<\/em><br>\n<em>Stack: TypeScript \u00b7 Node.js \u00b7 WebSockets \u00b7 Zod \u00b7 claude-sonnet-4-6<\/em><\/p>\n\n","category":["devchallenge","notionchallenge","mcp","ai"]},{"title":"I Built an MCP That Publishes Your Blog to Every Platform With One Sentence to Claude","pubDate":"Sat, 28 Mar 2026 00:27:55 +0000","link":"https:\/\/dev.to\/thecodedaniel\/i-built-an-mcp-that-publishes-your-blog-to-every-platform-with-one-sentence-to-claude-26li","guid":"https:\/\/dev.to\/thecodedaniel\/i-built-an-mcp-that-publishes-your-blog-to-every-platform-with-one-sentence-to-claude-26li","description":"<p><em>This is a submission for the <a href=\"https:\/\/dev.to\/challenges\/notion-2026-03-04\">Notion MCP Challenge<\/a><\/em><\/p>\n\n\n\n\n<h2>\n  \n  \n  What I Built\n<\/h2>\n\n<p>Every developer I know has the same problem. They write a solid post, spend 20 minutes formatting it for Dev.to, copy-paste to Hashnode, re-upload the images that broke because Notion's CDN URLs expire, then give up on Medium entirely. The writing was the easy part. The publishing killed the momentum.<\/p>\n\n<p><strong>BlogCast MCP<\/strong> fixes that.<\/p>\n\n<p>It's an open-source MCP server + dashboard that turns Notion into a publishing hub. Write once \u2014 in Notion or in the built-in rich text editor \u2014 then tell Claude to publish it everywhere.<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\"Publish my TypeScript post to Dev.to and Hashnode\"\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>That's it. One sentence. Done.<\/p>\n\n<p><strong>What it actually does:<\/strong><\/p>\n\n<ul>\n<li>Publishes to Dev.to, Hashnode, and Medium simultaneously<\/li>\n<li>Handles Notion's expiring image URLs automatically (downloads \u2192 caches \u2192 re-uploads to each platform's CDN)<\/li>\n<li>Adapts content per platform \u2014 Medium gets clean HTML, Dev.to\/Hashnode get optimized Markdown<\/li>\n<li>Syncs analytics back into Notion (views, reactions, comments \u2014 all in one place)<\/li>\n<li>Schedules posts via Claude: <em>\"Schedule my React post for tomorrow at 9am UTC\"<\/em>\n<\/li>\n<li>AI pre-publish checks \u2014 catches missing excerpts, vague titles, broken formatting before you hit send<\/li>\n<li>Auto-configures Claude Desktop \u2014 no JSON editing required<\/li>\n<\/ul>\n\n<p>The whole thing runs locally. No third-party servers, no SaaS fees, no data leaving your machine. Your API keys are stored encrypted on your device.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Video Demo\n<\/h2>\n\n<p>  <iframe src=\"https:\/\/www.youtube.com\/embed\/NUdPBGZWTg0\">\n  <\/iframe>\n<\/p>\n\n\n\n\n<h2>\n  \n  \n  Show us the code\n<\/h2>\n\n<p><strong>GitHub:<\/strong> <a href=\"https:\/\/github.com\/TheCodeDaniel\/blogcast_mcp\" rel=\"noopener noreferrer\">github.com\/TheCodeDaniel\/blogcast_mcp<\/a><\/p>\n\n<p>Built as a proper monorepo \u2014 three packages that work together:<\/p>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Package<\/th>\n<th>What it does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>mcp\/<\/code><\/td>\n<td>MCP server \u2014 the Claude integration layer<\/td>\n<\/tr>\n<tr>\n<td><code>server\/<\/code><\/td>\n<td>Express backend \u2014 publishing, image caching, AI, scheduling<\/td>\n<\/tr>\n<tr>\n<td><code>client\/<\/code><\/td>\n<td>React dashboard \u2014 write, publish, manage everything visually<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n<p>Stack: TypeScript, Node.js, Express, React, Vite, TipTap editor, Anthropic SDK, Notion API.<\/p>\n\n\n\n\n<h2>\n  \n  \n  How I Used Notion MCP\n<\/h2>\n\n<p>Notion sits at the center of this whole thing \u2014 not as a passive database, but as the living CMS.<\/p>\n\n<p><strong>The MCP server<\/strong> talks to Notion directly via <code>@notionhq\/client<\/code>. When Claude calls <code>publish_post<\/code>, the server reads the Notion page blocks, converts them to Markdown using <code>notion-to-md<\/code>, handles all the images, pushes to each platform, then writes the results <em>back<\/em> into Notion \u2014 a linked Analytics database that tracks views, reactions, and comments per platform.<\/p>\n\n<p><strong>The Notion integration does five specific things:<\/strong><\/p>\n\n<ol>\n<li><p><strong>Posts database<\/strong> \u2014 every draft, scheduled post, and published article lives here. Status, tags, platforms, canonical URL \u2014 all tracked as Notion properties.<\/p><\/li>\n<li><p><strong>Analytics database<\/strong> \u2014 a relational table linked to Posts. Every publish result is logged: URL, status (Success\/Failed), and synced stats from each platform's API.<\/p><\/li>\n<li><p><strong>Auto-migration<\/strong> \u2014 on first run, BlogCast patches both databases automatically. New user? You don't set up a single column manually. Just share your databases with the integration and BlogCast does the rest.<\/p><\/li>\n<li><p><strong>Two-way sync<\/strong> \u2014 <code>sync_analytics<\/code> pulls the latest numbers from Dev.to and Hashnode back into Notion. Your post performance dashboard lives where you already work.<\/p><\/li>\n<li><p><strong>Scheduling<\/strong> \u2014 set <code>Scheduled At<\/code> in Notion (or via Claude: <em>\"schedule this for Friday 9am\"<\/em>), and the backend polls every N minutes to auto-publish when the time comes.<\/p><\/li>\n<\/ol>\n\n<p>The MCP layer is what makes Claude feel like a natural publishing assistant rather than a chatbot bolted onto a dashboard. You're not filling out forms \u2014 you're just talking.<\/p>\n\n<p><em>\"Show me what's in Review\"<\/em> \u2192 <code>list_drafts<\/code><br>\n<em>\"Preview my latest draft\"<\/em> \u2192 <code>preview_post<\/code><br>\n<em>\"Publish the TypeScript one to all platforms\"<\/em> \u2192 <code>publish_post<\/code><br>\n<em>\"What's the view count on my last post?\"<\/em> \u2192 <code>sync_analytics<\/code> + <code>get_publish_status<\/code><\/p>\n\n<p>Everything that used to take 30 minutes of copy-paste and re-uploading now takes one message.<\/p>\n\n","category":["devchallenge","notionchallenge","mcp","ai"]},{"title":"I Got Tired of Cold Outreach. So I Made Claude Do It.","pubDate":"Thu, 26 Mar 2026 13:49:37 +0000","link":"https:\/\/dev.to\/thecodedaniel\/i-got-tired-of-cold-outreach-so-i-made-claude-do-it-5flp","guid":"https:\/\/dev.to\/thecodedaniel\/i-got-tired-of-cold-outreach-so-i-made-claude-do-it-5flp","description":"<h1>\n  \n  \n  I Built an MCP That Turns Claude Into a Cold Outreach Machine \u2014 and It Actually Works\n<\/h1>\n\n<p><em>Submitted for the Notion MCP Challenge 2026<\/em><\/p>\n\n\n\n\n<p>Let me be honest with you.<\/p>\n\n<p>Cold outreach is broken.<\/p>\n\n<p>Not because the idea is bad \u2014 cold emails work. People get hired, land clients, and build relationships through cold outreach every single day. It's broken because of <strong>how long it actually takes to do it right<\/strong>.<\/p>\n\n<p>Think about it. To send one good cold email, you have to:<\/p>\n\n<ol>\n<li>Find a company that's actually a fit for your skills<\/li>\n<li>Go to their website and actually read it<\/li>\n<li>Figure out what they're working on, what problems they might have<\/li>\n<li>Find a contact email somewhere on the site<\/li>\n<li>Write something that doesn't sound like everyone else's template<\/li>\n<li>Send it<\/li>\n<li>Log it somewhere so you don't forget who you've reached out to<\/li>\n<\/ol>\n\n<p>That's 20\u201340 minutes. Per company.<\/p>\n\n<p>If you do 10 companies \u2014 which is barely enough to move the needle \u2014 you've just burned a full workday on outreach alone.<\/p>\n\n<p>So most people don't do it. Or they send lazy, generic emails that get deleted in two seconds. Both outcomes are bad.<\/p>\n\n<p>I got tired of it. So I built something.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Demo\n<\/h2>\n\n<p>  <iframe src=\"https:\/\/www.youtube.com\/embed\/x7UvlIxKoPI\">\n  <\/iframe>\n<\/p>\n\n\n\n\n<h2>\n  \n  \n  What I Built: Cold Outreach MCP\n<\/h2>\n\n<p><strong>Cold Outreach MCP<\/strong> is a custom MCP server that turns Claude into a fully automated cold email agent. You paste your CV once. Claude does everything else.<\/p>\n\n<p>Here's the exact flow:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>You: \"Here is my CV. Find 10 companies that match my background,\n      research each one, and show me your recommendations.\"\n\nClaude: [researches 10 companies]\n\n      1. stripe.com \u2192 opportunity_pitch\n         \"Their checkout onboarding has friction \u2014 matches your UX background\"\n\n      2. linear.app \u2192 role_inquiry\n         \"Fast-growing team, strong eng culture, no obvious gap spotted\"\n\n      ... 8 more\n\nYou: \"Looks good. Send as recommended.\"\n\nClaude: [generates 10 tailored emails, sends them, logs everything to Notion]\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>That's it. What used to take a full day now takes 3 minutes.<\/p>\n\n\n\n\n<h2>\n  \n  \n  The Part That Actually Makes It Different\n<\/h2>\n\n<p>Most \"automation\" tools skip the part that matters most \u2014 the email itself.<\/p>\n\n<p>They send templated garbage like:<\/p>\n\n<blockquote>\n<p><em>\"Hi [First Name], I came across [Company] and I was really impressed by your work in [Industry]. I think my background in [Skill] could add value to your team...\"<\/em><\/p>\n<\/blockquote>\n\n<p>Nobody replies to that. Everybody knows it's a template. It goes straight to the bin.<\/p>\n\n<p>Cold Outreach MCP does something different. Before generating the email, Claude actually <strong>reads the company's website<\/strong>, identifies specific things about their product or team, and writes something that references what it found:<\/p>\n\n<blockquote>\n<p><em>\"Saw you're building a design system at scale \u2014 I've done exactly this at [Company] and ran into the same versioning problems you're probably hitting. Worth a quick chat?\"<\/em><\/p>\n<\/blockquote>\n\n<p>That's an email someone opens. That's an email someone replies to.<\/p>\n\n<p>And the tone rules are hard-coded into the prompts:<\/p>\n\n<ul>\n<li>Under 120 words<\/li>\n<li>No buzzwords (\"synergy\", \"leverage\", \"circle back\" \u2014 all banned)<\/li>\n<li>Short sentences. Casual but not sloppy.<\/li>\n<li>One specific observation from their site<\/li>\n<li>One clear ask at the end<\/li>\n<\/ul>\n\n<p>It sounds like a person wrote it. Because an extremely good AI was told to write like a person.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Where Notion Fits In\n<\/h2>\n\n<p>Every outreach \u2014 sent, failed, or pending \u2014 gets logged to a Notion database automatically.<\/p>\n\n<p>The schema looks like this:<\/p>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Company<\/th>\n<th>Website<\/th>\n<th>Email<\/th>\n<th>Type<\/th>\n<th>Status<\/th>\n<th>Date Sent<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Stripe<\/td>\n<td>stripe.com<\/td>\n<td><a href=\"mailto:hello@stripe.com\">hello@stripe.com<\/a><\/td>\n<td>opportunity_pitch<\/td>\n<td>sent<\/td>\n<td>2026-03-26<\/td>\n<td><em>full email body<\/em><\/td>\n<\/tr>\n<tr>\n<td>Linear<\/td>\n<td>linear.app<\/td>\n<td><a href=\"mailto:team@linear.app\">team@linear.app<\/a><\/td>\n<td>role_inquiry<\/td>\n<td>sent<\/td>\n<td>2026-03-26<\/td>\n<td><em>full email body<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n<p>No manual logging. No \"I think I emailed them last week?\". No spreadsheet.<\/p>\n\n<p>And the Notion integration is set up like a proper database migration \u2014 you create an empty database on Notion, paste its ID in your config, run <code>setup_notion_db<\/code> once, and all the columns are provisioned automatically. It's exactly how backend migrations work.<\/p>\n\n\n\n\n<h2>\n  \n  \n  The 10 Tools Under the Hood\n<\/h2>\n\n<div class=\"table-wrapper-paragraph\"><table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What it does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>setup_notion_db<\/code><\/td>\n<td>Migrates your Notion database \u2014 adds all required columns<\/td>\n<\/tr>\n<tr>\n<td><code>parse_profile<\/code><\/td>\n<td>Extracts structured profile from your CV text<\/td>\n<\/tr>\n<tr>\n<td><code>discover_companies<\/code><\/td>\n<td>Finds real companies that match your skills using Claude<\/td>\n<\/tr>\n<tr>\n<td><code>find_company_email<\/code><\/td>\n<td>Scrapes a company site to find a contact email<\/td>\n<\/tr>\n<tr>\n<td><code>research_company<\/code><\/td>\n<td>Analyzes a company \u2014 summary, pain points, recommended email type<\/td>\n<\/tr>\n<tr>\n<td><code>generate_email<\/code><\/td>\n<td>Writes a human-sounding outreach email<\/td>\n<\/tr>\n<tr>\n<td><code>send_email<\/code><\/td>\n<td>Sends via SMTP (Gmail, Outlook, anything)<\/td>\n<\/tr>\n<tr>\n<td><code>log_to_notion<\/code><\/td>\n<td>Logs a record to your Notion tracker<\/td>\n<\/tr>\n<tr>\n<td><code>retry_failed<\/code><\/td>\n<td>Re-attempts any failed sends automatically<\/td>\n<\/tr>\n<tr>\n<td><code>bulk_outreach<\/code><\/td>\n<td>Full pipeline for up to 15 companies at once<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n\n\n\n\n<h2>\n  \n  \n  It's Human-in-the-Loop by Design\n<\/h2>\n\n<p>This is important. The tool doesn't just fire off emails without asking you.<\/p>\n\n<p><code>bulk_outreach<\/code> runs in two phases:<\/p>\n\n<p><strong>Phase 1<\/strong> \u2014 Claude researches all companies and returns its recommendations. You see everything before a single email is sent.<\/p>\n\n<p><strong>Phase 2<\/strong> \u2014 You confirm (or override) each recommendation. Then and only then does Claude generate and send.<\/p>\n\n<p>You're always in control. The AI is doing the tedious work, not making the decisions for you.<\/p>\n\n<p>There's also a hard limit of 15 companies per run \u2014 enough to be productive, not enough to accidentally spam half the internet if something goes wrong.<\/p>\n\n\n\n\n<h2>\n  \n  \n  Tech Stack\n<\/h2>\n\n<ul>\n<li>\n<strong>MCP SDK<\/strong> \u2014 <code>@modelcontextprotocol\/sdk<\/code> (official Anthropic SDK)<\/li>\n<li>\n<strong>AI<\/strong> \u2014 Claude via <code>@anthropic-ai\/sdk<\/code> with adaptive thinking for research and email generation<\/li>\n<li>\n<strong>Scraping<\/strong> \u2014 <code>axios<\/code> + <code>cheerio<\/code> for website analysis and email extraction<\/li>\n<li>\n<strong>Email<\/strong> \u2014 <code>nodemailer<\/code> with lazy SMTP validation (server doesn't crash if SMTP isn't configured yet)<\/li>\n<li>\n<strong>Notion<\/strong> \u2014 raw Notion REST API (<code>fetch<\/code> directly to <code>https:\/\/api.notion.com\/v1\/...<\/code>) for reliability<\/li>\n<li>\n<strong>Language<\/strong> \u2014 TypeScript, Node.js 18+, ES modules<\/li>\n<\/ul>\n\n\n\n\n<h2>\n  \n  \n  What the Setup Looks Like\n<\/h2>\n\n\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight shell\"><code>git clone https:\/\/github.com\/thecodedaniel\/cold-outreach-mcp\n<span class=\"nb\">cd <\/span>cold-outreach-mcp\nnpm <span class=\"nb\">install<\/span> <span class=\"o\">&amp;&amp;<\/span> npm run build\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Fill in your <code>.env<\/code>:<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>ANTHROPIC_API_KEY=sk-ant-...\nNOTION_API_KEY=ntn_...\nNOTION_DATABASE_ID=your_database_id\nSMTP_HOST=smtp.gmail.com\nSMTP_PORT=587\nSMTP_USER=you@gmail.com\nSMTP_PASS=your_app_password\nSENDER_EMAIL=you@gmail.com\nSENDER_NAME=Your Name\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Add to Claude Desktop config. Restart. Done.<\/p>\n\n<p>The full setup takes about 10 minutes if you already have the API keys.<\/p>\n\n\n\n\n<h2>\n  \n  \n  The One Thing I'm Most Proud Of\n<\/h2>\n\n<p>It's not the scraping. It's not the Notion integration. It's not even the email generation.<\/p>\n\n<p>It's the fact that <strong>you don't have to know which companies to target<\/strong>.<\/p>\n\n<p>Every other tool in this space assumes you already know who you want to reach out to. You still have to do the research, compile the list, find the websites.<\/p>\n\n<p>This one starts from your CV and figures out the rest. You describe what you do. Claude figures out who needs someone like you.<\/p>\n\n<p>That's the part that changes things.<\/p>\n\n\n\n\n<h2>\n  \n  \n  What's Next\n<\/h2>\n\n<ul>\n<li>Web search integration for real-time company discovery (Brave Search API)<\/li>\n<li>Follow-up email scheduling (\"no response in 7 days \u2192 send a nudge\")<\/li>\n<li>Notion status tracking \u2014 mark a reply directly in Notion, trigger a follow-up draft<\/li>\n<li>LinkedIn integration for finding decision-maker contacts<\/li>\n<\/ul>\n\n\n\n\n<h2>\n  \n  \n  Links\n<\/h2>\n\n<ul>\n<li>\n<strong>GitHub<\/strong>: <a href=\"https:\/\/github.com\/TheCodeDaniel\/reachout_mcp\" rel=\"noopener noreferrer\">github.com\/TheCodeDaniel\/reachout_mcp<\/a>\n<\/li>\n<li>\n<strong>Demo<\/strong>: <a href=\"https:\/\/youtu.be\/x7UvlIxKoPI\" rel=\"noopener noreferrer\">youtu.be\/x7UvlIxKoPI<\/a>\n<\/li>\n<\/ul>\n\n\n\n\n<p><em>Built for the Notion MCP Challenge 2026 by Daniel Ainoko (THECODEDANIEL)<\/em><\/p>\n\n<p><em>If you're a developer actively job hunting or trying to land clients \u2014 this is for you. The grind is real. Automate the boring parts.<\/em><\/p>\n\n","category":["notionchallenge","mcp","ai"]}]}}