VNStock Agent logo

VNStock Agent

Community
mrgoonie

MCP server and CLI for Vietnamese stock market data (vnstock)

Publishermrgoonie
Repositoryvnstock-agent
LanguagePython
Forks
43
Stars
104
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    VNStock Agent exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    104 stars and 43 forks from the linked repository.

VNStock Agent

MCP server and CLI for Vietnamese stock market data. Integrates vnstock with AI tools via Model Context Protocol (MCP).

Features

  • 21 MCP tools for AI assistants (Claude, GPT, etc.)
  • 22 CLI commands for terminal use
  • 3 MCP transports: stdio, SSE, Streamable HTTP
  • Vietnamese stocks, forex, crypto, world indices, mutual funds
  • Historical prices, financials, company info, trading data

Quick Start

Install

bash
pip install vnstock-agent

Or from source:

bash
git clone https://github.com/mrgoonie/vnstock-agent.git
cd vnstock-agent
pip install -e .

Set API Key

bash
export VNSTOCK_API_KEY=your_api_key_here

Get a free API key at vnstocks.com/login.

CLI Usage

bash
# Stock history
vnstock-agent history VNM --start 2025-01-01 --end 2025-03-31

# Company overview
vnstock-agent overview FPT

# Financial statements
vnstock-agent balance-sheet VCB --period quarter
vnstock-agent income VCB --period annual
vnstock-agent cashflow VCB
vnstock-agent ratio VCB

# Market data
vnstock-agent symbols                    # All listed symbols
vnstock-agent group --group VN30         # VN30 stocks
vnstock-agent board "VNM,FPT,ACB,VCB"   # Price board
vnstock-agent industries                 # ICB industries

# Company details
vnstock-agent shareholders FPT
vnstock-agent officers FPT
vnstock-agent news FPT
vnstock-agent events FPT

# Intraday & depth
vnstock-agent intraday VNM --page-size 200

# Global markets
vnstock-agent fx EURUSD --start 2025-01-01
vnstock-agent crypto BTC --start 2025-01-01
vnstock-agent index DJI --start 2025-01-01

# Mutual funds
vnstock-agent funds

# JSON output
vnstock-agent --format json history VNM

MCP Server

stdio (for Claude Desktop, Cursor, etc.)

Add to your MCP client config:

json
{
  "mcpServers": {
    "vnstock": {
      "command": "vnstock-mcp",
      "env": {
        "VNSTOCK_API_KEY": "your_api_key_here"
      }
    }
  }
}

SSE Transport

bash
VNSTOCK_MCP_TRANSPORT=sse VNSTOCK_MCP_PORT=8000 vnstock-mcp

Streamable HTTP Transport

bash
VNSTOCK_MCP_TRANSPORT=http VNSTOCK_MCP_PORT=8000 vnstock-mcp

Or via CLI:

bash
vnstock-agent serve --transport sse --port 8000
vnstock-agent serve --transport http --port 8000

MCP Tools

ToolDescription
stock_historyHistorical OHLCV price data
stock_intradayToday's intraday trading data
stock_price_depthOrder book / bid-ask data
company_overviewCompany overview info
company_shareholdersMajor shareholders
company_officersManagement team
company_newsCompany news
company_eventsDividends, AGM, etc.
financial_balance_sheetBalance sheet
financial_income_statementIncome statement
financial_cash_flowCash flow statement
financial_ratioP/E, P/B, ROE, ROA, etc.
listing_all_symbolsAll listed symbols
listing_symbols_by_groupVN30, HNX30, etc.
listing_symbols_by_exchangeBy exchange (HOSE, HNX, UPCOM)
listing_industriesICB industry classification
trading_price_boardReal-time price board
fx_historyForex historical data
crypto_historyCryptocurrency data
world_index_historyWorld market indices
fund_listingMutual fund listing

Environment Variables

VariableDefaultDescription
VNSTOCK_API_KEY(none)VNStock API key
VNSTOCK_SOURCEVCIDefault data source (VCI, KBS)
VNSTOCK_MCP_TRANSPORTstdioMCP transport (stdio, sse, http)
VNSTOCK_MCP_HOST0.0.0.0Server host
VNSTOCK_MCP_PORT8000Server port

Development

bash
git clone https://github.com/mrgoonie/vnstock-agent.git
cd vnstock-agent
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check src/

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "vnstock-agent": {
      "command": "vnstock-mcp",
      "args": [],
      "env": {
        "VNSTOCK_API_KEY": "<VNSTOCK_API_KEY>"
      }
    }
  }
}

Use VNStock Agent MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once VNStock Agent is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add VNStock Agent as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the VNStock Agent MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "vnstock-agent": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the VNStock Agent MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the VNStock Agent MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use VNStock Agent to help me with this task?
VNStock Agent
Sure. I read it.
Here is what I found using VNStock Agent.

Frequently asked questions

What is the VNStock Agent MCP server used for?

VNStock Agent is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use VNStock Agent MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use VNStock Agent with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use VNStock Agent MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With VNStock Agent connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect VNStock Agent MCP to TypingMind?

VNStock Agent runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does VNStock Agent MCP provide in TypingMind?

VNStock Agent exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use VNStock Agent MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If VNStock Agent requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇