Skip to main content
Glama

ScanPower MCP Server

Official
by scanpower

ScanPower MCP Server

A Model Context Protocol (MCP) server implementation for the ScanPower API, built with Next.js, TypeScript, and Tailwind CSS. This server provides a secure, logged, and configurable interface to interact with ScanPower's inventory and shipment management system.

Features

  • HTTPS Support - Secure server with configurable SSL/TLS certificates

  • Request Logging - Comprehensive logging of all API requests and responses

  • TypeScript - Full type safety with TypeScript implementation

  • Tailwind CSS - Modern, responsive UI for monitoring and documentation

  • MCP Protocol - Complete implementation of the Model Context Protocol

  • Configurable - Environment-based configuration for flexibility

  • Next.js App Router - Modern React framework with server components

Architecture

The server implements the Model Context Protocol (MCP), which provides:

  • Tools: Execute operations like inventory retrieval and shipment creation

  • Resources: Access to inventory and shipment data

  • Prompts: Pre-configured prompts for common tasks

Prerequisites

  • Node.js 18.x or higher

  • npm or yarn

  • OpenSSL (for generating SSL certificates)

Installation

  1. Clone the repository:

git clone https://github.com/scanpower/scanmcp.git cd scanmcp
  1. Install dependencies:

npm install
  1. Create a .env file (copy from .env.example):

cp .env.example .env
  1. Configure your environment variables in .env:

PORT=3000 NODE_ENV=development HTTPS_ENABLED=true SSL_KEY_PATH=./ssl/server.key SSL_CERT_PATH=./ssl/server.cert API_KEY=your_scanpower_api_key_here
  1. Generate SSL certificates (for HTTPS):

npm run generate-cert

Usage

Development Mode

Start the development server with hot-reload:

npm run dev

The server will be available at:

  • HTTP: http://localhost:3000

  • HTTPS: https://localhost:3000 (if HTTPS_ENABLED=true and certificates are present)

Production Mode

Build and start the production server:

npm run build npm start

API Endpoints

Health Check

GET /api/health

Returns server status and configuration information.

MCP Protocol Endpoint

POST /api/mcp

Main endpoint for MCP protocol communication. Accepts JSON-RPC 2.0 formatted requests.

Example MCP Request:

{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }

Available MCP Methods:

  • initialize - Initialize MCP session

  • tools/list - List available tools

  • tools/call - Execute a tool

  • resources/list - List available resources

  • prompts/list - List available prompts

Available Tools

get_inventory

Retrieve inventory items from ScanPower.

Parameters:

  • sku (string, optional): Filter by SKU

  • limit (number, optional): Maximum items to return (default: 100)

create_shipment

Create a new shipment plan.

Parameters:

  • name (string, required): Shipment plan name

  • items (array, required): Array of items with sku and quantity

get_shipments

Retrieve shipment plans.

Parameters:

  • status (string, optional): Filter by status (pending, processing, shipped, completed)

Configuration

Environment Variables

Variable

Description

Default

PORT

Server port

3000

NODE_ENV

Environment mode

development

HTTPS_ENABLED

Enable HTTPS

true

SSL_KEY_PATH

Path to SSL key

./ssl/server.key

SSL_CERT_PATH

Path to SSL certificate

./ssl/server.cert

API_BASE_URL

ScanPower API base URL

https://api.scanpower.com

API_KEY

ScanPower API key

-

LOG_LEVEL

Logging level

info

LOG_REQUESTS

Enable request logging

true

SSL Certificates

For development, you can generate self-signed certificates:

npm run generate-cert

This will create:

  • ssl/server.key - Private key

  • ssl/server.cert - Self-signed certificate

Note: Self-signed certificates will trigger browser security warnings. For production, use certificates from a trusted Certificate Authority.

Project Structure

scanmcp/ ├── app/ # Next.js app directory │ ├── api/ # API routes │ │ ├── health/ # Health check endpoint │ │ └── mcp/ # MCP protocol endpoint │ ├── globals.css # Global styles │ ├── layout.tsx # Root layout │ └── page.tsx # Home page ├── lib/ # Shared libraries │ ├── logger.ts # Logging utilities │ └── types.ts # TypeScript types ├── scripts/ # Utility scripts │ └── generate-cert.sh # SSL certificate generation ├── middleware.ts # Request logging middleware ├── server.js # Custom HTTPS server ├── next.config.js # Next.js configuration ├── tailwind.config.ts # Tailwind CSS configuration ├── tsconfig.json # TypeScript configuration └── package.json # Project dependencies

Development

Linting

npm run lint

Building

npm run build

Logging

All HTTP requests are automatically logged with the following information:

  • Timestamp

  • HTTP method

  • Request path

  • Status code

  • Response time

  • User agent

  • IP address

Logs are output in JSON format to stdout and can be easily integrated with log aggregation services.

License

ISC

Support

For issues or questions:

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables interaction with ScanPower's inventory and shipment management system through a secure MCP interface. Supports retrieving inventory data, creating shipment plans, and managing logistics operations through natural language.

  1. Features
    1. Architecture
      1. Prerequisites
        1. Installation
          1. Usage
            1. Development Mode
            2. Production Mode
          2. API Endpoints
            1. Health Check
            2. MCP Protocol Endpoint
          3. Available Tools
            1. get_inventory
            2. create_shipment
            3. get_shipments
          4. Configuration
            1. Environment Variables
          5. SSL Certificates
            1. Project Structure
              1. Development
                1. Linting
                2. Building
              2. Logging
                1. License
                  1. Support

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/scanpower/scanmcp'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server