DEV Community

Cover image for How to give Claude a live SGX stock-lookup tool with the Apify MCP server
Michael
Michael

Posted on • Originally published at scrapers.lat

How to give Claude a live SGX stock-lookup tool with the Apify MCP server

AI agents are good at reasoning and terrible at facts. Ask Claude what DBS Group is trading at on the Singapore Exchange, and it will give you a confident number pulled from training data that is months or years stale. For anything market-facing, that is worse than useless. A price that was right in some past quarter, presented as if it were today, is a mistake waiting to be quoted in a memo.

In this guide we fix that. We connect Claude to the official Apify MCP server, expose a single Actor that reads Singapore Exchange (SGX) listings and quotes, and turn "what is this stock doing?" from a guess into a live lookup. By the end you will have a working equity-lookup tool that Claude, Cursor, or any MCP client can call mid-conversation, and you will understand exactly where in the run the tool fires and what it returns.

Everything below is a real setup with real output. No mocked responses.

What is the Apify MCP server?

Model Context Protocol (MCP) is an open standard that lets AI clients call external tools. The Apify MCP server (https://mcp.apify.com) implements that standard on top of the Apify platform, which means every one of the thousands of Actors in the Apify Store becomes a tool an agent can invoke.

Why route an Actor through MCP instead of hard-coding an API call?

  • The agent decides when to fetch. Claude reads the conversation, notices it needs a number it does not have, and calls the tool on its own. You do not write glue code for every question.
  • Structured input and output. The MCP server hands Claude the Actor's input schema, so the model fills in the parameters correctly, and returns a clean dataset it can reason over.
  • One connection, many tools. The same MCP endpoint exposes search-actors, fetch-actor-details, and call-actor, so an agent can discover and run any Actor without new configuration.
  • No infrastructure. The server is hosted. You add a few lines to a config file and you are done.

The Actor we will use

We will expose the Singapore SGX Listed Companies & Stock Price Scraper. It covers the full SGX board, more than 1,200 securities, and returns a structured quote for each one: name, ticker symbol, security type (stock, ETF, REIT, business trust, warrant, leveraged certificate), last price, change and percent change, previous close, open, day high and low, bid and ask with sizes, volume, traded value, and the last traded date.

That field set is exactly what an APAC equity desk, a fintech app, or an investor doing quick diligence actually needs: the identifier, the price, the range, and the liquidity, all in one call. SGX is a useful market to wire up first because the board is broad, the data is public, and there is no login wall.

The Singapore SGX Listed Companies & Stock Price Scraper on the Apify Store

Step 1: Get your Apify API token

Sign in to the Apify Console, open Settings → Integrations, and copy your personal API token. The MCP server uses it to authenticate and to bill Actor runs to your account.

📌 Note: the token is a secret. Keep it in the client config only, never in a prompt or a committed file.

Step 2: Point Claude Desktop at the Apify MCP server

Open Claude Desktop's config file (Settings → Developer → Edit Config, or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add the Apify server. The tools query parameter is the important part: it tells the server which Actor to expose, so Claude gets one focused tool instead of the entire Store.

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=scrapers_lat/singapore-sgx-listed-companies-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor uses the same JSON in .cursor/mcp.json. If you prefer to run it locally over stdio instead of the hosted endpoint:

{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--tools", "scrapers_lat/singapore-sgx-listed-companies-scraper"],
      "env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Desktop so it picks up the new server.

Step 3: Confirm the tool is loaded

After the restart, the Actor shows up as a callable tool. If you list the tools the Apify server exposes, you will see the storage helpers plus the Actor itself, named after its Store handle:

get-actor-run, get-dataset-items, get-key-value-store-record,
abort-actor-run, scrapers_lat--singapore-sgx-listed-companies-scraper
Enter fullscreen mode Exit fullscreen mode

That last entry, scrapers_lat--singapore-sgx-listed-companies-scraper, is our equity-lookup tool. Claude now knows it exists, what it does (from the Actor's README), and what inputs it takes (from the input schema the server passes along).

Step 4: Ask Claude for a live quote

Now the payoff. In a normal chat, ask a question that requires current market data:

"What is DBS Group trading at on the SGX right now? Give me the ticker, last price, day range and volume."

Claude recognizes it cannot answer this reliably from memory, selects the SGX tool, and fills in the input from your question. Under the hood the client sends a tools/call with the Actor's parameters:

{
  "name": "scrapers_lat--singapore-sgx-listed-companies-scraper",
  "arguments": {
    "searchQuery": "DBS",
    "maxSecurities": 10
  }
}
Enter fullscreen mode Exit fullscreen mode

The Apify MCP server starts the Actor, waits for it to finish, and returns the dataset. Here is the real run metadata it produced:

{
  "runId": "ce2AjEGTFCTgyZlDf",
  "actorName": "scrapers_lat/singapore-sgx-listed-companies-scraper",
  "status": "SUCCEEDED",
  "startedAt": "2026-07-30T17:47:07.262Z",
  "finishedAt": "2026-07-30T17:47:12.091Z",
  "stats": { "runTimeSecs": 4.8 }
}
Enter fullscreen mode Exit fullscreen mode

Under five seconds, live against SGX.

Step 5: Read the real output

The dataset the tool returns is structured quote data. This is an actual record from the run, the DBS common stock:

{
  "name": "DBS",
  "symbol": "D05",
  "type": "Stock",
  "lastPrice": 74.85,
  "change": -0.15,
  "changePercent": -0.2,
  "previousClose": 75,
  "open": 74,
  "dayHigh": 74.94,
  "dayLow": 74,
  "bid": 74.84,
  "ask": 74.85,
  "volume": 288663494.276,
  "lastTradedDate": "2026-07-29",
  "source": "Singapore Exchange (SGX)"
}
Enter fullscreen mode Exit fullscreen mode

Claude reads that and answers in plain language: DBS trades under ticker D05, last price S$74.85, down 0.20% from the S$75.00 previous close, in a 74.00 to 74.94 day range, on volume of roughly 288.7 million shares. Every one of those numbers is traceable to a live SGX quote, not the model's memory.

Claude calling the SGX tool and answering with live quote data

The breadth of the response matters too. Because the tool matched every security whose name contains "DBS," the same call also returned DBS-linked daily leverage certificates and structured warrants, each with its own symbol, price, and expiry date. An agent that needs only the common stock can filter on "type": "Stock"; one building a derivatives view already has the rest in hand.

A real use case: a morning-brief research agent

Put this in context. An APAC equity analyst starts the day with a watchlist of a dozen SGX names and wants a one-paragraph brief on each before the desk meeting: where it opened, where it is now, the day range, and whether volume is unusual. Doing that by hand means opening a quote page per ticker and copying numbers into a note.

With the tool wired into Claude, the analyst pastes the watchlist into the chat and asks for the brief. Claude calls the Actor per name, pulls the last price, change, and volume, and writes the summary in one pass, flagging any name that is down more than a set threshold or trading well above its usual turnover. The mechanical part, the twelve lookups, disappears. The judgment about what is worth watching stays with the analyst.

This is the shape of every good agent tool: it removes the mechanical fetch, not the decision.

Going further: chain a second tool

Price data rarely stands alone. An investor who sees a name move usually wants to know who is behind it. The same MCP connection can expose more Actors by extending the tools parameter:

https://mcp.apify.com?tools=scrapers_lat/singapore-sgx-listed-companies-scraper,scrapers_lat/singapore-acra-entities-scraper
Enter fullscreen mode Exit fullscreen mode

Now the agent can pull the live SGX quote and look up the underlying legal entity in Singapore's ACRA company registry in the same conversation, matching the traded name to its registration details, then combine both into one profile. Because each Actor is a separate tool, the agent picks the right one for each step on its own: the SGX tool for the market data, the Singapore ACRA Company Registry Scraper for the corporate identity behind it.

🏹 Troubleshooting: if the tool does not appear in Claude, the two usual causes are a missing or misspelled Actor handle in the tools parameter (it must be the exact username/actor-name from the Store URL) and a config that was edited while Claude was running. Fix the handle, save, and fully restart the client.

📌 Note: each tool call is a real Actor run billed to your Apify account (this Actor is pay-per-result). For an interactive lookup the cost is a fraction of a cent; if you plan to snapshot the whole board on a schedule, run the Actor directly through the Apify API or a scheduled task instead of one call per chat message.

Wrapping up

You now have an AI agent that can quote any SGX-listed security on demand, mid-conversation, with the ticker, price, range, and liquidity a research or investment workflow actually needs. The pattern is reusable: pick an Actor that returns authoritative structured data, expose it through the Apify MCP server with the tools parameter, and let the agent decide when to call it.

To take it further:

  • Swap in a different market or dataset by changing the Actor handle. The setup is identical.
  • Add company-registry, filings, or news Actors to build a multi-step research agent.
  • Read the Apify MCP server docs for OAuth setup, resource reads, and the search-actors / call-actor tools that let an agent discover Actors it was not preconfigured with.

The Actor used in this guide: Singapore SGX Listed Companies & Stock Price Scraper.

Top comments (0)