· 6 min read

Banking On MCP

One small step for LLMs, one giant leap for AI

One small step for LLMs, one giant leap for AI

The Model Context Protocol has been killing it over the past few months. There’s no doubt about that. Touted as the “USB-C Port” for AI-based applications - probably for the hundredth time by now - MCP is definitely a major disruptor in the industry.

At first glance, MCP’s definition as a protocol that enables data and models to be shared and interacted with in a structured, context-aware manner sounds a bit bland. In reality, it’s the missing piece in the AI puzzle that’s already creating a significant leap forward in how we build and use intelligent systems.

What the Heck is MCP?

Back in late 2022 - although it already feels like a decade ago - all we had were large language models like ChatGPT, which were astonishing but self-contained. You had to spoon-feed them your context every time, prompt engineering was more art than science, and integrating local or personal data into your workflows was clunky at best.

Fast forward to now, and we have MCP: a way to give LLMs memory, context, and agency by connecting them to structured data and live tools. Instead of asking “what’s the weather” and getting some cached internet response, now a model can securely and consistently query your own sources. That’s huge. Pretty much any common integration is already available - From Github to Slack to ffmpeg, just pick your weapon.

From Theory to Practical Magic

After all this praise, I had to get my hands dirty and make something useful of my very own, to really understand if the magic lives up to the hype.

When you think about data democratization - financial data probably stands out as a first-class citizen. The financial data here in Israel is spread across different institutions, with a so-called open banking protocol that leaves much to be desired. It doesn’t allow the average Joe to freely consume and process it the way they like.

Every month, my credit card statements arrive, and like most people, I ignore them until something goes wrong. Enter a great open source project that serves as a data hub for financial data.

What could make it even more useful? You guessed it - MCP.

So I wrote a tiny scraper that pulls charges from my provider and dumps them into a local SQLite database. Nothing fancy.

Then, using Claude Desktop as an MCP client, I connected it via a local MCP server. And just like that, I could ask it questions like:

  • “How much did I spend on coffee last month?”
  • “Flag any suspicious charges over $100.”

The model could reason over my actual data without me exporting CSVs or building custom dashboards. It felt like having a smart assistant that truly understands my data.

Just a thin layer is all that is required to be able to utilize a powerful LLM reasoning and gain meaningful insights from your data.

Let’s Walk Through Some Code

The implementation is rather straightforward - we’ll expose a scrapeTransactions function that scrapes the information and puts it in a local DB. A standalone SQLite MCP server is already available, so virtually nothing more than a mere configuration json is needed to fire everything up.

The DB access layer is straightforward: we’ll define an initializeDatabase function that creates the transaction table according to he structure received from the scraper, as well as a saveTransactions function that persists the fetched data.

Now comes the fun part: We’ll define a class called CreditCardServer, and use the Model Context Protocol Typescript SDK to declare a McpServer.

The server is initialized within the constructor:

constructor() {
    this.server = new McpServer({
      name: 'credit-card-mcp-server',
      version: '0.1.0',
    });

    this.setupTools();

    this.server.server.onerror = (error: Error) => console.error('[Error]', error);
    process.on('SIGINT', async () => {
      await this.server.close();
      process.exit(0);
    });
  }

Now we need to implement the setupTools function which will expose the scrapeTransactions functionality, as well as a structured prompt that will instruct the model how to handle the scraped data:

private setupTools() {
    this.server.tool(
      "scrapeTransactions",
      {
        startDate: z.string().describe('Start date for fetching transactions (YYYY-MM-DD)'),
      },
      this.scrapeTransactions.bind(this)
    );

    this.server.prompt(
      "fetch-last-month-transactions",
      () => ({
        messages: [
          {
            role: "user",
            content: {
              type: "text",
              text: `Fetch transactions from the last month and calculate the total expenses. Make sure to:
                      1. Query the database for transactions within the last month's date range
                      2. Filter for expenses (negative amounts)
                      3. Sum up the total expenses
                      4. Return a summary including:
                        - Total expenses amount
                        - Number of transactions
                        - List of transactions with dates and amounts`,
            },
          },
        ],
      })
    );
  }

Now all that is left is to implement a function that will fire up the server:

async start() {
    await this.initializeDatabase().catch(console.error);
    const transport = new StdioServerTransport();
    await this.server.connect(transport);
    console.error('Credit Card MCP server running on stdio');
  }

To let Claude get acquainted with our server, we will configure it through claude_desktop_config.json. Remember we need to also add the SQLite MCP Server to let Claude access the fetched information.

{
  "mcpServers": {
    "credit-card-transactions": {
      "command": "/path/to/tsx",
      "args": [
        "/path/to/israeli-bank-scrapers-mcp-demo/src/server.ts"
      ],
      "cwd": "/path/to/israeli-bank-scrapers-mcp-demo",
      "env": {
        "BANK_USERNAME": "USER",
        "BANK_PASSWORD": "PASS",
        "DB_PATH": "/path/to/transactions.db"
      }
    },
    "CC Transactions Sqlite": {
      "command": "/path/to/uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "fastmcp",
        "run",
        "/path/to/sqlite-explorer-fastmcp-mcp-server/sqlite_explorer.py"
      ],
      "env": {
        "SQLITE_DB_PATH": "/path/to/transactions.db"
      }
    }
  }
}

Now, sit back and observer the magic: Claude will connect to the server, and if all goes well it will list your brand new tools, plus the structured prompt we defined earlier.

Tools Tools

Let’s invoke it and observe how Claude starts getting acquainted with our db, scrape our credit card transactions if necessary, and build the relevant query to fetch the information we requested. To add a cherry on top, it also renders a pretty cool visualization of the expense data, by categories.

How cool is that?

Analysis

Of course, a production-grade product will have to deal some issues, like proper encryption of the crendentials and the database itself to avoid unauthorized access.

Final Thoughts & Why Developers Should Care

MCP is more than a spec - it’s a shift in mindset. It encourages us to stop treating LLMs as magic black boxes and start wiring them into systems like any other part of the stack.

Hopping on the bandwagon yesterday is paramount for developers looking to create relevant products in today’s market, products that integrate and democratize data in ways that could not be imagined just a short while ago.

So if you’re a developer, now’s the time to get your hands dirty. Start with a toy project. Hook an LLM into your calendar, your codebase, your fridge - whatever. Just start. The future of AI isn’t coming. It’s already here, and it’s context-aware.

The full code is available at:

A Model Context Protocol (MCP) server that demonstrates how to scrape financial data using the israeli-bank-scrapers library
JavaScript
1
0
0
May 6, 2025

Enjoy!

[Top]

Back to Blog