Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

flexport-sdk-patterns

/flexport-sdk-patterns

Projektuje typowane adaptery dla Flexport REST v3 i serwera MCP, zachowując różnice ich kontraktów, przy budowie biblioteki klienta, parsera odpowiedzi i transportu MCP.

Licencja
MIT
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
7
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Projektuje typowane adaptery dla Flexport REST v3 i serwera MCP, zachowując różnice ich kontraktów, przy budowie biblioteki klienta, parsera odpowiedzi i transportu MCP.

Wyzwalacze z opisu

build Flexport clienttype Flexport responsesconnect Flexport MCP

Argumenty

/flexport-sdk-patterns [language-and-required-capabilities]
Oryginalny opis (EN)

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".

Jak działa

  1. Overview
  2. Prerequisites
  3. Instructions
  4. Authentication
  5. Tool Discipline
  6. Output
  7. Examples
  8. Error Handling
  9. Resources
Sekcje z nagłówków SKILL.md, w oryginale · 86 linii, 475 słów
Podgląd SKILL.md
---
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:
  - saas
  - flexport
  - architecture
  - sdk
compatibility: 'Requires current Flexport v3 and MCP schemas plus a typed application language or runtime validation library.'
---

# Flexport Dual-Surface Client Contracts

## Overview

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.

## Prerequisites

- Inventory of required REST endpoints and MCP tools
- Pinned account/version behavior and schema snapshot date
- Runtime validation, redaction, timeout, and test-fixture strategy

## Instructions

### Step 1: Define business ports

Express outcomes such as `readShipment`, `browseRisk`, or `evaluateRate`; keep HTTP paths and MCP JSON-RPC details behind adapters.

### Step 2: Build the REST adapter

Use base `https://api.flexport.com`, Bearer authentication, optional `Flexport-Version`, documented envelopes, status/code/message errors, and link-style pagination where documented.

### Step 3: Build the MCP adapter

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.

### Step 4: Validate at runtime

Accept documented additive fields, preserve opaque identifiers/cursors, and reject missing required fields without guessing replacements.

### Step 5: Normalize evidence, not schemas

Return a stable application result and surface provider metadata separately; do not force REST and MCP payloads into one lossy provider model.

### Step 6: Contract-test both surfaces

Replay sanitized official-shape fixtures for success, pagination, permission errors, additive fields, and ambiguous transport failure.

## Authentication

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.

## Tool Discipline

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.

## Output

- Scoped decision or implementation artifact
- Redacted operation and validation receipt
- Failure, rollback, and follow-up ownership record

Return a machine-reviewable receipt in this shape; adapt the operation values, but never place credentials or provider payloads in it:

```yaml
surface: rest-v3
operation: shipment-read
decision: approved
outcome: verified
evidence:
  release_sha: recorded-out-of-band
  provider_reference: redacted
rollback_owner: logistics-platform
```

## Examples

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.

## Error Handling

| 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. |

## Resources

- [First-party source notes](references/official-docs.md)
- [Flexport v3 API reference](https://apidocs.flexport.com/v3/)
- [MCP tools](https://apidocs.flexport.com/v3/tag/MCP-Tools/)
- [Versioning](https://apidocs.flexport.com/v3/tag/Versioning/)
Pliki w paczce (2)
  • SKILL.md 4 KB
  • references/official-docs.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie flexport-sdk-patterns.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki e4581f197fca (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100flexport-reference-architecture
    Projektuje i analizuje architekturę integracji Flexport rozdzielającą zasoby REST v3, narzędzia MCP, wejście webhooków, zatwierdzanie i uzgadnianie, w tym model zagrożeń i granice usług.
  • 100flexport-migration-deep-dive
    Migruje starszą integrację Flexport (v2) do v3 i kontraktów MCP, bez ryzykownych równoległych zapisów na produkcji.
  • 100flexport-webhooks
    Odbiera i weryfikuje webhooki Flexport, w tym podpis X-Hub-Signature-256 i zdarzenia logistyczne takie jak /shipment#created i /shipment_leg#departed.
  • 100api-sdk-generator
    Generuje kod SDK klienta, biblioteki wrapperów API, modele żądań i odpowiedzi oraz wzorce użycia w wybranym języku dla dowolnego API REST.
  • 90mcp-integration
    Projektuje i przegląda integrację klienta lub serwera MCP: narzędzia, zasoby, prompty, transport i uwierzytelnianie.
  • 100mcp-server-patterns
    Pomaga budować serwery MCP w SDK Node/TypeScript: narzędzia, zasoby, prompty, walidację Zod oraz wybór transportu stdio lub HTTP.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.