InventoryApplication MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@InventoryApplication MCP ServerList all products in the Electronics category."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
InventoryApplication MCP Server
A Python Model Context Protocol (MCP) server that exposes the InventoryApplication REST API as tools for AI agents. This server acts as the bridge between AI assistants and the inventory management system.
Overview
Enable AI agents (Claude, GPT, etc.) to interact with the inventory management system through natural language. The MCP server exposes 33 tools that allow AI assistants to query and modify inventory data without needing to understand SQL, connection strings, or the internal database schema.
Related MCP server: MCP Inventory Manager
Architecture
User / AI Agent
│
▼
MCP Client (LangGraph, custom client, etc.)
│
│ MCP Protocol (HTTP/SSE)
▼
InventoryApplication MCP Server (Python)
│
│ HTTP/REST
▼
InventoryApplication.API (ASP.NET Core 8)
│
▼
SQL Server (InventoryDatabase)Key Design Principles
MCP talks to the API, not the database directly — The C# API layer provides business logic, validation, and authorization. The MCP server never connects to SQL Server.
Structured JSON responses — Tools return structured data that the LLM can reason over, not free-text descriptions.
Separate query tools from action tools — Read-only tools have different security implications than write tools, enabling clear permission boundaries.
Use the existing API — No changes to the C# application are required. The MCP server consumes the REST API the same way any HTTP client would.
Installation
Prerequisites
Python 3.11 or higher
Setup
Clone the repository and navigate to the MCP directory:
cd InventoryApplication-MCPCreate and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt # Optional: for development and testingConfigure environment variables:
cp .env.example .envEdit
.envwith your API configuration:API_BASE_URL=http://localhost:5000 API_TIMEOUT=30 API_KEY= # Optional: if JWT auth is enabled in the future MCP_SERVER_PORT=8080
Running the Server
python3 -m src.serverThe server starts an HTTP endpoint at http://localhost:8080/sse. Clients connect via SSE for real-time communication. Multiple clients can connect to the same server instance.
Available Tools
The server exposes 33 tools across 5 categories:
Inventory Tools (11)
Tool | Description | Method |
| Retrieve a product by ID | GET |
| List all products | GET |
| Search products by name | GET |
| Create a new product | POST |
| Update an existing product | PUT |
| Delete a product | DELETE |
| List all categories | GET |
| Retrieve a category by ID | GET |
| Create a new category | POST |
| Update a category | PUT |
| Delete a category | DELETE |
Customer Tools (6)
Tool | Description | Method |
| List all customers | GET |
| Search customers by name | GET |
| Retrieve a customer by ID | GET |
| Create a new customer | POST |
| Update a customer | PUT |
| Delete a customer | DELETE |
Order Tools (4)
Tool | Description | Method |
| List all orders | GET |
| Retrieve an order by ID | GET |
| Get order with line items | GET |
| Create a new order | POST |
Sales Tools (6)
Tool | Description | Method |
| List all sales | GET |
| Get sales for an order | GET |
| Get sales for a product | GET |
| Get sales history for a product | GET |
| Create sales records from an order | POST |
| Update product inventory quantity | POST |
User Tools (6)
Tool | Description | Method |
| List all application users | GET |
| Authenticate a user | POST |
| Create a new user | POST |
| Update user information | PUT |
| Update a user's password | PUT |
| Delete a user | DELETE |
Project Structure
InventoryApplication-MCP/
├── src/
│ ├── server.py # MCP server entry point
│ ├── config.py # Configuration loading (env vars, .env)
│ ├── http_client.py # Async HTTP client wrapper for API calls
│ └── tools/
│ ├── __init__.py # Package initialization
│ ├── shared.py # Shared utilities (error formatting, result wrappers)
│ ├── inventory_tools.py # Product and category tools (11 tools)
│ ├── customer_tools.py # Customer tools (6 tools)
│ ├── order_tools.py # Order tools (4 tools)
│ ├── sales_tools.py # Sales tools (6 tools)
│ └── user_tools.py # User tools (6 tools)
├── tests/
│ ├── conftest.py # Shared test fixtures and mock data
│ ├── test_http_client.py # HTTP client unit tests
│ ├── test_inventory_tools.py
│ ├── test_customer_tools.py
│ ├── test_order_tools.py
│ ├── test_sales_tools.py
│ └── test_user_tools.py
├── docs/
│ ├── project_prompt.md # Architecture and design documentation
│ └── checklist.md # Implementation checklist
├── requirements.txt # Production dependencies
├── requirements-dev.txt # Development dependencies (pytest, etc.)
├── .env.example # Example environment configuration
└── .gitignore # Git ignore rulesTesting
Run the test suite:
pytest tests/ -vRun with coverage:
pytest tests/ -v --cov=src --cov-report=htmlConfiguration
The MCP server is configured via environment variables or a .env file:
Variable | Description | Default |
| Base URL of the InventoryApplication.API |
|
| HTTP request timeout in seconds |
|
| Optional API key for JWT auth |
|
| HTTP port |
|
Error Handling
Tools return structured error messages that include:
HTTP status codes
API error details
Descriptive error messages
Example error response:
{
"status": "error",
"message": "API error (HTTP 404): Product not found"
}Future Considerations
Add ANALYSIS tools:
calculate_sales_velocity,calculate_reorder_quantity,forecast_demandAdd authentication/authorization for MCP tools (API key or JWT)
Add rate limiting to protect the API from excessive MCP calls
Integrate with LangGraph for multi-step agent workflows
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Ask questions in plain language, get answers from your business database. No SQL required.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to query databases using natural language, with automatic schema discovery and SQL compilation.451 npm3,173Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn AI-powered inventory management system with a natural language interface, enabling CRUD operations on items and suppliers, stock transfers, and supplier management via MCP tools.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely interact with multiple databases (MySQL, PostgreSQL) via natural language queries, with cross-database querying and enterprise-grade security.10 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with MSSQL databases through natural language, supporting CRUD operations and schema management.2,592 npmMIT