Data Science In Action

Data Science In Action

[Tutorial] API vs MCP

Currency Converter Python project via API vs via MCP in a step‑by‑step tutorial to show the difference

Engy Fouda's avatar
Engy Fouda
Jul 13, 2026
∙ Paid

What is the difference between API and MCP?

MCP and APIs both let software interact with other systems, but they serve very different purposes:

  • APIs are built for developers

  • MCP is built for AI models.

MCP exists because AI models cannot reliably use APIs on their own.

Data Science In Action is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.


API (Application Programming Interface)

  • A set of rules that lets software talk to software.

  • Designed for developers to request data or trigger actions.

  • Requires explicit coding: endpoints, authentication, error handling, etc.

  • Example:

GET https://api.github.com/users/username 

This returns structured JSON.

MCP (Model Context Protocol)

  • A protocol designed so AI models can safely interact with tools, data, and systems.

  • AI models cannot make real network requests or handle tokens, headers, or API formats.

  • MCP exposes “tools” with schemas that define the model’s inputs and outputs.

  • Acts as a bridge between an AI model and the real world.


When to Use Which

Use APIs when:

  • You’re building software integrations

  • You need predictable, stable, repeatable workflows

  • A human developer is writing the logic

Use MCP when:

  • You want an AI model to interact with your systems

  • You need dynamic, model-driven workflows

  • You want strict control over what the model can do

    Share Data Science In Action


PROJECT: Currency Converter

Let’s build a clean, real‑world example, perfect for learning both workflows, a currency conversion project:

  1. Using a normal API key in Python

  2. Wrapping the same functionality in an MCP server


We’ll build:

  • Part A: A Python script that uses an API key to convert USD → EUR

  • Part B: An MCP server that exposes a tool called convertCurrency. So an AI model can do the same conversion safely

Everything is step‑by‑step and runnable.

Refer a friend


PART 1: Using a Currency API Directly

We’ll use ExchangeRate‑API, which has a free tier and simple keys.


Step 1.1: Create an account and get your API key

  1. Go to the ExchangeRate‑API website

  2. Click Sign Up

  3. Create an account

  4. Go to your Dashboard → API Keys

  5. Copy your key

Share

User's avatar

Continue reading this post for free, courtesy of Engy Fouda.

Or purchase a paid subscription.
© 2026 Engy Fouda · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture