Korral StoreLink MCP

Korral StoreLink MCP

Enables stock assessment and replenishment by exposing three deterministic tools: inspect stock positions, raise replenishment orders, and check order status. Includes an auditable local client and follows a security-first design with limited API surface.

Category
访问服务器

README

Korral StoreLink MCP

A small FastMCP server and custom local client for Korral's stock-assessment and replenishment workflow. The StoreLink API is represented by a deterministic stub, as permitted by the assignment; no real Korral system or customer data is used.

What works

The MCP server exposes exactly three Pydantic-validated tools:

  • inspect_stock_position: returns on-hand units, POS units sold over the requested window, gap = max(POS - on-hand, 0), and whether the gap exceeds the threshold.
  • raise_replenishment: creates one order for an explicit positive quantity and returns its StoreLink order ID and status.
  • get_replenishment_status: retrieves the status of a known order.

The surface deliberately omits raw POS transactions, arbitrary StoreLink requests, store/SKU administration, supplier lookup, and credential tools. The supplied buyer task does not need them, and exposing them would give an agent broader access without improving the acceptance path. Assessment and replenishment remain separate so the buyer audit can show the evidence before the consequential action.

The custom FastMCP client runs the validated cases in examples/step2_buyer_case, writes one readable JSON file per run under audit_trails/, and prints redacted StoreLink call evidence. Technical events are JSON logs on stderr for FDE troubleshooting.

Local setup and demo

Python 3.12+ and uv are required.

uv sync --all-groups
export KORRAL_STORE_KEYS_JSON='{"47":"demo-key-47","102":"demo-key-102"}'
uv run korral-demo

Run the strict > 6 boundary case:

uv run korral-demo --case examples/step2_buyer_case/strict_threshold.json

The command prints the assessment, order, status, and redacted stub calls. Its audit_path points to the saved buyer audit. Demo keys are synthetic and must not be reused outside local development.

Run the MCP service

HTTP is the packaged default:

export KORRAL_STORE_KEYS_JSON='{"47":"demo-key-47","102":"demo-key-102"}'
uv run korral-mcp

The Streamable HTTP endpoint is http://localhost:8000/mcp. Set MCP_TRANSPORT=stdio for a local stdio client. Other configuration is documented in .env.example; production should set KORRAL_STORE_KEYS_FILE to a Secret Manager-backed mounted JSON file rather than placing key values in process arguments.

Test and quality commands

uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy

Tests use only the StoreLink stub. They prove the mixed and threshold cases, the narrow tool surface, Pydantic rejection of a non-positive order, in-flight key rotation, failed refresh, missing-store credentials, audit persistence for successful and failed runs, ambiguous-write review without retry, and secret redaction.

Recording checklist

The submission recording should show the complete acceptance evidence in this order:

  1. Run uv run korral-demo and point out the three MCP tool calls.
  2. Show store 47's gap of 8, its 8-unit accepted order, and store 102's no-order result.
  3. Open the printed audit_path and show the evidence, decision, order, and outcome.
  4. Run uv run pytest and show the credential rotation, missing credential, and uncertain-write tests passing.
  5. Show the successful docker build -t korral-storelink-mcp:local . command and briefly explain the Korral-owned deployment path in DEPLOYMENT.md.

Container

docker build -t korral-storelink-mcp:local .
docker run --rm -p 8000:8000 \
  -e KORRAL_STORE_KEYS_JSON='{"47":"demo-key-47","102":"demo-key-102"}' \
  korral-storelink-mcp:local

The container runs as a non-root user. For a containerized demo client, mount an audit directory and override the command with korral-demo. See DEPLOYMENT.md for the customer deployment and rotation story.

Assumptions and deliberate shortcuts

  • The example gap and order quantity are both max(last-24h sales - on-hand, 0).
  • A gap must be strictly greater than six; exactly six does not order.
  • StoreLink responses and authentication rejection are stubbed. The credential and retry boundary is real, but a real httpx adapter awaits Korral's complete schemas.
  • An explicit authentication rejection is retried once after reloading the secret. Ambiguous writes must be reviewed and are never blindly retried.
  • The custom client is deterministic; no LLM is needed. A future agent may interpret language, but calculation, validation, credentials, and writes stay deterministic.
  • MCP client authentication and a production audit sink must be agreed with Korral IT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选