README.md•2.06 kB
# E-commerce MCP Server
A simple Model Context Protocol (MCP) server with test data.
## Setup
1. **Create virtual environment and install dependencies:**
```bash
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync
```
2. **Configure MCP in VS Code:**
- The json config to import into VS Code Augment Extension is configured in `.vscode/example-mcp.json`
- Update the python and args paths with the absolute path to your project
- Restart VS Code or reload the MCP server after setup (Command Palette `Developer: Reload Window`)
## Available Tools
The server provides 5 e-commerce tools:
- `get_customer_info` - Get customer details by ID
- `get_customer_ids_by_name` - Search for customer IDs by name
- `get_order_details` - Get order information by order ID
- `get_orders_by_customer_id` - Get all orders for a customer
- `check_inventory` - Search product inventory by name
## Test Data
### Customers
- **Alice Johnson** (CUST123) - alice@example.com, 555-1234
- **Bob Smith** (CUST456) - bob@example.com, 555-5678
### Orders
- **ORD1001** - Alice's order (Shipped, $89.99)
- **ORD1015** - Alice's order (Processing, $45.50)
- **ORD1022** - Bob's order (Delivered, $120.00)
### Products
- **SKU100** - Wireless Mouse ($29.99, stock: 42)
- **SKU200** - Keyboard ($59.99, stock: 18)
- **SKU300** - USB-C Cable ($15.50, stock: 77)
## Example Commands
Try these queries with the MCP server:
```
Get customer info for Bob Smith
Show me order ORD1001
Check inventory for mouse
Get all orders for customer CUST123
Find customer ID for Alice Johnson
```
## Running Tests
```bash
pytest src/tests/test_server.py -v
```
## Directions to import the MCP server into VS Code Augment Extension
1. Open the VS Code Augment Extension
2. Click the Setting icon(Gear) and select settings
3. Click on the tools section
4. Search for and click import from json
5. Paste the JSON from `.vscode/example-mcp.json` into the dialog box
6. Click import
7. Restart VS Code Command Palette `Developer: Reload Window`