home / mcp / inventory mcp server

Inventory MCP Server

Provides an MCP server to manage inventory using Supabase PostgreSQL, with add, remove, check, and list operations.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "adiitiir-inventory-mcp-server": {
      "command": "python",
      "args": [
        "inventory-mcp-server.py"
      ],
      "env": {
        "SUPABASE_DB_PASSWORD": "YOUR_PASSWORD"
      }
    }
  }
}

You run an Inventory MCP Server to manage stock across multiple locations using a PostgreSQL backend provided by Supabase. It lets you add or update items, remove quantities, check current stock at any location, and list all inventory items in one place. This server streamlines inventory workflows and keeps stock data synchronized with your Supabase database.

How to use

To use this MCP server, run it locally and connect your MCP client to the local Python process. You can add or update inventory items by providing an item identifier, product name, location, and quantity. You can remove quantities for specific items at a given location, check the stock level for a particular item at a location, and list all inventory items to get a complete view of your stock across locations. The server handles interaction with the Supabase PostgreSQL database in the background, so you only specify the operation and the relevant item details.

How to install

Prerequisites you need before installing: Python 3.11 or higher, a Supabase project, and the database password from your Supabase dashboard.

pip install fastmcp psycopg2-binary supabase
```

Or install from the project in editable mode:

```
pip install -e .

Additional setup steps

Set up your Supabase database by running the simplified setup script. You will connect to the Supabase database through the port 6543 (connection pooler) and create the inventory table with sample data. You will be prompted for your Supabase database password during this process.

python setup_database_simple.py

Run the server locally

Start the MCP server using Python. The server uses your Supabase credentials to connect to the database and expose the MCP endpoints locally.

python inventory-mcp-server.py

Notes on configuration and security

The server is preconfigured with your Supabase credentials. If you need to change the database password, modify the environment variable SUPABASE_DB_PASSWORD or edit the server file to provide a different value.

Environment variable example for password:

set SUPABASE_DB_PASSWORD=your_password

Troubleshooting

Supabase connection issues can arise if the password or connection settings are incorrect. Ensure you are using the correct password, the recommended port 6543 (connection pooler), and that SSL is enabled.

IP allowlisting may block connections. Verify that your IP is allowed in the Supabase database connection pooling settings.

Test a basic connection to verify everything is wired correctly.

python test_connection.py

Notes on data and sample data

The inventory schema includes item_id, product_name, location, and quantity. A sample dataset covers laptops, mobile phones, tablets, and accessories distributed across Bengaluru, Mumbai, Delhi, and Pune.

Security and maintenance

Keep your database password secure and only expose the MCP server to trusted clients. Regularly review permission settings in Supabase and rotate credentials as needed.

Troubleshooting - Import Errors

If you encounter import errors after installation, ensure all dependencies are installed and up to date.

pip install --upgrade fastmcp psycopg2-binary supabase

Notes

This server includes functionality to add, remove, check stock, and list all inventory items. The setup script preloads sample data to help you test and validate the server in a development environment.

Available tools

add_inventory

Adds or updates inventory items by item_id, product_name, location, and quantity. Returns a confirmation message.

remove_inventory

Removes items from inventory for a specific item_id at a given location with a specified quantity. Returns a confirmation message.

check_stock

Checks the stock level for a specific item at a given location and returns item details with the current quantity.

list_inventory

Lists all inventory items with their details across all locations.