mini-mcp-lab

mini-mcp-lab

A procurement scenario MCP server for testing whether pending work can resume after a service restart, comparing legacy and modern continuation. It uses SQLite for data persistence and demonstrates real MCP protocol messages.

Category
Visit Server

README

mini-mcp-lab

正體中文測試手冊

This is a hands-on procurement scenario test. You do not need prior knowledge of MCP, AI agents, or JSON-RPC. If you can run commands in a terminal and compare text results, you can complete the acceptance test.

What you are testing

You are acting as the requester. Requisition PR-1042 is already saved:

  • 20 annual cloud document-collaboration licenses;
  • total value TWD 72,000;
  • lines and attachments are stored;
  • submission discovers one missing security approval ID.

The separate security workflow takes three days and produces SEC-2026-0715. While waiting, the procurement service restarts because of a deployment or disconnection.

The test answers one question:

After the service restarts, can the work that was waiting for human input continue from where it stopped?

Test Plain-language analogy Expected result after restart
Legacy A phone call stays open while you look for the answer The call drops. The draft remains, but submission and the answer must be repeated
Modern You receive a claim ticket and return with it later The first call is over. A new request carries the ticket and answer, then continues

A surviving requisition does not prove that the pending interaction survived. The scenario tests these two facts separately.

Five-minute acceptance test

The examples below use Windows. Start PowerShell or Command Prompt in this project directory. Equivalent macOS/Linux commands are listed below.

1. Install

scripts\setup.bat

The first run may take a few minutes. This final line means installation passed:

[setup] ready: ...\.venv\Scripts\python.exe

If it does not appear, stop and retain the error shown in the terminal.

2. Test the legacy flow

scripts\lab.bat --era legacy --sleep 0

The scenario runs automatically. For the first pass, look only at lines beginning with [agent]; you may ignore [wire] and [server].

The test passes when these events appear in order:

[agent] 模擬部署/斷線:真人回答前,舊 server process 被重啟
[agent] 預期結果:等待回答期間 server 已重啟;原 tools/call 無法續接
[agent] 請購草稿仍在,但原問答已遺失;重新呼叫 submit 並再次補件
[agent] 送出流程完成:status=submitted, receipt=SUB-PR-1042

“Cannot resume” is the expected legacy result, not a program failure. The original interaction must break; the script then submits and answers again.

The test fails if the expected interruption is absent, the draft disappears, the final status is not submitted, or an unhandled Python error is shown.

3. Test the modern flow

scripts\lab.bat --era modern --sleep 0

Again, focus on [agent]. The test passes when these events appear in order:

[agent] Server 已回 input_required;第 1 次 tools/call 已正常結束
[agent] /restart:要求重新啟動 server
[agent] 新 request 接續成功:status=submitted, approval=SEC-2026-0715

The first request ends normally after returning an opaque claim ticket. After the service restarts, a new request brings back that ticket and the approval ID and continues the work.

The test fails if the first request does not ask for missing input normally, the service asks for the same information again after restart, the final submitted result is absent, or an unhandled Python error is shown.

4. Record the result

Check Legacy Modern
Service restarts while waiting Must pass Must pass
PR-1042 draft remains available Must pass Must pass
Pending input work resumes directly Expected not to Must pass
Requisition is eventually submitted Passes after repeating work Passes after resuming

The complete scenario passes only when both commands match this table.

macOS/Linux commands

./scripts/setup.sh
./scripts/lab.sh --era legacy --sleep 0
./scripts/lab.sh --era modern --sleep 0

Use the same acceptance criteria.

Reading the terminal

Prefix Meaning Read on the first run?
[human] The user request or supplied approval ID Optional story context
[agent] What the system is doing and the outcome Yes
[wire C→S] Raw message sent to the service No; technical evidence
[wire S→C] Raw response from the service No; technical evidence
[server] Procurement service log Only when diagnosing failure

Large {...} blocks are raw MCP messages. They prove that real protocol messages were exchanged; business testers do not need to interpret every field.

Optional interactive test

After the scripted scenario passes:

scripts\agent-modern.bat

Enter these lines one at a time after the agent> prompt:

show
/sleep 3
scenario
/new
show
/new PR-1042
show
/quit
Command Action Expected result
show Display the current requisition Finds PR-1042
/sleep 3 Represent a three-day wait with three seconds Setting is accepted
scenario Wait, restart, and return with the answer Modern flow resumes and submits
/new Start a new conversation without a handoff Next show fails because no requisition was identified
/new PR-1042 Start a new conversation with an explicit handoff Next show finds the record
/quit Exit Returns to the terminal

The missing record context after /new does not mean the data was deleted. The new conversation simply has not been told which requisition to use.

Interactive mode reuses data/procurement.sqlite3. If an earlier run already submitted the sample, scenario may finish immediately without asking for input. Use scripts\lab.bat, which creates fresh temporary data every time, for the formal legacy-versus-modern comparison.

What this test does not prove

  • It does not prove that modern MCP automatically remembers a requisition. SQLite preserves the business data.
  • PR-1042 is a business record ID, not an MCP session ID or continuation ticket.
  • The agent is deterministic software, not a large language model, so the wire and outcome are reproducible.
  • The lab is stdio-only and single-machine; it does not cover HTTP, OAuth, multi-host deployment, subscriptions, or Tasks.
  • It does not claim a complete official conformance-suite pass. See Protocol and evidence.

Technical verification

Business acceptance does not require this section. To assert the raw wire:

scripts\verify-wire.bat

To run unit tests, type and format checks, and both scenarios:

scripts\test.bat

The project uses one official mcp==2.0.0 Python SDK v2 environment and one server implementation. A deterministic raw stdio agent selects 2025-11-25 or 2026-07-28 through real opening messages; the comparison does not use two hand-written servers pretending to be two protocol versions.

flowchart LR
    U["Tester"] --> A["Text-based simulated agent"]
    A -->|"Real stdio MCP messages"| S["One procurement MCP Server"]
    S --> D[("SQLite<br/>draft and continuation verification data")]
    S -->|"Legacy: keep original call waiting"| A
    S -->|"Modern: return a claim ticket and end call"| A

Further reading:

Contributing

Run scripts\test.bat or scripts/test.sh before submitting changes. Protocol changes require raw-wire regression coverage, not only in-memory SDK tests.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured