AWS re:Invent sought to present AI solutions in the spirit of AWS’ original impact on startups; the real targets may be the startups from that era, not the current one.
Source: Stratechery by Ben Thompson.
AWS re:Invent sought to present AI solutions in the spirit of AWS’ original impact on startups; the real targets may be the startups from that era, not the current one.
Source: Stratechery by Ben Thompson.
Introduction
As developers, we are increasingly integrating AI into our workflows using IDEs like Cursor, Windsurf, or Claude Desktop. However, Large Language Models (LLMs) can sometimes struggle with precise mathematical conversions or lack access to specific local logic.
This is where the Model Context Protocol (MCP) shines. Think of MCP as a standardized “USB-C port” that connects AI models to your local tools and data.
In this tutorial, I will show you how to build a Unit Converter MCP Server from scratch using Python. This tool will allow your AI agent to perform precise conversions for temperature, length, and weight without “hallucinating” the numbers.
Prerequisites
Python 3.10+ installed.
A code editor (VS Code, Cursor, etc.).
Basic command line knowledge.
Step 1: Environment Setup
First, let’s create a directory for our project and set up a clean Python environment.
Open your terminal and run:
mkdir mcp-unit-converter
cd mcp-unit-converter
python -m venv venv
venvScriptsactivate
source venv/bin/activate
pip install mcp[cli]
Step 2: Writing the Server Code
We will use the FastMCP class to build our server quickly. Create a file named converter.py.
This code defines tools for converting Temperature (Celsius/Fahrenheit), Length (Meters/Feet), and Weight (Kg/Pounds). from mcp.server.fastmcp import FastMCP # Initialize the server mcp = FastMCP("UnitConverter") # --- Temperature Tools --- @mcp.tool() def celsius_to_fahrenheit(celsius: float) -> float: """Convert Celsius to Fahrenheit""" return (celsius * 9/5) + 32 @mcp.tool() def fahrenheit_to_celsius(fahrenheit: float) -> float: """Convert Fahrenheit to Celsius""" return (fahrenheit - 32) * 5/9 # --- Length Tools --- @mcp.tool() def meters_to_feet(meters: float) -> float: """Convert Meters to Feet""" return meters * 3.28084 @mcp.tool() def feet_to_meters(feet: float) -> float: """Convert Feet to Meters""" return feet / 3.28084 # --- Weight Tools --- @mcp.tool() def kg_to_pounds(kg: float) -> float: """Convert Kilograms to Pounds""" return kg * 2.20462 @mcp.tool() def pounds_to_kg(pounds: float) -> float: """Convert Pounds to Kilograms""" return pounds / 2.20462 if __name__ == "__main__": mcp.run(transport="stdio")
Step 3: Testing with MCP Inspector
Before connecting it to an AI, let’s verify it works locally using the MCP Inspector.
Run this command in your terminal:
mcp dev converter.py
This will open a local web interface. You can select the celsius_to_fahrenheit tool, input 0, and check if it returns 32.
Step 4: Connecting to Cursor (AI Client)
Now for the magic. We will connect our server to Cursor (or any MCP-compliant client).
Create a .cursor folder in your project (optional, but good for organization).
Create or edit your mcp.json configuration file (usually located in your global Cursor settings or project root).
Add the following configuration:
{
“mcpServers”: {
“unit_converter”: {
“command”: “/ABSOLUTE/PATH/TO/YOUR/venv/bin/python”,
“args”: [“/ABSOLUTE/PATH/TO/YOUR/converter.py”]
}
}
}
⚠️ Important: You must use the absolute path to your python executable inside the venv folder and the absolute path to your converter.py file.
Step 5: Seeing it in Action
Once connected, you can open your AI Chat and ask:
“I have a shipping crate that weighs 450 kg and is 12 meters long. Convert these to pounds and feet using my tools.”
The AI will intelligently call kg_to_pounds and meters_to_feet and give you the exact result based on your code.
Source Code
You can find the complete repository with the source code here:
https://github.com/GregoBHM/mcp-unit-converter
Conclusion
Building an MCP server is surprisingly simple. With just a few lines of Python, we extended the capabilities of our AI assistant, making it more reliable for specific tasks like unit conversion.
If you found this useful, check out the video demonstration below!
Happy coding!
Source: DEV Community.
Introduction:
File upload functionality is a ubiquitous feature in modern web applications. From profile pictures and documents to media files and configuration data, users frequently need to upload files to servers. While providing convenience and expanding functionality, this feature also introduces a significant attack surface. Poorly implemented file upload processes can open the door to various security vulnerabilities, ranging from denial-of-service attacks to remote code execution, compromising the integrity, confidentiality, and availability of web applications and their underlying infrastructure. This article delves into the critical security issues surrounding file uploads, outlining common threats, mitigation strategies, and best practices for secure implementation.
Prerequisites:
Before diving into the specifics, a basic understanding of the following is helpful:
Advantages of File Upload Functionality:
Disadvantages and Security Risks:
While providing many benefits, improper implementation of file upload functionalities poses several critical risks:
Features of Secure File Upload Implementation:
A robust and secure file upload implementation should incorporate the following key features:
File Type Validation:
import magic def is_valid_image(file_path): mime = magic.Magic(mime=True) mime_type = mime.from_file(file_path) if mime_type in ['image/jpeg', 'image/png', 'image/gif']: return True else: return False
Filename Sanitization:
import os import uuid from werkzeug.utils import secure_filename def generate_unique_filename(filename): extension = filename.rsplit('.', 1)[1].lower() unique_filename = str(uuid.uuid4()) + '.' + extension return secure_filename(unique_filename) # Using Werkzeug's secure_filename
File Size Limits:
client_max_body_size in Nginx, LimitRequestBody in Apache).Content Security Policy (CSP):
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; object-src 'none';
Secure Storage:
.htaccess in Apache or configuring appropriate server settings).File Content Scanning:
Input Validation:
Authentication and Authorization:
Logging and Monitoring:
Error Handling:
Code Snippets:
The above examples were written in Python using the Flask framework and the python-magic library. The principles are applicable across languages. Remember to adapt the code to your specific server-side language and framework. Always consult the official documentation for the libraries and frameworks you are using.
Conclusion:
Secure file upload functionality is a crucial aspect of web application security. Neglecting proper security measures can lead to severe consequences, including remote code execution, data breaches, and denial-of-service attacks. By implementing the security features and best practices outlined in this article, developers can significantly reduce the risk of file upload vulnerabilities and protect their web applications and users from harm. Remember that security is an ongoing process, and continuous monitoring, testing, and updates are essential to maintain a secure file upload implementation. Regularly review and update your security measures to address emerging threats and vulnerabilities.
Source: DEV Community.

• Buy/Stream Modd & Voice of Babylon ‘Follow The Star / Feel Love’: https://exp.anjunadeep.co/mvob.oyd • Anjunadeep Explorations Discography: https://exp.anjunadeep.co/discog.oyd • Anjunadeep 2025: https://anjunadeep.co/deep2025.oyd • Listen to Anjunadeep Radio 24/7: https://anjunadeep.co/radio.oyd • Anjuna Music Store: https://music.anjunabeats.com/ • Anjuna Merchandise: https://store.anjunabeats.com/ • Join our newsletter for updates: https://anjunadeep.com/gb/join Modd & Voice of Babylon unite for their first collaborative release on Anjunadeep Explorations, ‘Follow The Star / Feel Love’. DJ and producer Stanislav Klimushin, better known as Modd, is a longstanding and respected member of the deep and organic house community. A regular name on Anjunadeep since the late 2010s, he’s behind label classics such as ‘Abenaki’, ‘Guron’, and ‘Swallow’s Nest’ with Hosini – records that went on to become staples of melodic house sets around the world. His work has also appeared on Sasha’s Last Night On Earth, Lee Burridge’s All Day I Dream, and Balance Music. With multiple Beatport Organic House #1s to his name, including ‘It’s Gonna Be Okay’ (2024) and ‘Beyond’ (2021), Modd continues to evolve his lush, nature-infused sound. His productions are frequently supported by tastemakers like Kölsch, Jody Wisternoff, Lee Burridge, and Hernán Cattáneo, and have received airplay from Pete Tong on BBC Radio 1, and KCRW. On his new release, Modd teams up with Voice of Babylon for the first time blending his organic, melodic touch with the collaborator’s deeper, club-focused edge. The result is a hypnotic and emotive pairing that captures both artists’ strengths – intricate textures, fluid grooves, and an unmistakable sense of warmth. Modd & Voice of Babylon’s ‘Follow The Star / Feel Love’ is out now on Anjunadeep Explorations. Release date: 3 December 2025 Follow Anjunadeep: • Youtube: https://anjunadeep.co/youtube.oyd • Website: http://www.anjunadeep.com • Facebook: http://www.facebook.com/anjunadeep • Twitter: http://www.twitter.com/anjunadeep • Spotify: https://anjunadeep.co/spotify.oyd • Instagram: http://www.instagram.com/anjunadeep • SoundCloud: http://soundcloud.com/anjunadeep • Reddit: https://reddit.com/r/AboveandBeyond/ • Twitch: https://www.twitch.tv/anjuna • Discord: http://www.discord.gg/anjuna • Join our newsletter: https://anjunadeep.com/signup/ Follow Anjunadeep Playlists: • Anjunadeep 2025: https://anjunadeep.co/deep2025.oyd • Anjunadeep Discography: https://anjunadeep.co/discog.oyd • Anjunadeep Essentials: https://anjunadeep.co/essentialsplaylist.oyd • Anjunadeep Explorations Discography: https://exp.anjunadeep.co/discog.oyd #Anjunadeep #Explorations #Modd #VoiceofBabylon #FollowTheStar
Source: YouTube.

India’s rupee fell past a key psychological level of 90 per dollar as delays in finalizing a crucial trade deal with the US hurt sentiment.
Source: Bloomberg Markets.

Ayvens SA, a French fleet managing and car leasing company, is marketing a £200m ($264m) dual-tranche bullet loan, according to a person familiar with the matter.
Source: Bloomberg Markets.

The country’s transport ministry said the search would resume on 30 December and confirmed that US robotic company Ocean Infinity would take part
The search for the missing Malaysia Airline flight MH370 will resume this month, over a decade after the plane was lost, Malaysia’s transport ministry has announced.
In a statement on Wednesday, the transport ministry said the search would resume on 30 December, and confirmed that US robotic company Ocean Infinity would take part in a search of the seabed that would run for 50 days.
Source: World news | The Guardian.
Right-hander Cody Ponce and the Toronto Blue Jays are in agreement on a three-year, $30 million contract, sources told ESPN, doubling the largest contract ever for a domestic player returning from the Korea Baseball Organization.
Ponce, 31, won KBO Most Valuable Player this year, going 17-1 with a 1.89 ERA and 252 strikeouts against 41 walks in 180⅔ innings for the Hanwha Eagles. A former second-round pick who threw 55⅓ innings with Pittsburgh in 2020-21, Ponce remade his arsenal and joins a deep Blue Jays rotation that last week added right-hander Dylan Cease for $210 million over seven years.
The highest previous contract for a player coming back from the KBO was a two-year, $15 million deal the Chicago White Sox gave right-hander Erick Fedde before the 2024 season.
Ponce comes with higher expectations — and superior stuff. Ponce added strength and turned his 6-foot-6, 250-pound frame into a strike-throwing machine, sitting 95 mph with his fastball, topping out at 98 and using a low-spin kick changeup to put away hitters.
Toronto, which has been among the most aggressive teams scouting Asia in recent years, expressed interest in Ponce early in free agency and did not relent as the price of the contract grew. Despite a rotation that already includes Cease and right-handers Kevin Gausman, Trey Yesavage, Shane Bieber and Jose Berrios, Toronto pushed its projected luxury tax payroll to more than $270 million, exceeding the first threshold of the competitive-balance tax.
Whether the Blue Jays will consider a six-man rotation or simply want the comfort of more starting pitching, their pursuit of Ponce bolsters the pitching staff of the American League pennant winners. The deal, which is pending a physical, is the latest in a series of moves by AL East teams this winter, with Cease’s signing, Boston’s trade for right-hander Sonny Gray and Baltimore signing closer Ryan Helsley and trading for left fielder Taylor Ward.
Toronto pushed the Los Angeles Dodgers to the precipice in the World Series on the strength of pitches similar to Ponce’s changeup, which has a movement profile similar to the split-fingered fastballs of Gausman and Yesavage. Ponce picked up the pitch over the winter when working out with Boston Red Sox ace Garrett Crochet and New York Mets right-hander Clay Holmes — with whom he played in Pittsburgh — and tinkered with a proper grip that best fit his unusually large hands.
Ponce had spent the previous three seasons in Japan, posting a 4.54 ERA for Nippon Ham and Rakuten over 202 innings. He found his greatest success in Korea, which has been the springboard for Fedde and Merrill Kelly to return to MLB.
Source: www.espn.com – TOP.