Tech Notes #1: MCP & Functional Programming Patterns
Welcome to my new series called Tech Notes (Working Name). The idea is to share what I am currently learning in tech to perhaps inspire you to want to look into the same topics!
It will be anything and everything. It is not always topics that I master so I am not an authority on what I am writing about I am simply sharing my insights and learning process. I hope I can inspire you to do the same!
Model Context Protocol (MCP)
What is MCP? Give me the 80/20
In essence this is the protocol that allows our applications like our terminal, copilot chat interfaces and more talk to external systems like data sources, prompts and tools. This builds context that the AI reasoning inside the LLMs can use to help us get more out of AI directly inside our MCP client, which could be Claude Desktop for example.
Example of MCP clients:
- Terminal running Gemini, Codex or other
- Claude
- Github Copilot Chat inside VS Code
Example of MCP servers
- Azure, connecting to data in Azure Resource Graph
- Obsidian MCP server
- Youtube transcript generator
What is the power here? For the Azure MCP server for example you do not need to spend a bunch of time explaining what your cloud environment looks like. The MCP server can fetch this information and start giving you better answers immediately.
MCP, developed by Anthropic, aims to standardizes how this connection is made. Similar to how REST defines API conventions, MCP defines how our "AI applications" connect to data & tools.
For example Claude Desktop that supports MCP can write, fetch and analyze information you have in your notes inside another application called Obsidian, and inside Claude Desktop it can give you this data, quiz you on information and more using different tools like "read vault content".
I personally have done this a lot. Both with Claude but also just running something like Gemini or Codex inside my terminal.
Run it inside containers
One major challenge with MCP servers is the concern of security.
- Where is it hosted?
- What does the code look like and actually do?
- How do they handle and store the data you send?
- What data do you actually send?
Pretty basic and common concerns that we have today with cloud services in general. A benefit if you want to try MCP out is that you can run the server in a container on your local machine. Then you have an ephemeral and temporary environment where you can interact with the MCP server through a MCP client like Claude Desktop and once you are done, you delete the container.

Functional Programming Patterns
I am not a developer but lately I've been writing a lot of C# for a project I am working on. I have really come to like functional programming patterns when writing C#. I like the idea of trying something and failing/returning early as opposed to having a bunch of try-catch blocks and nested if statements. (Thank you for a lot of help here Simon Gottschlag).
So instead of doing that I've used the C# functional extension framework together with lambda expressions.
What you end up with is code that can look like this:
var dataResult = Try<EventData?>(() => _args.Data).EnsureNotNull("EventData is null");
if (!dataResult.TryGetValue(out var data))
return Failure<JsonArray>($"EventData is null: {dataResult.Error}");
var dataResult = Create a new variable for the data to be stored in.
Try<EventData?>(() =>
_args.Data).EnsureNotNull("Event data is null");
Here we are using the Try() method from the framework. We are saying that we should return something that conforms to what EventData look like where ? also explains that it can be null What should EventData look like and what is it?
Well, I am using Azure.Messaging.EventHubs namespace in this case with my EventData class. Which is a class from the previous mentioned namespace EventHubs that have inherited the MessageContent class from the namespace Azure.Messaging - I assume this is because there are more services than Event Hubs that use messaging services?
Anyways... The lambda expression is the operation being performed. It runs a function where _args.Data will be accessed and wrapped inside Result<EventData?> in the method.
Break down of the Lambda Expression() = No parameters=> = Reads as "Goes to"_args.Data = Is the expression that gets evaluated
If the lambda expression evaluation fails the Try() method catches this and wraps it inside of a Failure which will get returned in Result. If there is no exception but the result in null we can rely on .EnsureNotNull() to catch this for us. This is required because the Try() method can be invoked and return a successful status that contains null.
What is a Lambda Expression?
A lambda expression is a short snippet of code that takes some input parameters, executes a function and returns a value. For example if I want to specify that there should be no input parameters, execute a function that creates a Dictionary where the key input is a string and values are objects I can write this:
() => new Dictionary<string, object>
() = No input parameters=> = Goes tonew Dictionary<string, object> = Create a new empty dictionary where keys will be of type string and values are of type objects
Conclusion
Thank you for reading the first edition of my Tech Notes (Again, working name :) )
I hope I inspired you to learn something new and share as well!
