Vietnamese Stock Market MCP Server - FastMCP 2.0
Project description
VNStock MCP Server
The unofficial MCP server that provides Vietnamese stock market financial data, allowing you to interact with your Claude Desktop using natural language processing capabilities.
Features
- ๐ Dual Transport Support: Auto-detects STDIO (local) or HTTP (cloud) transport
- โ๏ธ Cloud Deployment: One-click deploy to Render.com free tier
- ๐ค LLM-Powered: Natural language processing with Anthropic Claude
- ๐ Beautiful Output: Formatted tables, charts, and data visualization
- ๐ง Tool Management: Automatic tool discovery and validation
- ๐ฏ Smart Parsing: Vietnamese stock symbol and date format support
- โก Error Handling: Robust error recovery and user-friendly messages
Quick Start
1. Installation
For End Users (Recommended)
# Install from PyPI and run directly
uvx vnstock-mcp@latest
For Developers
# Clone the repository
git clone https://github.com/gahoccode/vnstock-mcp.git
cd vnstock-mcp
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
2. Run the Server
End Users (uvx method)
# Run directly from PyPI
uvx vnstock-mcp@latest
Developers (local development)
# Run from source
uv run python src/vnstock_mcp/server.py
Usage Examples
> Show me FPT's financial statements for 2024
> What are HPG's key financial ratios?
> Get VCB exchange rates for today
Project Structure
vnstock-mcp/
โโโ pyproject.toml # Project configuration and dependencies
โโโ src/
โ โโโ vnstock_mcp/ # Python package
โ โโโ __init__.py # Package initialization
โ โโโ server.py # MCP server (API Layer)
โ โโโ config.py # Configuration constants
โ โโโ exceptions.py # Custom exceptions
โ โโโ core/ # Service Layer (business logic)
โ โ โโโ base.py # BaseService with async patterns
โ โ โโโ financial.py
โ โ โโโ company.py
โ โ โโโ fund.py
โ โโโ models/ # Model Layer (result types)
โ โ โโโ base.py # ServiceResult, DataFrameResult
โ โ โโโ financial.py
โ โ โโโ company.py
โ โ โโโ fund.py
โ โโโ utils/ # Utility functions
โ โโโ data_transform.py
โโโ docs/ # Architecture documentation
โ โโโ ARCHITECTURE.md # System architecture overview
โ โโโ adr/ # Architecture Decision Records
โ โโโ 001-layered-architecture.md
โ โโโ 002-result-objects.md
โ โโโ 003-lazy-imports.md
โโโ tests/ # Test suite
โ โโโ __init__.py
โ โโโ conftest.py # Pytest configuration
โโโ dist/ # Built packages
โโโ sample questions/ # Usage examples
โโโ uv.lock # Dependency lock file
โโโ README.md # This file
For detailed architecture documentation, see docs/ARCHITECTURE.md.
uv vs uvx: Which to Use?
uvx (Recommended for Users)
- Purpose: Run Python packages directly from PyPI
- Use case: End users who just want to use the MCP server
- Command:
uvx vnstock-mcp@latest - Benefits:
- No local setup required
- Automatic dependency management
- Isolated execution environment
uv (Recommended for Developers)
- Purpose: Python project and package management
- Use case: Developers who want to modify/contribute to the code
- Command:
uv run python src/vnstock_mcp/server.py - Benefits:
- Full source code access
- Development workflow
- Ability to make changes
Claude Desktop Integration
To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Method 1: Using uvx (if PATH configured)
{
"mcpServers": {
"vnstock-mcp": {
"command": "uvx",
"args": ["vnstock-mcp"]
}
}
}
Method 2: Using uvx (if PATH NOT configured)
{
"mcpServers": {
"vnstock-mcp": {
"command": "/Users/YOUR_USERNAME/.local/bin/uvx",
"args": ["vnstock-mcp"]
}
}
}
Method 3: Development from source (script path)
{
"mcpServers": {
"vnstock-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/USERNAME/PATH_TO/src/vnstock_mcp",
"run",
"server.py"
]
}
}
}
Method 4: Development from source (Python module)
{
"mcpServers": {
"vnstock-mcp": {
"command": "uv",
"args": [
"--directory",
"/Users/USERNAME/PATH_TO/vnstock-mcp",
"run",
"python",
"-m",
"vnstock_mcp.server"
]
}
}
}
Note:
- Replace
YOUR_USERNAMEwith your actual username in Method 2 - Replace
USERNAMEandPATH_TOwith your actual username and path in Method 3 and 4 - After quitting and restarting Claude Desktop, if it still can't detect the mcp server, check if
uvxis in your PATH. If not, add~/.local/binto your PATH:
# For zsh (macOS default)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Publishing to PyPI
For maintainers, use the automated publish script:
# Set UV_PUBLISH_TOKEN in .env file, then run:
python dev/publish.py
Or publish manually:
uv publish --token $UV_PUBLISH_TOKEN
License
This project is part of the vnstock-mcp ecosystem. See the main repository for licensing information.
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-0.3.0.tar.gz.
File metadata
- Download URL: vnstock_mcp-0.3.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
813f763dac3fdc21a2b7c831166c5651d14add42190704b9f83c93bc4243cc9b
|
|
| MD5 |
c643e55fa8ab9ab958ed9eac992afa0d
|
|
| BLAKE2b-256 |
bd6467ced457b2a571102af0cdf3d073b4d1023fefc045f19f9996162b1df3b7
|
File details
Details for the file vnstock_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: vnstock_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a1f8d3f0b09ae2c7e83de2053c10609806208281dba7740368dc4e2422d982f
|
|
| MD5 |
af603d6a3f11cdcc082e45cc4dacf1d5
|
|
| BLAKE2b-256 |
47ce154b4e1d5bec75f09df20e87f986b2ba1cc2853d3966359b6bd5bc8addf3
|