Token导航 LogoToken导航TokenDH.com
Functions MCP Inventory Server Python logo
运维云端未说明官方级别未说明来源级核验

Functions MCP Inventory Server Python

MCP Server

一个基于Model Context Protocol (MCP)的Python服务器,用于管理服装店库存,支持添加、搜索、更新和检索物品详情,可通过Azure Developer CLI部署到Azure。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
Bicep库存管理ClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Azure-Samples

提供方

Azure-Samples

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

Model Context Protocol (MCP) Inventory Server using Azure Developer CLI

This template repository contains a Model Context Protocol (MCP) server implementation for managing clothing store inventory in Python. The sample can be easily deployed to Azure using the Azure Developer CLI (azd). It uses managed identity and a virtual network to make sure deployment is secure by default. You can opt out of a VNet being used in the sample by setting VNET_ENABLED to false in the parameters.

Model Context Protocol (MCP) is an open standard that enables secure connections between host applications (like Claude Desktop, IDEs, or other AI tools) and external data sources and tools. MCP allows AI assistants to securely interact with local and remote resources while maintaining user control and privacy.

This sample demonstrates how to create an MCP server that provides tools for managing clothing inventory, including adding items, searching inventory, updating quantities, and retrieving item details. The server uses FastMCP for HTTP transport and SQLite for data persistence.

Prerequisites

- Visual Studio Code - Azure Functions extension

Initialize the local project

You can initialize a project from this azd template in one of these ways:

  • Use this azd init command from an empty local (root) folder:
  azd init --template functions-mcp-inventory-server-python

Supply an environment name, such as mcpinventory when prompted. In azd, the environment is used to maintain a unique deployment context for your app.

  • Clone the GitHub template repository locally using the git clone command:
  git clone https://github.com/Azure-Samples/functions-mcp-inventory-server-python.git
  cd functions-mcp-inventory-server-python

You can also clone the repository from your own fork in GitHub.

Sample Data

  SAMPLE_INVENTORY = [
      {
          "id": 1,
          "name": "Navy Single-Breasted Slim Fit Formal Blazer",
          "category": "Jackets",
          "price": 89.99,
          "description": "Tailored navy blazer with notch lapels",
          "sizes": {
              "XS": 0, "S": 0, "M": 0, "L": 0, "XL": 0, "XXL": 0, "XXXL": 0
          }
      },
      # More items...
  ]

Deployment

  1. This sample uses Visual Studio Code as the main client. Configure it as an allowed client application:
    azd env set PRE_AUTHORIZED_CLIENT_IDS aebc6443-996d-45c2-90f0-388ff96faa56
  1. Specify a service management reference if required by your organization. If you're not a Microsoft employee and don't know that you need to set this, you can skip this step. However, if provisioning fails with an error about a missing service management reference, you may need to revisit this step. Microsoft employees using a Microsoft tenant must provide a service management reference (your Service Tree ID). Without this, you won't be able to create the Entra app registration, and provisioning will fail.
    azd env set SERVICE_MANAGEMENT_REFERENCE 
  1. Run azd up in the root directory.

You're prompted to supply these required deployment parameters:

ParameterDescription
Environment nameAn environment that's used to maintain a unique deployment context for your app. You won't be prompted if you created the local project using azd init.
Azure subscriptionSubscription in which your resources are created.
Azure locationAzure region in which to create the resource group that contains the new Azure resources. Only regions that currently support the Flex Consumption plan are shown.

When the deployment finishes, your terminal will display output similar to the following:

      (✓) Done: Resource group: rg-resource-group-name (12.061s)
      (✓) Done: App Service plan: plan-random-guid (6.748s)
      (✓) Done: Virtual Network: vnet-random-guid (8.566s)
      (✓) Done: Log Analytics workspace: log-random-guid (29.422s)
      (✓) Done: Storage account: strandomguid (34.527s)
      (✓) Done: Application Insights: appi-random-guid (8.625s)
      (✓) Done: Function App: func-mcp-random-guid (36.096s)
      (✓) Done: Private Endpoint: blob-private-endpoint (30.67s)

      Deploying services (azd deploy)
      (✓) Done: Deploying service api
      - Endpoint: https://functionapp-name.azurewebsites.net/

Redeploy your code

You can run the azd up command as many times as you need to both provision your Azure resources and deploy code updates to your function app.

Note: Deployed code files are always overwritten by the latest deployment package.

Clean up resources

When you're done working with your function app and related resources, you can use this command to delete the function app and its related resources from Azure and avoid incurring any further costs:

azd down

About

This repository contains an MCP (Model Context Protocol) server implementation for clothing inventory management written in Python. It's deployed to Azure Functions Flex Consumption plan using the Azure Developer CLI (azd). The sample uses managed identity and a virtual network to make sure deployment is secure by default.

The MCP server provides tools for:

  • Adding new clothing items with sizes and quantities
  • Searching and retrieving inventory items
  • Updating stock quantities
  • Managing clothing store inventory through the MCP protocol

This enables AI assistants and other MCP-compatible applications to securely interact with inventory data while maintaining proper access controls and data persistence.

目录标签

目录标签

Bicep库存管理Claude本地部署MCP协议Azure部署Python服务器服装行业

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP