Skip to main content
Glama
POS Support MCP Server

POS Support MCP Server

by Nery2004

POS Support MCP Server

Overview

POS Support MCP Server is a standalone local Model Context Protocol server for a fictitious point-of-sale technical-support domain. It exposes eleven focused tools for branches, terminals, incidents, historical solutions, and incident management. It is designed for a university networking demonstration and uses only local simulated data.

Related MCP server: kb-mcp-server

Features

  • Four related entities: branches, terminals, incidents, and incident history.

  • Eight read-only and three mutating business tools.

  • Deterministic similar-incident search without AI or external services.

  • Atomic incident creation, update, resolution, and history writes.

  • Stable seed IDs for reproducible demonstrations.

  • Consistent structured success and business-error responses.

Architecture

MCP Client
    ↓ stdio
POS Support MCP Server
    ↓
Validation / Service Layer
    ↓
Repository Layer
    ↓
SQLite

Protocol registration, business rules, and parameterized SQL are kept in separate modules. The package does not depend on the parent chatbot project.

Requirements

  • Python 3.10 or newer

  • mcp>=2,<3

  • SQLite support from the Python standard library

No database server, web framework, ORM, or external service is required.

Installation

git clone https://github.com/Nery2004/pos-support-mcp-server.git
cd pos-support-mcp-server
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .

Database Initialization

Create or reset the default database and load deterministic seed data:

python3 -m pos_support_mcp_server.seed --reset

The default file is data/pos_support.db. Override it for an isolated run:

POS_SUPPORT_DB_PATH=/absolute/path/support.db \
python3 -m pos_support_mcp_server.seed --reset

--reset removes only the configured database file and its SQLite sidecars. Runtime database files are ignored by Git.

Running the Server

After installation and seeding:

python3 -m pos_support_mcp_server.server

The installed console entry point is equivalent:

pos-support-mcp

MCP Transport

The server uses the high-level MCPServer API from MCP Python SDK 2.x and runs only over stdio. It opens no network port and writes no debug output to stdout.

Example client configuration after installing the package into the selected Python environment:

{
  "transport": "stdio",
  "command": "/absolute/path/to/.venv/bin/python",
  "args": ["-m", "pos_support_mcp_server.server"],
  "env": {
    "POS_SUPPORT_DB_PATH": "/absolute/path/to/pos_support.db"
  }
}

Replace both absolute paths with paths on the client machine. The interpreter must be the environment where this project was installed.

Available Tools

Read-only:

  • list_branches

  • get_branch

  • list_terminals

  • get_terminal

  • list_incidents

  • get_incident

  • search_similar_incidents

  • get_critical_incidents

Mutating:

  • create_incident

  • update_incident

  • resolve_incident

Tool Parameters

Tool

Parameters

list_branches

optional status

get_branch

branch_code

list_terminals

optional branch_code, status

get_terminal

branch_code, terminal_code

list_incidents

optional branch_code, terminal_code, status, priority

get_incident

incident_id

search_similar_incidents

query, optional branch/terminal, limit=5

create_incident

branch, optional terminal, title, description, priority

update_incident

incident ID and at least one editable field or note

resolve_incident

incident ID, solution, optional note

get_critical_incidents

optional branch_code

Example Usage

Conceptual MCP calls:

{"name": "get_terminal", "arguments": {"branch_code": "001", "terminal_code": "03"}}
{"name": "create_incident", "arguments": {"branch_code": "003", "terminal_code": "04", "title": "Connection drops", "description": "Checkout loses the POS server connection.", "priority": "high"}}
{"name": "resolve_incident", "arguments": {"incident_id": 21, "solution": "Restarted the local POS service."}}

Tools return a structured envelope:

{"success": true, "data": {}}

Seed Data

The deterministic seed contains 4 branches, 16 terminals, 20 incidents, and 35 history records. It covers online/offline terminals, printers, scanners, network timeouts, payments, stopped POS services, and synchronization issues. All names, addresses, incidents, and solutions are fictitious.

Search normalizes English and Spanish text, removes punctuation and a small stop-word set, then computes Jaccard similarity over unique terms from title, description, and solution. Only positive scores are returned. Results are ordered by score descending and incident ID ascending, rounded to four decimal places, and limited to 1–20 entries.

Error Handling

Business failures use success: false with stable codes such as BRANCH_NOT_FOUND, TERMINAL_NOT_FOUND, INCIDENT_NOT_FOUND, INVALID_ARGUMENT, and INVALID_STATUS_TRANSITION. Unexpected SQLite errors become a sanitized DATABASE_ERROR; SQL, paths, and stack traces are omitted.

Security

  • Local stdio only; no HTTP server or external requests.

  • Parameterized SQL and constrained business inputs.

  • No arbitrary SQL, shell, Python, filesystem, or command tool.

  • No subprocess execution.

  • Fictitious seed data only.

  • Mutating tools must not be automatically retried by a host.

  • Runtime databases and credentials are excluded from publication.

Testing

Run the standalone tests with a temporary SQLite database per test:

python3 -m unittest discover -s tests -v

The test suite includes a real MCP stdio integration test that starts the server as a subprocess, discovers exactly eleven tools, calls get_branch, and verifies a clean shutdown:

python3 -m unittest tests.test_mcp_integration -v

Project Structure

.
├── .gitignore
├── README.md
├── pyproject.toml
├── data/.gitkeep
├── src/pos_support_mcp_server/
│   ├── __init__.py
│   ├── database.py
│   ├── repository.py
│   ├── responses.py
│   ├── seed.py
│   ├── server.py
│   ├── service.py
│   ├── similarity.py
│   └── validation.py
└── tests/

This repository intentionally contains only the standalone POS Support MCP Server. It excludes chatbot integrations, external services, runtime databases, and environment files.

Available Tools

11 tools
create_incidentB

Create an open branch-wide or terminal-specific support incident.

Inputs: title (required), priority (required), branch_code (required), description (required), +1 more. Returns: object

get_branchA

Get one branch by its stable business code.

Inputs: branch_code (required). Returns: object

get_critical_incidentsA

List unresolved critical incidents, optionally for one branch.

Inputs: branch_code. Returns: object

get_incidentB

Get an incident with its branch, optional terminal, and ordered history.

Inputs: incident_id (required). Returns: object

get_terminalB

Get one terminal by branch code and branch-local terminal code.

Inputs: branch_code (required), terminal_code (required). Returns: object

list_branchesA

List fictitious branches, optionally filtered by status.

Inputs: status. Returns: object

list_incidentsB

List incidents using optional branch, terminal, status, and priority filters.

Inputs: status, priority, branch_code, terminal_code. Returns: object

list_terminalsB

List terminals, optionally filtered by branch and status.

Inputs: status, branch_code. Returns: object

resolve_incidentC

Resolve an active incident with a required applied solution.

Inputs: solution (required), incident_id (required), note. Returns: object

search_similar_incidentsB

Find incidents using deterministic local Jaccard text similarity.

Inputs: query (required), limit, branch_code, terminal_code. Returns: object

update_incidentB

Edit an active incident or move it from open to in_progress.

Inputs: incident_id (required), note, title, status, +2 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    Most tools are clearly distinct: get_* for single resources, list_* for collections, and create/update/resolve for incident lifecycle. The main overlap is get_critical_incidents, which largely duplicates list_incidents with status and priority filters, though it may serve as a convenience shortcut.

    Naming Consistency4/5

    Tool names generally follow a verb_noun pattern with singular get_ and plural list_ prefixes, and create/update/resolve are consistent. The slight inconsistency is get_critical_incidents returning a list rather than using list_, but the naming remains readable and predictable.

    Tool Count5/5

    Eleven tools is well-scoped for a POS support domain, covering branch/terminal lookup, incident management, and incident search. Each tool has a clear role, and the count feels appropriate without unnecessary bloat.

    Completeness4/5

    The incident lifecycle is well covered with create, update, resolve, and detailed retrieval, and branch/terminal context is supported. Minor gaps exist such as no explicit cancel/reopen operation or dedicated comment/note endpoint, but agents can handle most support workflows.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      C
      maintenance
      Enables safe read-only analysis of a local SQLite e-commerce database over stdio, providing tools for schema inspection and parameterized SELECT queries.
      2
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables users to create, retrieve, update, delete, and full-text search a local knowledge base of notes persisted in SQLite with FTS5, exposed over stdio or authenticated Streamable HTTP. It also surfaces recent/single-note resources and prompts for summarizing notes and drafting replies.
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables agents to manage a local SQLite task backlog over stdio, with tools to create, search, list, get, update, and stat tasks while preserving audit history and idempotency.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Lets an MCP client list and manage local purchases, receipts, and confirmed return, refund, or warranty deadlines through eight tools that reuse the same business logic and SQLite data as the web app. It runs over local stdio, so CRUD works without the HTTP backend, though reminder processing still needs it.
      8
      MIT