---
title: "Tutorial: stock quotes in your AI assistant with a cURL command | FluxOS MCP Blog"
description: "Turn two cURL commands into MCP tools: a stock quote from B3 and Banco Central series such as the Selic rate, inflation and the dollar. Public data, no code."
url: "https://www.fluxosmcp.com/en/blog/tutorial-stock-quotes-in-your-ai-assistant-with-a-curl-command"
lang: "en-US"
---

[Blog](https://www.fluxosmcp.com/en/blog) · Nov 25, 2026 · FluxOS MCP Team

# Tutorial: stock quotes in your AI assistant with a cURL command

[Leia este artigo em português](https://www.fluxosmcp.com/blog/tutorial-cotacoes-da-bolsa-no-assistente-de-ia-com-um-comando-curl)

Almost every API’s documentation has an example that starts with `curl`. That example is all you need to create an MCP tool: no specification, no code.

In this tutorial, two commands become two tools for your AI assistant: the **quote for a stock on B3** (Brazil’s stock exchange) and the **Banco Central series** (Selic, IPCA, dollar) published by Brazil’s central bank.

## The two sources

**brapi.dev** publishes quotes from the Brazilian stock exchange. An honest warning: when we tested it, the request without a token worked for some tickers (PETR4, VALE3, ITUB4 and MGLU3) and asked for a token for others. For this test, stick to those four. For real use, create an account there and register the token as the system’s credential.

**Banco Central (SGS)** publishes thousands of time series, each with a code. Three useful ones to start with:

- **432**: target for the Selic rate (Brazil’s benchmark interest rate)
- **433**: IPCA (Brazil’s official inflation index), monthly change
- **1**: US dollar (PTAX, the official exchange rate, selling)

No sign-up required.

## Step 1: create the two systems

Each system has one base URL, so that means two records in **Sistemas → Novo sistema** (Systems → New system), both with source type **cURL** and credential **Nenhuma** (None):

- **Stock market (brapi)**, base URL `https://brapi.dev`
- **Banco Central (SGS)**, base URL `https://api.bcb.gov.br`

## Step 2: paste the stock market command

In the brapi system, click **Criar e importar** (Create and import) and, on the **Colar conteúdo** (Paste content) tab, paste this into the **Comandos cURL** (cURL commands) field:

```bash
curl 'https://brapi.dev/api/quote/{{ticker}}'

```

The part between double braces is what does the magic: **everything you mark this way becomes an argument of the tool**. The assistant will fill in `ticker` with the stock’s symbol.

Click **Ler origem** (Read source). The proposed tool is called `get_api_quote_por_ticker`.

## Step 3: give it a human name and description

The generated name is technical and the description is “Chama GET /api/quote/{ticker}” (Calls GET /api/quote/{ticker}). The assistant can’t guess what that does. Replace them with:

- **Nome** (Name): `consultar_cotacao`
- **Descrição** (Description): “Returns the most recent quote for a stock on B3\. Provide the stock’s symbol in `ticker`, for example PETR4 or VALE3.”

Mark it as **Global** (a quote is public data, it doesn’t belong to a client) and create the “Market” server, with the address `mercado`.

## Step 4: repeat with the Banco Central

In the Banco Central system, paste:

```bash
curl 'https://api.bcb.gov.br/dados/serie/bcdata.sgs.{{codigo}}/dados/ultimos/{{quantidade}}?formato=json'

```

Here there are two arguments: the series code and how many values to fetch. Adjust:

- **Nome**: `consultar_serie_banco_central`
- **Descrição**: “Returns the latest values of a Banco Central series. In `codigo`, use 432 for the Selic target, 433 for monthly IPCA or 1 for the PTAX dollar rate. In `quantidade`, how many recent values to fetch.”

The screen will offer `path:codigo`, `path:quantidade` and `query:formato` as the client filter. None of them is one: mark it **Global**. In the summary, choose the **Market** server you already created.

Putting the codes in the description is the trick of this tutorial. The assistant doesn’t know that 432 is the Selic; the description teaches it.

## Publish and hand over a key

From here on, the path is the same as for any server:

1. In **Servidores MCP** (MCP servers), open the server and click **Publicar** (Publish).
2. In **Clientes → Novo cliente** (Clients → New client), create a test client (it can be “Internal test”).
3. On the client’s **Acesso e portal** (Access and portal) tab, use **Liberar servidor** (Grant server access) and set a low cap, for example 10 calls per minute.
4. On the **Chaves** (Keys) tab, create a **Nova chave** (New key). It is shown only once: copy it right away.

The server’s **Conexão** (Connection) tab shows the MCP address and a sample configuration. The key goes in the `Authorization: Bearer` header. Make sure your assistant lets you set that header: FluxOS MCP authenticates by key and does not use OAuth.

## Test

- “What is PETR4 trading at right now?”
- “How has the IPCA behaved over the last six months?”
- “Compare the dollar’s change over the last week with VALE3’s.”

The last one uses both tools in the same answer. That is where the assistant stops being a search box and starts cross-referencing sources.

## Cautions

- **This is not investment advice**, and the quote may be delayed. Use it to learn, not to trade.
- **A credential never goes in the command.** If you paste a `curl` with `Authorization` or an API key, the importer deliberately omits those values: authentication lives in the system’s credential, stored in the vault.
- **No marker, no argument.** A command without double braces becomes a tool that always makes the same call.

## Next tutorial

And when the API is GraphQL? Then you don’t even need the command: [the whole schema becomes tools on its own](https://www.fluxosmcp.com/en/blog/tutorial-turn-a-public-graphql-api-into-an-ai-tool).
