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 uvor seehttps://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:
- Run tests
- Create and push a git tag
- Trigger GitHub Actions to build and publish to PyPI
Troubleshooting
- Module not found with
uv run:- Ensure
uv synccompleted successfully in the project root. - Verify Python version:
python --versionanduv python list.
- Ensure
- MCP client cannot connect:
- Confirm the client configuration matches the installation method
- Check client logs for detailed errors.
- Command
vnstock-mcp-servernot found:- Ensure the package is installed:
pip list | grep vnstock-mcp-server - Try reinstalling:
pip install --upgrade vnstock-mcp-server
- Ensure the package is installed:
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run tests:
uv run pytest - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5663eddb2927c00919d580ececf7d94d75402abbed806525fe215e1eed0830bc
|
|
| MD5 |
2652efb25f036afa52ab8db8306998ee
|
|
| BLAKE2b-256 |
873a4e594e06aa5d0e6549b95857619a21a9134a6c4b1a56cc7f11a18fed0a81
|
File details
Details for the file vnstock_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: vnstock_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd61a8e823fa9ad5b13a20ed1f505cfd098249f8a2c13d7fb3eb924d489c3274
|
|
| MD5 |
8f97e45e0f0aa13b1c90b52c7ab70c9f
|
|
| BLAKE2b-256 |
a9a187497a89c245e1f069af304057e215cc260a65a19494503e3dded388b308
|