Skip to main content

An MCP server exposing tools to access Vietnam stock market data built on top of vnstock and mcp

Project description

VNStock MCP Server

An MCP server exposing tools to access Vietnam stock market data built on top of vnstock and mcp.

Installation

Install from PyPI (Recommended)

pip install vnstock-mcp-server

Install from source

git clone https://github.com/maobui/vnstock-mcp-server.git
cd vnstock-mcp-server
uv sync

Prerequisites

  • Python 3.10+
  • uv (install with pip install uv or see https://docs.astral.sh/uv/)

Quick Start

Run the MCP server

# If installed from PyPI
vnstock-mcp-server

# If installed from source with uv
uv run python -m vnstock_mcp.server

The server uses FastMCP and will be ready to accept connections from MCP clients.

MCP client integration

Cursor / Cline example

Add a server entry in your MCP configuration:

{
  "mcpServers": {
    "vnstock": {
      "command": "vnstock-mcp-server"
    }
  }
}

If installed from source:

{
  "mcpServers": {
    "vnstock": {
      "command": "uv",
      "args": ["run", "python", "-m", "vnstock_mcp.server"],
      "env": {}
    }
  }
}

Claude Desktop example

In MCP server settings:

  • Command: vnstock-mcp-server
  • Args: (leave empty)

Development

Install with uv (for development)

# From the project root
uv sync

# Include dev dependencies (for tests and coverage)
uv sync --group dev

Testing with uv

# Run all tests
uv run pytest

# Run a specific test file
uv run pytest test/test_company_tools.py

# Run with coverage (HTML)
uv run pytest --cov=src/vnstock_mcp --cov-report=html
# Open report:
#   ./htmlcov/index.html

Building and Publishing

Build locally

# Using the build script
./scripts/build.sh

# Or manually
python -m build

Create a release

# Update version in pyproject.toml first, then:
./scripts/release.sh

This will:

  1. Run tests
  2. Create and push a git tag
  3. Trigger GitHub Actions to build and publish to PyPI

Troubleshooting

  • Module not found with uv run:
    • Ensure uv sync completed successfully in the project root.
    • Verify Python version: python --version and uv python list.
  • MCP client cannot connect:
    • Confirm the client configuration matches the installation method
    • Check client logs for detailed errors.
  • Command vnstock-mcp-server not found:
    • Ensure the package is installed: pip list | grep vnstock-mcp-server
    • Try reinstalling: pip install --upgrade vnstock-mcp-server

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run tests: uv run pytest
  6. Submit a pull request

Changelog

v1.0.0

  • Initial release
  • Full Vietnam stock market data access via MCP
  • Support for company data, financial statements, quotes, and more

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vnstock_mcp_server-1.0.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vnstock_mcp_server-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file vnstock_mcp_server-1.0.0.tar.gz.

File metadata

  • Download URL: vnstock_mcp_server-1.0.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for vnstock_mcp_server-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5663eddb2927c00919d580ececf7d94d75402abbed806525fe215e1eed0830bc
MD5 2652efb25f036afa52ab8db8306998ee
BLAKE2b-256 873a4e594e06aa5d0e6549b95857619a21a9134a6c4b1a56cc7f11a18fed0a81

See more details on using hashes here.

File details

Details for the file vnstock_mcp_server-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vnstock_mcp_server-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd61a8e823fa9ad5b13a20ed1f505cfd098249f8a2c13d7fb3eb924d489c3274
MD5 8f97e45e0f0aa13b1c90b52c7ab70c9f
BLAKE2b-256 a9a187497a89c245e1f069af304057e215cc260a65a19494503e3dded388b308

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page