Skip to main content
Glama
tkuan

ustore-backoffice-mcp

by tkuan

ustore-backoffice-mcp

用于 XMPie uStore BackOffice REST API 的 MCP 服务器,API 地址为 https://produproduce.mysite.com/ustorebackofficerestapi。

状态:可用,已针对线上 API 完成端到端验证。 规范加载成功(15 个标签组下共 52 个路径 / 63 个操作),登录成功,ustore_call_endpoint GET /v1/admin/stores 返回 HTTP 200。只读保护正确拒绝了 DELETE 请求。

设计

服务器不会硬编码端点。首次使用时,它会获取 API 自身的 OpenAPI 3.0 文档,并基于该文档暴露五个工具:

工具

用途

ustore_list_tags

控制器分组 + 操作计数——定位入口

ustore_list_endpoints

按标签、方法或文本搜索/筛选操作

ustore_describe_endpoint

完整契约:参数、请求体、响应结构

ustore_call_endpoint

执行请求;认证在服务端处理

ustore_server_info

诊断:基础 URL、规范来源、认证模式、写入策略

这与 MSSQL MCP 服务器的形态相同(list_databases → list_tables → describe_table → query),无论 API 暴露多少端点,工具数量都保持精简。它还能经受 uStore 升级——新端点会在下次规范刷新时自动出现。

写入操作默认禁用。在服务器进程上设置 USTORE_ALLOW_WRITES=true 之前,非 GET 方法都会被拒绝。

Related MCP server: mcp-db-server

设置

必须运行在能够通过内部网络访问 produproduce 的主机上。

cd /opt/mcp/ustore-backoffice-mcp
npm install
cp .env.example .env
$EDITOR .env          # credentials — the base URL and spec URL are preset
npm run probe         # optional: re-confirm the spec URL and auth handshake

认证握手已针对线上 API 验证通过,并且已是默认配置:

POST {base}/v1/admin/auth/login   {"email": "...", "password": "..."}
  -> 200 {"Token": "..."}

Authorization: uStoreBackoffice <token>     # on every subsequent request

注意登录请求体使用 email 而非 username,令牌字段为大写 Token。认证方案字面就是 uStoreBackoffice——API 会以 {"Errors":[{"Message":"Invalid security token."}]} 拒绝任何其他前缀。

规范 URL 同样已确认并预设:

USTORE_SPEC_URL=https://produproduce.mysite.com/ustorebackofficerestapi/ustore-oas3

必须显式设置——此部署在 /ustore-oas3 提供 OAS3,否则 loadSpec() 会探测的路径全部返回 404。

然后:

npm run http          # or: npm run stdio

验证:

$ curl -s localhost:8931/healthz
{"ok":true,"target":"https://produproduce.mysite.com/ustorebackofficerestapi"}

/healthz 只能证明进程在运行。要确认 API 链路正常,请从客户端调用 ustore_server_info——它会报告解析后的认证方案和操作数量,如果登录失败会明确报错。

部署

pm2

pm2 start index.js --name ustore-mcp --node-args="--enable-source-maps"
pm2 save

systemd

[Unit]
Description=uStore BackOffice MCP server
After=network-online.target

[Service]
Type=simple
User=tc
WorkingDirectory=/opt/mcp/ustore-backoffice-mcp
EnvironmentFile=/opt/mcp/ustore-backoffice-mcp/.env
ExecStart=/usr/bin/node index.js
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

将 .env 的权限保持为 chmod 600——其中保存着 uStore BackOffice 凭据,属于管理员级凭据。

HAProxy

SSE 需要关闭缓冲并设置较长的服务器超时时间,否则会话会被切断:

backend be_mcp_ustore
    mode http
    option http-server-close
    timeout server 3600s
    timeout tunnel 3600s
    http-request set-header X-Accel-Buffering no
    server ustore1 127.0.0.1:8931 check

两种传输方式都已提供:POST /mcp(Streamable HTTP,当前规范)和 GET /sse + POST /messages(旧版 SSE,与现有技术栈一致)。如果希望服务器自身校验共享密钥,而不是仅依赖 HAProxy ACL,请设置 MCP_BEARER_TOKEN。

客户端配置

本地 stdio(同一台机器上的 Claude Desktop):

{
  "mcpServers": {
    "ustore-backoffice": {
      "command": "node",
      "args": ["/opt/mcp/ustore-backoffice-mcp/index.js"],
      "env": { "MCP_TRANSPORT": "stdio" }
    }
  }
}

将配置文件保存为 UTF-8 编码,不要带 BOM。

该 env 块中不需要任何凭据:服务器会读取与 index.js 同目录的 .env 文件。Claude Desktop 以 cwd=/ 和近乎空的环境启动 MCP 服务器,因此 config.js 会基于自身文件位置而非工作目录来解析 .env。你放在 env 中的任何内容仍然优先——真实环境变量优先于文件。

编辑配置后,完全退出 Claude Desktop(macOS 上按 Cmd-Q,而不是仅关闭窗口),以便服务器进程重新启动。

注意事项与陷阱

  • 凭据范围。 BackOffice API 账户通常是完全管理员权限。如果 uStore 支持受限的操作员角色,请使用该角色——本服务器的只读保护针对的是意外操作,而非令牌泄露。

  • USTORE_ALLOW_PATHS 是一个正则表达式白名单。设置它可以限制服务器只暴露你实际需要的控制器,这比单独的写入标志是更强大的控制手段。

  • 响应截断 默认上限为 60k 字符。如果列表端点超出限制,请使用其分页参数而不是提高上限——此 API 的分页参数为 pageNumber(从 1 开始)和 pageSize(默认 50)。

  • 规范缓存 每 15 分钟刷新一次。uStore 升级后,调用 ustore_server_info 并传入 refreshSpec: true 可立即获取变更。

  • 看似连接失败实则认证失败。 即使缺少凭据,服务器也会启动并列出工具——登录只会在首次 API 调用时发生。如果工具已出现但每次调用都报错,请运行 ustore_server_info 并检查 hasToken。

  • 这是对 SQL MCP 服务器的补充,而非替代。 REST API 强制执行 uStore 的业务逻辑,因此它是任何状态变更操作的正确路径。直接查询 [PRODUPRODUCE].ustore 仍然更适合报表联表和架构考古。

Available Tools

5 tools
ustore_call_endpointCall a uStore endpointA

Execute a request against the uStore BackOffice REST API. Path placeholders such as {orderId} are filled from pathParams. Authentication is handled by the server. Non-GET methods are refused unless writes are explicitly enabled.

NameRequiredDescriptionDefault
bodyNoJSON request body for POST/PUT/PATCH
pathYesSpec path, e.g. /api/Orders/{orderId}
queryNoQuery string parameters
methodYesGET, POST, PUT, DELETE, PATCH
headersNoExtra request headers
pathParamsNoValues substituted into {placeholders}

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the burden, and it does add useful behavioral context: authentication is server-side, and non-GET methods are refused unless writes are explicitly enabled. However, it does not clarify what 'explicitly enabled' means, nor does it describe errors, response behavior, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences deliver the essential facts without filler. The most critical constraints and behaviors are placed up front, and every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is adequate for a generic endpoint caller, covering auth, path substitution, and write protection. However, the ambiguous 'writes explicitly enabled' condition and the lack of any guidance about the response format or failure modes leave meaningful gaps for an agent choosing to invoke likely mutating endpoints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is complete, but the description adds meaningful context beyond the schema by explaining how pathParams fill placeholders and by adding an operational constraint on the method parameter. This behavior cannot be inferred from the input schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific action ('Execute a request against the uStore BackOffice REST API') and clearly identifies the target resource and mechanism. It distinguishes the tool from siblings like list_endpoints or describe_endpoint by being the actual invocation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use—executing a request—is implied by the name and description, but there is no explicit guidance about when to choose this against discovering or describing endpoints. The write-refusal note is a restriction, not a usage guideline with alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ustore_describe_endpointDescribe a uStore endpointA

Show the full contract for one operation: path/query/header parameters, request body shape, and response shape. Call this before ustore_call_endpoint.

NameRequiredDescriptionDefault
pathNoe.g. /api/Orders/{orderId}
methodNoRequired when path is ambiguous
operationIdNoAlternative to path+method

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description implies a read-only operation (showing the contract) but does not explicitly state that it has no side effects or require permissions. It does add useful behavioral context by explaining what the tool returns and the required sequence, but lacks mention of error behavior or edge cases.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences that front-load the core purpose and then give actionable guidance. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers what the tool returns and its recommended usage sequence. Missing mention of error behaviors or parameter ambiguity resolution, but given its simple role and lack of output schema, it is sufficiently complete for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides descriptions for all three parameters with 100% coverageging. The description mentions the contract contents but doesn't add further semantic meaning to the parameters themselves, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Show the full contract for one operation' and enumerates the contract's contents (path/query/header parameters, request body, response shape). It distinguishes this from sibling tools by tying it to ustore_call_endpoint, making its purpose unambiguous and specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly directs the agent to 'Call this before ustore_call_endpoint', providing a clear temporal use case. It doesn't discuss when not to use it or contrast with list_endpoints, but the core guidance is strong and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ustore_list_endpointsList uStore API endpointsA

List operations in the uStore BackOffice REST API. Filter by tag, HTTP method, or a free-text search across path, operationId and summary.

NameRequiredDescriptionDefault
tagNoRestrict to one tag group
limitNoDefault 100
methodNoGET, POST, PUT, DELETE, PATCH
searchNoSubstring match on path/operationId/summary

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of indicating safety and behavior. 'List operations' conveys a read-only action and the filterable fields are stated, but it does not describe pagination behavior, output shape, or authentication expectations. This is acceptable for a simple list tool but not highly transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with the key action first and filtering capabilities in the second. Every word earns its place; there is no repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple discovery tool with four fully documented optional parameters and no output schema, the description is largely complete: it states the resource, the filtering dimensions, and implies the fields available in results. It does not add alternative-tool guidance, but given the low complexity, this is a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description rephrases tag, method, and search filtering but adds little beyond the schema's parameter descriptions; the search field details are already present in the schema. The limit parameter is left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists operations in the uStore BackOffice REST API, with a specific verb and resource. It distinguishes itself from siblings like ustore_describe_endpoint, ustore_call_endpoint, and ustore_list_tags by focusing on discovering operations rather than describing, calling, or listing tags.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied by the purpose — discover API operations and optionally filter them — but the description does not explicitly state when to prefer this tool over alternatives, nor does it mention excluded cases or prerequisites. There is no when/when-not guidance, only the clear listing behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ustore_list_tagsList uStore API groupsA

List the tag groups (controllers) exposed by the uStore BackOffice REST API, with the number of operations in each. Start here to orient yourself.

NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It clearly identifies the operation as a read-only listing ('List') and specifies what is returned (tag groups with operation counts). It does not mention auth or rate limits, but for a simple zero-parameter list this is not a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the action and resource, and every sentence earns its place. 'Start here to orient yourself' adds practical guidance without unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter orientation tool with no output schema, the description is sufficiently complete: it states what is listed, what counts are included, and how to use it as a starting point. It could mention relationship to sibling tools, but this is not essential for the tool's simple purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and schema description coverage is 100%, so the baseline is 4. The description does not need to add parameter details, and it appropriately focuses on the output and purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('List') with a clear resource ('tag groups (controllers) exposed by the uStore BackOffice REST API') and adds useful detail ('with the number of operations in each'). It distinguishes itself from sibling tools like list_endpoints and describe_endpoint by focusing specifically on tag groups/controllers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Start here to orient yourself' provides clear context for when to use this tool, positioning it as the initial discovery step. However, it does not explicitly name alternatives or state when not to use it, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

ustore_server_infouStore MCP server diagnosticsA

Report the configured base URL, spec source, auth mode, and write policy. Use this when calls are failing to confirm how the server is wired up.

NameRequiredDescriptionDefault
refreshSpecNoRe-fetch the OpenAPI document

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations, but description implies a read-only reporting operation. The parameter description covers refreshSpec's side effect (re-fetching OpenAPI), providing adequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences: first states purpose, second gives usage context. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple info tool with one optional parameter and no output schema, the description covers what it does and when to use it, making it complete enough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Parameter refreshSpec is fully described in the schema (coverage 100%). The main description adds no extra meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it reports the configured base URL, spec source, auth mode, and write policy, distinguishing from sibling tools like list/describe/call endpoints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly suggests using when calls are failing to confirm server wiring, but does not mention when not to use or alternatives (though siblings are evident).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv1.0.1
    • First observedustore_call_endpoint
    • First observedustore_describe_endpoint
    • First observedustore_list_endpoints
    • First observedustore_list_tags
    • First observedustore_server_info

TDQS

A4.2/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct role: listing tags, listing endpoints, describing a single endpoint, calling an endpoint, and reporting server info. No overlap or ambiguity between them.

Naming Consistency4/5

Most tools follow a ustore_verb_noun pattern (list_tags, list_endpoints, describe_endpoint, call_endpoint), but server_info deviates by using noun_noun without a verb. This is a minor inconsistency in an otherwise predictable scheme.

Tool Count5/5

Five tools is an ideal count for a focused API client server. Each tool serves a necessary and distinct function, with no bloat or obvious missing piece.

Completeness5/5

The tool set covers the full workflow: orient (list tags), discover (list endpoints), understand (describe endpoint), and act (call endpoint), plus diagnostics (server info). No critical gaps for interacting with the underlying API.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables read-only interaction with Zoho CRM data through natural language queries, allowing users to search records, list modules, retrieve field information, and count records using secure OAuth authentication.
    2
    ISC
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables querying PostgreSQL and MySQL databases using natural language, with RESTful endpoints for listing tables, describing schemas, and executing read-only queries.
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables management of BeyondTrust Endpoint Privilege Management (EPM) through natural language, supporting policy, computer, user, group management, file inspection, audit monitoring, and admin access requests.
    1
    -
  • A
    license
    A
    quality
    D
    maintenance
    Exposes Swagger/OpenAPI API documentation to AI models, enabling exploration, search, and interaction with endpoints, schemas, and execution of API calls.
    14
    4 npm
    2
    MIT