home / mcp / vtion e-commerce mcp server

VTION E-Commerce MCP Server

MCP server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "adityac7-vtion-ecom": {
      "url": "http://localhost:10000/mcp",
      "headers": {
        "DATASET_1_DESC": "VTION E-commerce platform analytics data",
        "DATASET_1_NAME": "vtion_ecom",
        "DATASET_1_CONNECTION": "postgresql://postgres:YOUR_PASSWORD@host:5432/db?sslmode=require",
        "DATASET_1_DICTIONARY": "{\"table1\":\"desc\",\"table2\":\"desc\"}"
      }
    }
  }
}

You run a read-only MCP server that exposes VTION E-commerce analytics data to AI agents and traditional clients. It supports the MCP protocol directly, plus HTTP/SSE and REST endpoints, with safe defaults to protect data while enabling fast, flexible queries across your product, orders, customers, and related tables.

How to use

Connect an MCP client to the MCP server to run queries, inspect schemas, and retrieve dataset samples. You can operate in multiple transport modes: FastMCP via stdio for direct MCP client integration, HTTP/SSE for web-based clients, and REST API for conventional HTTP clients. All modes enforce read-only access, basic query validation, and automatic row limits to protect resources.

How to install

Prerequisites: you should have Python installed and be able to run Python scripts. You may also use a production-grade HTTP server setup if you prefer a separate deployment.

Step 1. Clone the project directory and move into it.

Step 2. Install Python dependencies from the requirements list.

Step 3. Prepare environment configuration based on the provided template and your database connection details.

Step 4. Run the MCP server in your preferred mode. Use the same commands shown below in the exact sequence.

Configuration and operation notes

Supported data sources: the server connects to a PostgreSQL database and discovers the schema at runtime. You commonly have tables such as products, orders, customers, cart_items, and user_sessions, which the server will use to power MCP tools and queries.

Environment variables shown below are required for dataset configuration. You may copy the template and customize the values.

Security and usage policies

Queries are restricted to read-only operations. The server enforces automatic limits: raw queries return a maximum of 5 rows and aggregated queries return a maximum of 1,000 rows. A timeout of 60 seconds protects against long-running queries. Authentication is not included by default; plan to add authentication middleware and run behind a reverse proxy for production deployments.

Troubleshooting

If you cannot connect, verify database credentials and that the MCP server process is running in the chosen mode. Check the environment file for dataset definitions and connection strings, and confirm that the server port is accessible from your client.

Development and deployment notes

For local testing, you can run the following start commands in separate terminals depending on the mode you choose. These commands are shown as examples of how to start the server in each transport mode.

Appendix: Example environment configuration

# Dataset 1
DATASET_1_NAME=vtion_ecom
DATASET_1_DESC=VTION E-commerce platform analytics data
DATASET_1_CONNECTION=postgresql://postgres:PASSWORD@host:port/db?sslmode=require
DATASET_1_DICTIONARY={"table1":"desc","table2":"desc"}

Appendix: Example operational commands

# Option A: FastMCP Mode (stdio) - direct MCP client integration
python vtion_ecom_mcp.py

# Option B: HTTP/SSE Mode (stdio) - web-based clients
python server.py
# Server runs on http://localhost:10000

# Option C: Production Deployment (async HTTP)
uvicorn server:app --host 0.0.0.0 --port 10000 --workers 4

Available tools

get_context

MCP tool to fetch progressive context at multiple levels, from global rules to dataset schemas and samples.

list_available_datasets

MCP tool to list all configured datasets with metadata.

get_dataset_schema

MCP tool to retrieve the complete schema for a specific dataset.

query_dataset

MCP tool to execute SELECT queries against a dataset with optional response formatting and parallel execution.

get_dataset_sample

MCP tool to retrieve sample rows from a dataset table.