Understanding MCP Connection Options: A Technical Deep Dive

The Model Context Protocol (MCP) represents standardised approach for AI-to-application communication, offering three distinct connection methods—Streamable HTTP, SSE, and STDIO—each designed for different deployment scenarios. Streamable HTTP emerges as the recommended transport due to its superior performance, scalability, and modern architecture, achieving 10x better performance with session pooling while maintaining compatibility with standard web infrastructure.

This technical analysis explores why Streamable HTTP has become the preferred choice, the deprecation of SSE transport, and when STDIO remains valuable for local development scenarios. Understanding these connection options is crucial for architects and developers implementing MCP-based integrations, as the transport choice directly impacts performance, security, and deployment complexity.

[Read More]

Scala Books

Scala Books: The Ultimate Guide for Aspiring Scala Developers

Scala, a powerful language for functional programming, offers a unique blend of object-oriented and functional programming paradigms. Whether you’re a beginner or an experienced developer looking to delve deeper into Scala, the right resources are crucial. Here’s my handpicked list of books, each serving a specific purpose in your Scala learning journey.

Essential Scala

Essential Scala: Ideal for beginners, this short book provides a concise introduction to Scala. It’s free and perfect for those who want to get a quick start without feeling overwhelmed.

[Read More]

Achieve a Computer Science Bachelor's Degree Online with MOOCs

Achieve a Computer Science Bachelor’s Degree Online with MOOCs

August 31, 2023

In the ever-evolving world of technology, the demand for skilled software engineers continues to soar. But what if I told you that you could gain the knowledge equivalent to a computer science bachelor’s degree, all from the comfort of your home and without breaking the bank? Yes, it’s possible through a carefully curated list of Massive Open Online Courses (MOOCs).

[Read More]

How to deploy a vite service in heroku

There are many suggestions online to use the heroku-buildpack-static .

The problem with this is that it is deprecated and will not work with the latest heroku stacks.

In their readme file they suggest to use an NGINX buildpack, but it looks like an error prone process.

I have figured other another way just by using the heroku/nodejs build pack

You can start by setting the heroku/nodejs in your application

heroku buildpacks:set heroku/nodejs -a my_application

In principle we just want to run tsc && vite build && vite preview but there are some caveats.

[Read More]

Bower integration in play

If you want to use a package.json in your play application add

  • the webjars dependency
  • a package.json in root
  • and the following in sbt , so you can access the javascript libraries.
val bowerPath = SettingKey[String]("bower-path", "where bower is installed")

lazy val bowerGenerateTaskImpl: Def.Initialize[Task[Seq[File]]] = (bowerPath,
                                                                   baseDirectory,
                                                                   streams) map {
  (bower, base, s) =>
    try {
      Process("npm" :: "install" :: Nil) ! s.log
      Process(bower :: "install" :: "--allow-root" :: Nil, base) ! s.log
      s.log.info("Bower install finished")
    } catch {
      case e: java.io.IOException =>
        s.log.error(
          "Bower couldn't be found. Please set the configuration key 'SimpleBowerKeys.bowerPath' properly. " + e.getMessage)
    }
    Seq()
}

bowerPath := sys.props.getOrElse("pathBower", default = "bower")
lazy val bowerGen = taskKey[Seq[File]]("Run bower")
bowerGen := bowerGenerateTaskImpl.value

lazy val copyBower = TaskKey[Seq[File]]("copyRes")
copyBower := {
  streams.value.log("Copy bower_components to public folder")
  val source = baseDirectory.value / "bower_components"
  val dest   = baseDirectory.value / "public" / "bower_components"
  IO.copyDirectory(source, dest)
  Seq()
}

lazy val bower = taskKey[Seq[File]]("Run bower")
bower := Def.sequential(bowerGen, copyBower).value
sourceGenerators in Compile += bower.taskValue

Lessons learned from Pieter Hintjens

The Confessions of a Necromancer is a professional road trip, written by Pieter Hintjens for his fellow programmers. He shares all the lessons that he learned in his life.

Some of them are :

  • Most of the time, most large software projects fail, and this is still true in 2016.
  • The very notion of individual intelligence is a dangerously simplified myth.
  • Technology is a slave to personality.
  • You need to follow the money, and understand how it flows.
  • The more your clients pay you, the more they appreciate you and listen to what you say.
  • To get consistent and fast response in a real time system, you have to work asynchronously.
  • If you have the trust of your client, and s/he has real power, you have done half the work already.
  • Identify the riskiest parts of your architecture and bring them under your full control.
  • Making systems more complex, to try to make them “reliable” will usually make them less reliable.
  • Fail-over automatically and recover manually.
  • Don’t expect random work from random vendors to magically work together.
  • Do not develop and test in your production environment.
  • When things go wrong that even marginally involve you, assume responsibility until you know where the real problem lies
  • When you use hardware and software that bends to your will, you can work significantly faster.
  • When you are a technology company, use your own technology in your projects. Don’t accept client requirements that sabotage your own vision and future. It isn’t worth the short term gains.
  • You can do a lot with little, if you are creative.
  • Don’t take “impossible” as an answer
  • Everyone lies, not always deliberately. We just have our assumptions and ignorance and we believe we’re telling the truth.
  • Build up trust with the client and sometimes they will reward you for it.
  • When you’ve paid for all the mistakes, you should know how to do it right the next time.
  • A good specification lets diverse people work together without confusion or conflict.
  • Don’t be afraid to charge the real cost.
  • It is ironic that a “successful” project can be a “failure”, while catastrophically bad projects can push you through to better things.
  • Breaking into markets you don’t know is probaby impossible.
  • Mobile phone operators are crooks who steal billions
  • Be aware of your expenditure and manage your losses. You can survive a long time with less income if you are in tight control of what you spend.
  • It is no favor to pay people to do idle work.
  • When you hire someone, tell yourself, and them, one day this will be over.
  • Prefer working with self-employed partners because that doesn’t need to be stated, it’s explicit.
  • Don’t try to fix existing organizations. Start new ones.
  • I recommend the Mozilla Public License v2 in general. It allows forks and prohibits dark forks, and is not tainted by Microsoft’s long “viral” campaign against the GPLv3.
  • Good software is used by people to solve real problems. Good software saves people money, or makes them a profit. It can be buggy, incomplete, undocumented, slow. Yet it can also be good. You can always make good software better yet it’s only worth doing when it’s already good.
  • Be patient, don’t give up, and always be learning.
  • You can turn even the most crappy situation into valuable lessons.
  • Don’t let people flatter you into playing their games.
  • When things get weird, keep a log.
  • Love and respect good people.
  • Learn to keep the assholes at a distance.
  • Don’t get hung-up on the past.
  • Be nice to people, even those trying to hurt you.
  • Speak up when things are bad, and tell the truth.
  • Trust your emotions yet check where they come from.
  • Don’t be afraid of taking risks, and learn to identify and manage risks.
  • Solve one problem at a time.
  • Be generous.
  • Teach others whenever you can.
  • Remember Sturgeon’s Law.

Polymer

Useful resources

Architecture

webcomponents

Instant Loading Web Apps with An Application Shell Architecture this article describes the application shell

Progressive Web Apps

What is a Service Worker

Promises

PRPL pattern

Service Worker Precache

Service Worker resources

The offline cookbook this is useful when working with Service Worker Precache  to provide the best experience for your users. Service worker lifecycle is explained in the second chapter of the udacity course Offline Web Applications which explains how to use IndexedDB & Service Worker

[Read More]

Akka Best Practices

  • Don’t share mutable state among actors

  • Do not close on the sender

  • Do not close over an actor’s context

  • Do not use the scheduler with the Runnable trait

  • Do not declare one actor within another.

  • Never pass an actor’s this reference into Props

  • Actors do not stop automatically when no longer referenced, every Actor that is created must also explicitly be destroyed. The only simplification is that stopping a parent Actor will also recursively stop all the child Actors that this parent has created.

    [Read More]

Free Monads

Resources on learning free monads

Here are some resources about the free monad in scala . At some point I need to write summaries for each entry :)

Blog posts

Free Monads I had bookmarked this sometime ago and seems to be very to the point without a lot of theotitical analysis

Free Monad - Cats Documentation by Pascal Voitot

herding cats - Free monads by Eugene Yokota

Deriving the Free Monad by Noel Welsh

Free Monads Are Simple by Noel Welsh

[Read More]

Shapeless: Introduction resources

Where to start if you want to learn shapeless

Recently I decided to have a better look at shapeless, the generic programming library for scala. In the previous couple of years I had bookmarked several links and have recently read all of them . In this blog post I present the most useful ones for someone who want to be introduced to the library.


The following blog posts are introductory to shapeless. Basically they are a smooth introduction to shapeless , something to warm up

[Read More]