Vietnam Tax & Legal MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Vietnam Tax & Legal MCP Server
Production-Grade Legal and Tax Retrieval Infrastructure for AI Agents
Jurisdiction: Vietnam (Asia/Ho_Chi_Minh)
Target Domains: Thuế (VAT, CIT, PIT, FCT...), Kế toán, Hóa đơn điện tử, Quản lý thuế, Doanh nghiệp & Hải quan.
Specification: v1.1 Practical / Consistent
1. Core Safety Invariants
This system is built around strict legal data invariants:
draft != effective
issued != effective
latest != currently applicable
semantic similarity != legal authority
LLM inference != legal evidence
document-level validity != every provision validity
source authority != legal/instrument authorityIf the system cannot prove a legal conclusion with verified official snapshot evidence:
answerable = falseRelated MCP server: 갈피 법령조회 MCP
2. Architecture & Components
OFFICIAL SOURCES
(Công báo CP, VBPL, Bộ Tài chính...)
│
▼
packages/ingestion (Connectors + Checkpoints)
│
▼
packages/source-storage (MinIO / S3 Immutable Snapshots)
│
▼
packages/parser (Metadata + Điều/Khoản + Evidence)
│
▼
packages/canonicalization (Deduplication + Canonical ID)
│
▼
packages/verification (Rules A, B, C, D + Conflict Checks)
│
┌────────────────┴────────────────┐
▼ ▼
packages/legal-state packages/search
status_at(document/provision, date) Exact + PostgreSQL FTS
│ │
└────────────────┬────────────────┘
▼
packages/legal-query
│
▼
apps/mcp-server
(stdio / streamable HTTP)
│
▼
AI Agent3. The 4 MCP Legal Tools (MVP)
Tool | Purpose | Key Input |
| Retrieve recent legal events and status changes (published, effective, amended, repealed) |
|
| Search legal documents by keywords, document number, issuer, and tax topics |
|
| Retrieve full canonical details (provisions, sources, snapshots, relationships) |
|
| Retrieve effective rules & official guidance evaluated at |
|
4. Repository Structure
mcp-ai-tax/
├── apps/
│ ├── mcp-server/ # MCP Server (stdio / HTTP)
│ └── worker/ # Periodic Ingestion Worker
│
├── packages/
│ ├── common/ # Taxonomies, Types, Result Contracts, Errors
│ ├── observability/ # Structured logger (pino) & Audit trail
│ ├── db/ # Drizzle ORM Schema (13 tables) & PostgreSQL Client
│ ├── source-storage/ # S3/MinIO Client, Hasher (SHA-256), Snapshot Manager
│ ├── canonicalization/ # Canonical ID (VN:ND:...) & Deduplication Engine
│ ├── parser/ # Metadata & Provisions (Điều/Khoản) & Evidence
│ ├── ingestion/ # Source Connectors (Công báo RSS), Checkpoints
│ ├── verification/ # Verification Engine (Rules A, B, C, D)
│ ├── legal-state/ # Temporal Legal State Engine (status_at)
│ ├── search/ # Exact number match & PostgreSQL FTS
│ └── legal-query/ # Core Query Orchestration Service
│
├── migrations/ # Initial SQL Migrations
├── tests/
│ ├── golden/ # Acceptance Golden Scenarios
│ └── unit/ # Unit Tests (Parser, Verification, Canonicalization)
│
├── docker/ # Multi-stage Dockerfile
├── docker-compose.yml # PostgreSQL 17, MinIO, MCP Server & Worker
├── package.json
├── pnpm-workspace.yaml
└── tsconfig.json5. Getting Started
Prerequisites
Node.js 20+
pnpm 10+
Docker & Docker Compose
Local Development
Install dependencies:
pnpm installRun tests:
pnpm testStart infrastructure via Docker Compose:
docker compose up -d postgres minioRun migrations:
pnpm db:migrateStart MCP Server locally (stdio mode):
pnpm mcp
6. Production Security & Secret Hygiene
Secret Management
Zero Default Credentials: Never deploy with local sandbox credentials (
minioadmin/minioadminorpostgres:postgres).Secret Injection: In production, inject credentials at container launch via AWS Secrets Manager, HashiCorp Vault, or Kubernetes Secrets.
TLS/SSL Encryption: Enforce encrypted transport (
sslmode=requireonDATABASE_URLandhttps://forOBJECT_STORAGE_ENDPOINT).Private Subnets: Deploy database and object storage inside private VPC subnets with no public ingress.
SSRF Defense: The ingestion connector strictly enforces official government domain allowlists (
congbao.chinhphu.vn,*.mof.gov.vn, etc.) and re-validates each redirect hop.ALLOW_LOCAL_FETCH=falseis mandatory in production.
7. Quality Metrics & Benchmark Verification
Run the CI quality dashboard directly:
pnpm metricsExecute full backup and 100% object storage integrity scan:
pnpm backup:testRun live E2E 4-tools verification:
pnpm exec tsx --env-file=.env scripts/test-mcp-live.ts8. License
Internal / Proprietary production specification.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Semantic retrieval across 295,000+ Indonesian regulations and 5.6M+ legal provisions, updated daily. Give AI direct access to Indonesian regulatory knowledge before reasoning.
Vietnam public-tender search (VNEPS) for AI agents, pay per use.
Vietnam MISA meInvoice: AI agents create, publish and query e-invoices, stateless BYO.
Search and read Vietnamese law — 150,000+ documents, cited to the exact Điều and Khoản.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides AI assistants with up-to-date legal documents from official sources, enabling accurate legal information retrieval and analysis.21AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search and retrieve Korean laws, regulations, administrative rules, legal interpretations, and precedents via official APIs for legal review workflows.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query a structured Vietnamese legal knowledge graph, retrieving articles, definitions, outlines, and document lists with original-text citations and effective status via MCP tools.Apache 2.0
- AlicenseAqualityBmaintenanceKorean tax law for AI agents: search NTS rulings, court and Tax Tribunal decisions; read point-in-time statutes with the Act → Decree → Rule chain and amendment history; basic rules and execution standards; 96 tax treaties with withholding rates; forms and schedules; and verify citations in drafts. Fact-pattern comparison is done by your AI (or optional on-prem/cloud Upstage Solar).4545,624 PyPI11MIT