Skip to main content
Glama

MCPServer — Python MCP Server with JSON Data Store

A complete, production-ready MCP (Model Context Protocol) Server built with Python.

  • REST API (FastAPI) backed by JSON files — zero DB setup

  • 17 MCP Tools that wrap every API endpoint

  • Mock OAuth for development → swap to real OAuth with one config flag

  • Ready for Claude Desktop, MCP Inspector, and any MCP client


Project Structure

MCPServer/
├── data/                     ← JSON "database" files (users, products, orders)
├── app/
│   ├── auth/                 ← Mock OAuth + real OAuth placeholder
│   ├── db/json_store.py      ← Thread-safe CRUD over JSON files
│   ├── routers/              ← FastAPI routes (users, products, orders)
│   ├── schemas/              ← Pydantic request/response models
│   ├── config.py             ← Settings (loaded from .env)
│   └── main.py               ← FastAPI entry point
├── mcp_server/
│   ├── tools/
│   │   ├── api_client.py     ← HTTP client calling the FastAPI backend
│   │   ├── user_tools.py     ← MCP tools for Users
│   │   ├── product_tools.py  ← MCP tools for Products
│   │   └── order_tools.py    ← MCP tools for Orders
│   └── server.py             ← MCP server entry point (stdio)
├── .env.example
└── requirements.txt

Related MCP server: etsy-mcp

Quick Start

1. Install dependencies

cd MCPServer
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt

2. Configure environment

Copy-Item .env.example .env
# Edit .env if needed (defaults work out of the box)

3. Start the REST API

uvicorn app.main:app --reload --port 8000

Click Authorize in Swagger UI and enter: dev-secret-key-change-me

4. Start the MCP Server

python -m mcp_server.server

Available MCP Tools (17 total)

Users

Tool

Description

list_users

List users (filter by active/role)

get_user

Get user by ID

create_user

Create a new user

update_user

Update user fields

delete_user

Delete a user

Products

Tool

Description

list_products

List products (filter by category/price/active)

get_product

Get product by ID

create_product

Create a new product

update_product

Update product fields

update_product_stock

Update stock level only

delete_product

Delete a product

Orders

Tool

Description

list_orders

List orders (filter by user/status)

get_order

Get order by ID

create_order

Place an order (total auto-computed)

update_order

Update status or shipping address

cancel_order

Cancel pending/processing order

get_user_order_summary

Spending summary for a user


Connect to Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "mock-api": {
      "command": "python",
      "args": ["-m", "mcp_server.server"],
      "cwd": "C:/path/to/MCPServer",
      "env": {
        "API_BASE_URL": "http://localhost:8000",
        "MOCK_API_KEY": "dev-secret-key-change-me"
      }
    }
  }
}

Switching to Real OAuth

  1. Set USE_MOCK_AUTH=false in .env

  2. Fill OAUTH_ISSUER, OAUTH_AUDIENCE, OAUTH_JWKS_URI in .env

  3. Implement validate_token() in app/auth/oauth.py

  4. Uncomment python-jose in requirements.txt and reinstall

  5. Update api_client.py to fetch a real access token instead of the API key

No other files need to change.


API Authentication (Development)

All endpoints require a Bearer token:

Authorization: Bearer dev-secret-key-change-me
git clone https://github.com/Bhanuprakashdadi145/Mcp-Server.git
cd MCPServer
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Copy-Item .env.example .env
uvicorn app.main:app --reload --port 8000
python -m mcp_server.server

Change MOCK_API_KEY in .env to any value you prefer.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server built with the mcp-framework for developing and managing custom tools. It provides a structured foundation for building and integrating modular components like data processors and API clients into Claude Desktop.
    5 npm
    -
  • A
    license
    A
    quality
    D
    maintenance
    A production-grade MCP server that enables AI assistants like Claude to read Etsy shop data—listings, orders, inventory, and stats—through eight read-only tools, using OAuth and automatic pagination.
    8
    MIT
  • A
    license
    C
    quality
    B
    maintenance
    MCP server that exposes the Amazon Selling Partner API to Claude Desktop and any other MCP client. It wraps the python-amazon-sp-api SDK and ships 55+ tools across 19 SP-API scopes with automatic pagination, throttle-aware retry and multi-marketplace support.
    53
    4
    MIT