Skip to main content
Glama
Demo Management MCP Server

Demo Management MCP Server

Demo Management MCP Server for Claude Desktop

This is a sample Model Context Protocol (MCP) server that allows AI assistants to interact with a generic product management API.

It provides CRUD operations (Create, Read, Update, Delete) through a local MCP server using the standard stdio transport.

The server does not call any AI provider. It acts as a bridge between Claude Desktop and an external REST API.

Features

  • Retrieve a list of products (SELECT).

  • Retrieve product details by ID.

  • Create new products (INSERT).

  • Update existing products (UPDATE).

  • Delete products (DELETE).

  • Validate tool inputs using Zod.

  • Authenticate API requests using a Bearer token.

  • Communicate with Claude Desktop through MCP stdio.

Related MCP server: MCPServer

Requirements

  • Node.js 20 or newer

  • npm

  • Claude Desktop

  • An accessible REST API implementing the endpoints described below

Installation

Clone or copy this project into a local directory.

Install dependencies:

npm install

Environment Variables

The server requires two environment variables:

Variable

Description

API_BASE_URL

Base URL of the REST API

API_TOKEN

Bearer token used for API authentication

These variables should be configured locally and must not be committed to the repository.

tokens.example.txt shows a sample format for storing access and refresh tokens. Copy it to tokens.txt and replace the placeholders locally. The local tokens.txt file is ignored by Git. The current server code reads API_BASE_URL and API_TOKEN from environment variables; it does not currently load tokens.txt or use a refresh token.

Claude Desktop Configuration

Add the MCP server to Claude Desktop's claude_desktop_config.json.

Replace the example paths and API configuration with your local values:

{
  "mcpServers": {
    "demo-management": {
      "command": "/absolute/path/to/node",
      "args": [
        "/absolute/path/to/project/src/index.mjs"
      ],
      "env": {
        "API_BASE_URL": "https://YOUR_API_HOST",
        "API_TOKEN": "YOUR_API_TOKEN"
      }
    }
  }
}

Restart Claude Desktop after saving the configuration.

Check Settings → Developer to verify that the MCP server is running.

Available MCP Tools

The server exposes five tools:

Tool

Operation

Description

select_products

SELECT

Retrieve products with pagination and filters

get_product

SELECT

Retrieve a product by ID

insert_product

INSERT

Create a new product

update_product

UPDATE

Update an existing product

delete_product

DELETE

Delete a product by ID

REST API Endpoints

The MCP server communicates with the following REST API endpoints:

Method

Endpoint

Description

GET

/api/v1/products

Retrieve products

GET

/api/v1/products/{id}

Retrieve product details

POST

/api/v1/products

Create a product

PUT

/api/v1/products/{id}

Update a product

DELETE

/api/v1/products/{id}

Delete a product

Product Data Structure

A product contains the following fields:

{
  "name": "Sample Product",
  "description": "Product description",
  "price": 50000,
  "categoryId": 2
}

Example API Requests

Create a product:

POST /api/v1/products
Content-Type: application/json

{
  "name": "Laptop",
  "description": "Sample laptop",
  "price": 50000,
  "categoryId": 2
}

Update a product:

PUT /api/v1/products/15
Content-Type: application/json

{
  "price": 60000
}

Delete a product:

DELETE /api/v1/products/15

Example Interactions with Claude

Once the MCP server is connected, you can use natural language to interact with the API.

Examples:

  • "Show me all products."

  • "Find products in category 2."

  • "Get details of product 15."

  • "Create a new product named Laptop with a price of 50000."

  • "Change the price of product 15 to 60000."

  • "Delete product 15."

Claude interprets the request, selects the appropriate MCP tool, validates its parameters, and calls the corresponding API endpoint.

Security Considerations

  • Never commit API tokens or credentials to source control.

  • Keep API credentials in local environment variables.

  • Use HTTPS for API communication.

  • Apply appropriate authorization rules on the API backend.

  • Require explicit user confirmation before destructive operations such as deleting records.

  • Validate and sanitize all incoming API data.

Architecture

Claude Desktop
      |
      | MCP Protocol (stdio)
      |
Demo Management MCP Server
      |
      | HTTP REST API
      |
External Product Management API
      |
      |
Database

License

This project is provided as an educational MCP integration example.

Available Tools

5 tools
delete_productC

Delete a product by ID.

Inputs: productId (required).

get_productC

Get details of a product by ID.

Inputs: productId (required).

insert_productC

Create a new product.

Inputs: name (required), price (required), categoryId (required), description.

select_productsC

Get a list of products with optional filters.

Inputs: page, search, pageSize, categoryId.

update_productD

Update an existing product.

Inputs: productId (required), name, price, categoryId, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool maps to a distinct operation on a single resource: list/select, get, insert, update, delete. The only mild overlap is select_products vs get_product, but single-item vs list retrieval is clearly differentiated.

    Naming Consistency3/5

    Four tools follow a consistent verb_noun pattern (get_product, insert_product, update_product, delete_product), but select_products breaks the pattern where list_products would be the conventional choice. The mix of select-verb with snake_case is still readable but inconsistent.

    Tool Count5/5

    Five tools covering full CRUD on one resource is a tight, well-scoped surface where every tool earns its place. Nothing extraneous and nothing thin.

    Completeness5/5

    Full lifecycle coverage: list, read, create, update, delete on products, with listing filters. No dead ends for a simple product-management domain.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers