A Model Context Protocol (MCP) server that provides sales data tools, resources, and prompts to AI assistants.
This MCP server gives AI assistant, Cline, the ability to:
- Fetch real sales data for different quarters
- Access available quarter information
- Generate sales analysis prompts
MCP/
├── app/
│ ├── server.py # Main MCP server
│ ├── tools/
│ │ └── sales_tools.py # Sales data functions
│ ├── resources/
│ │ └── sales_resources.py # Available quarters
│ └── prompts/
│ └── sales_prompts.py # Sales analyst prompts
├── config/
│ └── settings.py # Configuration
├── .venv/ # Virtual environment
├── pyproject.toml # Project dependencies
└── test_server.py # Test script
python -m venv .venv
source .venv/Scripts/activate # Windows Git Bash
# or
.venv\Scripts\activate # Windows CMD# Install uv (fast Python package manager)
python -m pip install uv
# Install MCP and FastMCP
pip install mcp
uv pip install fastmcpCreate a pyproject.toml file:
[project]
name = "sales-mcp"
version = "0.0.0"
dependencies = []
[dependency-groups]
dev = [
"mcp",
]uv add --dev mcppython test_server.pyuv run fastmcp run app/server.py- Install Cline extension in VS Code
- Add to Cline's MCP config at:
C:\Users\<YourName>\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
{
"mcpServers": {
"sales-mcp": {
"command": "C:\\Users\\<YourName>\\MCP\\.venv\\Scripts\\fastmcp.exe",
"args": [
"run",
"C:\\Users\\<YourName>\\MCP\\app\\server.py"
]
}
}
}- Reload VS Code
- Ask Cline: "What are the available quarters?"
## Available Tools
### `get_total_sales(quarter: str)`
Get sales data for a specific quarter.
**Example:**
```python
get_total_sales("Q1")
# Returns: {'quarter': 'Q1', 'total_sales': 120000}
Returns available quarters: ["Q1", "Q2", "Q3"]
Generates a sales analyst prompt for the specified quarter.
- FastMCP: Uses the FastMCP framework for easy MCP server creation
- Resources: URI format
resource://sales/quarters(must be valid URL) - Transport: STDIO (standard input/output) for client communication
- Python Version: >=3.11
Server won't start:
- Make sure you're in the virtual environment
- Check that all dependencies are installed:
pip list | grep mcp
Want to extend this server? Add more tools:
- Sales forecasting
- Customer analytics
- Product performance
- Revenue calculations
- Data visualization helpers
Each tool is just a Python function that AI can call!
GitHub: https://github.com/usafhulk/MCP