my first mcp
MCP server that allows AI assistants to query and retrieve information about office supplies inventory from a CSV file.
MCP server that allows AI assistants to query and retrieve information about office supplies inventory from a CSV file.
Create a NANDA service using Model Context Protocol (MCP) server code that provides information about office supplies inventory. This service allows AI assistants to query and retrieve information about office supplies using the MCP standard. You will use cloud hosted server and a web based NANDA host client. No need to install a local server.
You can deploy a consumer facing web-app for any standard inventory using the same framework.
This project implements a NANDA service using MCP server code that serves office inventory data from a CSV file. It provides tools that allow AI assistants to: - Get a list of all available items in the inventory - Retrieve detailed information about specific items by name
requirements.txt
officesupply.py
: The main server implementationinventory.csv
: CSV file containing the office supply inventory databuild.sh
: Script for setting up the environmentrun.sh
: Script for running the serverrequirements.txt
: List of Python dependenciesClone this repository:
git clone https://github.com/aidecentralized/nanda-servers.git
cd office-supplies-shop-server
Choose one of the environment setup options below:
Create a Python virtual environment:
python -m venv venv
Activate the virtual environment:
source venv/bin/activate
On Windows:
venvScriptsactivate
Install dependencies:
pip install -r requirements.txt
Create a new conda environment:
conda create --name inventory_env python=3.11
Activate the conda environment:
conda activate inventory_env
Install dependencies:
pip install -r requirements.txt
After setting up your environment using either option above:
Run the server:
python officesupply.py
The server will be available at: http://localhost:8080
Install the MCP Inspector:
npx @modelcontextprotocol/inspector
Open the URL provided by the inspector in your browser
/sse
at the end (e.g., http://localhost:8080/sse
)get_items
: Lists all item names in the inventoryget_item_info
: Retrieves details about a specific itemThe server expects an inventory.csv
file with at least the following column:
- item_name
: The name of the inventory item
Additional columns will be included in the item details returned by get_item_info
.
Within this purview, you can edit the CSV file for your requirements, and the MCP server should work for your CSV file as well.
requirements.txt
build.sh
and run.sh
scripts
Set executable permissions on the shell scripts:
chmod +x build.sh run.sh
For Windows, run
wsl chmod +x build.sh run.sh
./build.sh
./run.sh
Port: 8080
Deploy and wait for completion
/sse
)Check out this video tutorial for a walkthrough of setting up and using the MCP server:
Based on the NANDA Servers repository. Follow ProjectNanda at https://nanda.mit.edu