Skip to main content
Glama
MCP Products Server

MCP Products Server

by lokesh1382

πŸ›’ MCP Products Server

A hands-on Python project demonstrating Model Context Protocol (MCP) by building a product management server that integrates with Claude Desktop and GitHub Copilot.

πŸ—‚οΈ Project Structure

create_new_mcp/
β”‚
β”œβ”€β”€ mcp_server.py        # MCP Server with tools, resource, and prompt template
β”œβ”€β”€ add_product.py       # DB logic to INSERT a product
β”œβ”€β”€ fetch_products.py    # DB logic to SELECT all products
β”œβ”€β”€ db_connect.py        # Database connection helper
β”œβ”€β”€ .env                 # API keys and DB credentials (not committed)
β”œβ”€β”€ .gitignore
└── README.md

Related MCP server: ClickUp MCP Server

βš™οΈ MCP Server β€” mcp_server.py

πŸ”Œ Configuration

Claude Desktop

Update claude_desktop_config.json:

{
  "mcpServers": {
    "products": {
      "command": "uv.exe",
      "args": [
        "--directory", "C:\\path\\to\\create_new_mcp",
        "run", "mcp_server.py"
      ]
    }
  }
}

GitHub Copilot

Update mcp.json with the same server details.

πŸš€ Getting Started

Prerequisites

  • Python 3.10+

  • uv package manager

  • MySQL database

  • Claude Desktop or GitHub Copilot

πŸ“š Key Learnings

  • βœ… MCP Tools are invoked directly by the LLM

  • βœ… MCP Resources are fetched manually via host UI and injected into context

  • βœ… Prompt Templates enable consistent prompt generation via / command

  • ⚠️ MCP Sampling (server β†’ LLM callback) is not yet supported by Claude Desktop or GitHub Copilot in practice

  • πŸ’‘ Workaround for sampling: call Anthropic API directly from the MCP server

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers