算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
flexport-sdk-patterns【设计与创意】Design typed adapters for Flexport REST v3 and the Flexport MCP server while preserving their different contracts. Use when building a client library, response parser, MCP transport, or shared integration boundary. Trigger with: "build Flexport client", "type Flexport responses", "connect Flexport MCP".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: flexport-sdk-patterns description: >- Design typed adapters for Flexport REST v3 and the Flexport MCP server while preserving their different contracts. Use when building a client library, response parser, MCP transport, or shared integration boundary. Trigger with: "build Flexport client", "type Flexport responses", "connect Flexport MCP". allowed-tools: Read, Grep, Write, Edit version: 2.0.0 argument-hint: '[language-and-required-capabilities]' model: inherit effort: high license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
REST resources and MCP tools are two distinct public surfaces. Keep separate transports, authentication/session handling, error models, and pagination adapters behind business-level interfaces.
Express outcomes such as readShipment, browseRisk, or evaluateRate; keep HTTP paths and MCP JSON-RPC details behind adapters.
Use base https://api.flexport.com, Bearer authentication, optional Flexport-Version, documented envelopes, status/code/message errors, and link-style pagination where documented.
Use Streamable HTTP JSON-RPC at POST https://mcp.flexport.com/mcp. Treat the per-tool paths shown in reference pages as synthetic documentation, not literal REST routes.
Accept documented additive fields, preserve opaque identifiers/cursors, and reject missing required fields without guessing replacements.
Return a stable application result and surface provider metadata separately; do not force REST and MCP payloads into one lossy provider model.
Replay sanitized official-shape fixtures for success, pagination, permission errors, additive fields, and ambiguous transport failure.
REST calls authenticate with a cached OAuth 2.0 client-credentials Bearer token using audience https://api.flexport.com, or an explicitly accepted broad API key. Use distinct credentials per workload and never log credentials or tokens. MCP calls use the authenticated connection to https://mcp.flexport.com/mcp and remain subject to each tool's documented account permissions.
Use Read and Grep for discovery and evidence. Use Write or Edit only for the approved artifact, code, configuration, test, or receipt described by this workflow; do not make an unapproved Flexport-side change.
Return a machine-reviewable receipt in this shape; adapt the operation values, but never place credentials or provider payloads in it:
surface: rest-v3
operation: shipment-read
decision: approved
outcome: verified
evidence:
release_sha: recorded-out-of-band
provider_reference: redacted
rollback_owner: logistics-platform
The application calls one ShipmentReader interface. Its REST adapter follows shipment pagination links; its MCP adapter sends tools/call for browse_shipments and advances end_cursor, while both return the same minimal internal summary.
| Failure | Response |
|---|---|
| Synthetic tool path called as REST | Replace it with an MCP JSON-RPC tools/call request. |
| Unknown additive field | Preserve or ignore it safely; do not fail a tolerant reader. |
| Required field absent | Quarantine the response and compare against the current schema. |
| Transport outcome ambiguous | Reconcile the operation rather than blind-retrying a mutation. |