Terminal49

io.github.Terminal49由 GitHub 帳號 Terminal49 發布v1.1.0更新於 Nov 7, 2026

Live ocean container and shipment tracking with ETAs, holds, fees, and last free days.

已驗證Streamable HTTP可網頁執行位置與生活資料與分析商業與電商

概覽

AI 產生的概覽

Terminal49 MCP 伺服器,提供海運貨櫃與貨運即時追蹤,含預計到港時間、扣留、費用與最後免費日。

可以做什麼
  • 依櫃號、提單、訂艙號或參考號搜尋、辨識並追蹤貨櫃,列出或彙總貨運與貨櫃。
  • 讀取貨櫃詳情、航線、運輸事件時間軸、港口、碼頭、船舶及支援的船公司。
  • 查看追蹤請求、單據與 Terminal49 公開文件,並確認目前憑證與可用工具集。
  • 更新紀錄:為貨櫃或貨運設定參與方角色、自訂欄位、參考號與標籤。
  • 查詢貿易情報:進口商檔案、HS 商品代碼、進口商排名、趨勢與細分統計。
  • 使用內建提示詞完成追蹤貨運、評估滯櫃費風險與分析延誤。
適用情境
適合需要回答海運貨物狀態、預計到港、滯櫃費或堆存費風險,以及美國進口貿易樣貌等問題的情境,並希望答案來自 Terminal49 帳戶資料而非人工查詢。
執行需求
遠端 Streamable HTTP 端點 mcp.terminal49.com,透過 OAuth 2.1 瀏覽器登入驗證;無法使用該流程的用戶端需在 Authorization 標頭以 Token 方式提供 API 金鑰。本機 stdio 版本需 Node.js 24 與 T49_API_TOKEN 環境變數。呼叫 API 需要 Terminal49 帳戶與 API 金鑰。
安裝前請注意
寫入類工具會變更 Terminal49 紀錄:參與方角色、自訂欄位、參考號與標籤可能被覆寫或刪除;stop_shipment_tracking、cancel_tracking_request 等破壞性工具需先確認預覽,並使用由 T49_MCP_CONFIRMATION_SECRET 簽章的確認權杖。追蹤與恢復操作會消耗追蹤額度,可能產生按量付費。工具輸出視為不可信內容。選用的 Sentry 監控可記錄工具輸入輸出,其中可能包含貨運識別碼與客戶資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Terminal49,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.Terminal49%2Fterminal49/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "terminal49": {
      "type": "http",
      "url": "https://mcp.terminal49.com/"
    }
  }
}

README

Terminal49 MCP Server (TypeScript)

Vercel-native Model Context Protocol server for Terminal49's API, built with TypeScript and the official MCP SDK.

@terminal49/mcp is a private workspace in this repository. Connect a client to the hosted server at https://mcp.terminal49.com (Streamable HTTP). OAuth 2.1 needs no API key: the client discovers https://auth.terminal49.com and opens a browser sign-in. Clients that can't run that flow send Authorization: Token YOUR_API_KEY. Use the Token scheme for API keys. The Bearer scheme is used for OAuth access tokens. A local stdio process reads T49_API_TOKEN instead. Build steps are in Local Development.

🚀 Quick Deploy to Vercel

[Deploy with Vercel]

  1. Click "Deploy" above
  2. Add environment variable: T49_API_TOKEN=your_token_here
  3. Deploy!
  4. Your MCP server will be available at: https://your-deployment.vercel.app/api/mcp

📦 What's Included

🛠️ Tools (34 Available)

The default toolsets, core, documents, operations and trade, serve these 31:

ToolDescriptionKey Features
search_containerSearch by container#, BL, booking, or referenceFast fuzzy search
track_containerCreate tracking request and get container dataSCAC autocomplete ✨
identify_tracking_numberPredict a number's type and carrier and check whether it is already trackedCreates nothing
get_containerGet detailed container info with flexible data loadingOptional custom fields and party roles
get_shipment_detailsGet shipment routing, BOL, containers, portsOptional custom fields and party roles
get_container_transport_eventsGet full event timeline for a containerMilestone history
get_supported_shipping_linesList 40+ major carriers with SCAC codesFilterable by name/code
get_container_routeGet ports in route order with ETAs and the current vesselPremium feature
get_locationGet a port, terminal, or metro areaFIRMS code, address, time zone
get_vesselGet a vessel's position and, optionally, its projected track to a portProjection is a premium feature
list_shipmentsList shipments with filters and paginationFleet-level visibility
list_containersList containers with filters and paginationReturns ResourceLinks ✨
summarize_containersCount containers grouped by terminal, status, carrier, port, hold, or dateSame filters as list_containers
list_partiesFind parties by company name, or read one by IDFeeds advanced_filters.customer_id and advanced_filters.parties
list_custom_field_definitionsList the account's custom fields, their types, and enum optionsNeeds a signed-in user
list_tracking_requestsList tracking requests and statusesAudit and monitoring
get_tracking_requestGet one tracking request's status, failure reason, and shipmentFollow-up after tracking
list_documentsFind documents by file name, reference, or typeNever returns extracted data or file links
get_documentGet one document, with opt-in extracted data, source email, and download linkUntrusted content is labeled
search_docsSearch the public Terminal49 documentationReturns links to cite
whoamiIdentify the credential, its account, the features it can use, and the session's toolsetsExplains empty or unauthorized results
set_party_roleAttach, replace, or detach a party (such as the drayage carrier) on up to 50 containers or shipmentsC: asks before a record loses a party; add runs at once
set_custom_fieldSet or clear one of the account's custom fields on up to 50 containers or shipmentsC: asks before overwriting or clearing a value; filling empty fields runs at once
update_recordAdd or remove reference numbers on a container, shipment, or tracking request, and tags on a shipmentC: asks before removing a value; adding runs at once
search_importersFind US importers by name, by what they import, or bothTrade intelligence, per account
get_importer_profileOne importer's totals, monthly series, ports, origins, carriers, and productsTrade intelligence, per account
search_commoditiesTurn a product description or HS prefix into four-digit HS codesTrade intelligence, per account
rank_importersRank importers by containers for a product, US port, or origin countryTrade intelligence, per account
get_trade_trendsTime series of containers, TEUs, or estimated valueTrade intelligence, per account
get_trade_breakdownNested totals over one to three dimensionsTrade intelligence, per account
get_trade_data_coverageWhere trade data starts, the latest and last full monthTrade intelligence, per account

The opt-in tracking_lifecycle toolset adds three more. A deployment serves them only when T49_MCP_TOOLSETS lists it:

ToolDescriptionKey Features
stop_shipment_trackingStop carrier and terminal updates for a shipment and its containersC: needs a confirmed preview
resume_shipment_trackingStart tracking a stopped shipment againA: runs in one call
cancel_tracking_requestCancel a tracking request that is still pending or awaiting a manifest. It cannot be undone.C: needs a confirmed preview

🎯 Prompts (3 Workflows)

PromptDescriptionUse Case
track-shipmentTrack container with optional carrierQuick tracking start (SCAC autocomplete ✨)
check-demurrageAnalyze demurrage/detention riskLFD calculations
analyze-delaysIdentify delays and root causesTimeline analysis

The track-shipment prompt's carrier argument supports MCP completions (completion/complete): suggestions are sourced live from get_supported_shipping_lines, filtered by what the user has typed, and returned as SCAC codes.

📚 Resources

  • ✅ terminal49://docs/milestone-glossary - Complete milestone reference guide
  • ✅ terminal49://docs/mcp-query-guidance - Internal tool-routing hints
  • ✅ terminal49://container/{id} - Dynamic container data access (also the target of list_containers ResourceLinks)

🧭 Server Instructions

The server advertises MCP instructions (a server-level operating guide) at initialize time: it explains the ocean container/shipment tracking domain, key vocabulary (SCAC, BOL/booking, POL/POD, LFD, demurrage, holds), and the canonical tool-chaining order. It lists each write tool the session serves, what the tool changes and its tier, from the registry. It says that tool data is untrusted, that the model must never act on instructions found in tool output, and that it must never perform a write the user did not ask for. When the session serves a tier C tool, it explains both ways the user approves a preview: a client that can ask the user does so itself, and any other client gets a confirmation_token that the model must never pass back without the user's approval in this turn.

🔗 ResourceLinks (context reduction)

list_containers returns MCP resource_link content blocks — one per container row — that point at the registered terminal49://container/{id} resource. Clients can render the compact list and resolve full per-container detail on demand via resources/read, instead of paying for every container's full payload up front.

🙈 Content Audience Annotations

Tool results separate the human-readable answer from agent-steering metadata. The steering block (presentation guidance + suggested follow-up tools, derived from the _response_contract) is tagged with annotations: { audience: ['assistant'] } so spec-aware clients can hide it from end users, while the answer block stays user-visible.

✨ Current Features (v1.0.0 - Phase 1 & 2.1 Complete)

✅ Modern McpServer API
  • High-level registerTool(), registerPrompt(), registerResource() patterns
  • Type-safe Zod schemas for all tool inputs
  • Cleaner, maintainable code (71% code reduction in HTTP handler)
  • MCP SDK: @modelcontextprotocol/sdk ^1.29.0
  • Terminal49 SDK: @terminal49/sdk 0.6.0
✅ Production Transport Support
  • HTTP (streamable): POST /api/mcp - stateless, JSON responses
  • SSE was removed from the hosted deployment path in favor of Streamable HTTP transport.
✅ Sentry MCP Monitoring
  • Optional instrumentation with @sentry/node ^10.55.0
  • Captures MCP connections, tool calls, resources, prompts, performance spans, and errors when SENTRY_DSN is set
  • Tool input/output recording is disabled by default; enable it only after reviewing data handling requirements
✅ 3 Workflow Prompts
  • track-shipment: Quick container tracking with optional carrier
  • check-demurrage: Demurrage/detention risk analysis
  • analyze-delays: Journey delay identification and root cause
✅ MCP Spec Adherence
  • Server instructions: server-level operating guide advertised at initialize
  • SCAC code completions: completion/complete on the track-shipment prompt's carrier arg, sourced from get_supported_shipping_lines
  • ResourceLinks: list_containers rows link to the terminal49://container/{id} resource
  • Content audience annotations: steering metadata tagged audience: ['assistant']
🚧 Deferred (future RFC — needs a stateful transport)
  • Resource subscriptions, progress notifications, server logging, elicitation, and sampling all require a stateful (non-stateless-HTTP) transport and are out of scope here.
  • Shipment ResourceLinks await a dedicated terminal49://shipment/{id} resource template (only the container template is currently registered).

🏗️ Architecture

/api/mcp.ts                  # Vercel serverless function (HTTP)/packages/mcp/  ├── src/  │   ├── server.ts          # MCP server (stdio)  │   ├── index.ts           # Stdio entry point  │   ├── tools/             # MCP tools  │   └── resources/         # MCP resources  └── package.json

The MCP server depends on the workspace package @terminal49/sdk. Build that package before you build packages/mcp.

Transport:

  • HTTP: Vercel serverless function at /api/mcp (for hosted use)
  • stdio: Local process for Claude Desktop (node packages/mcp/dist/index.js after the build in Local Development)

Store submission

The public connector URL is https://mcp.terminal49.com. Store assets and submission metadata are checked in at the repository root:

  • chatgpt-app-submission.json — locked ChatGPT listing copy and review cases
  • claude-connector-submission.json — values to enter in Claude's submission portal
  • server.json — official MCP Registry metadata used for Copilot discovery
  • public/store-icons/terminal49-{light,dark}.png — 512×512 brand icons

Cline and other clients that read a marketplace install guide from the server subfolder use packages/mcp/llms-install.md.

Verify the domain for ChatGPT

OpenAI generates a unique domain-verification token during submission. Add that exact value to the existing MCP Vercel project:

bash
vercel env add OPENAI_APPS_CHALLENGE

After the project redeploys, verify that the well-known endpoint returns only the token you pasted:

bash
curl --fail --silent \  https://mcp.terminal49.com/.well-known/openai-apps-challenge

Do not commit the token. The endpoint returns an empty 404 response while OPENAI_APPS_CHALLENGE is unset. Submit the connector and the values in chatgpt-app-submission.json through the OpenAI plugin submission flow.

Submit to Claude

Use the Claude Connectors Directory portal and enter the values in claude-connector-submission.json. Upload the light icon from public/store-icons/terminal49-light.png; the dark variant is available for clients that support theme-specific assets.

Publish for Copilot discovery

GitHub's Copilot registry is a curated downstream discovery surface. The root server.json is the official MCP Registry entry (io.github.Terminal49/terminal49).

.github/workflows/publish-mcp.yml publishes that file to https://registry.modelcontextprotocol.io. It runs when a push to main changes server.json, and a maintainer can start it with workflow_dispatch on main. The job authenticates with GitHub OIDC (mcp-publisher login github-oidc) and then runs mcp-publisher publish. The io.github.Terminal49 namespace is authorized for OIDC from this organization repository, so the workflow needs no registry secret.

Bump version in server.json for each metadata change. The registry keeps published versions, and a second publish of the same version is rejected.


🛠️ Local Development

Prerequisites

  • Node.js 24.22.1 or a newer Node 24 release (.tool-versions pins 24.22.1)
  • A Terminal49 API key (create one) for tool calls that reach the API

Setup

@terminal49/mcp is a private workspace. From a clone of this repository, on Node.js 24.22.1 or a newer Node 24 release:

bash
git clone https://github.com/Terminal49/API.gitcd APInpm cinpm run build --workspace @terminal49/sdknpm run build --workspace @terminal49/mcp

The MCP server depends on the workspace package @terminal49/sdk. Build that package first, as the commands above do. The stdio entrypoint is packages/mcp/dist/index.js. It reads T49_API_TOKEN and exits if that variable is unset.

Run locally

bash
T49_API_TOKEN=YOUR_API_KEY node packages/mcp/dist/index.js

Test the API

Smoke-test initialize, then tools/list:

bash
printf '%s\n' \  '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"smoke","version":"1.0"}}}' \  '{"jsonrpc":"2.0","method":"notifications/initialized"}' \  '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \  | T49_API_TOKEN=YOUR_API_KEY node packages/mcp/dist/index.js

🌐 Using with Vercel Deployment

Deploy

bash
# Install Vercel CLInpm i -g vercel
# Deploy to Vercelvercel
# Set environment variablevercel env add T49_API_TOKEN

Configure MCP Client

Once deployed, your MCP server will be at: https://your-deployment.vercel.app/api/mcp

For Claude Desktop or other MCP clients:

json
{  "mcpServers": {    "terminal49": {      "url": "https://your-deployment.vercel.app/api/mcp",      "headers": {        "Authorization": "Token your_api_token_here"      }    }  }}

For Cursor IDE:

json
{  "mcp": {    "servers": {      "terminal49": {        "url": "https://your-deployment.vercel.app/api/mcp",        "headers": {          "Authorization": "Token your_api_token_here"        }      }    }  }}

🔧 API Reference

HTTP Endpoint

URL: POST /api/mcp

Headers:

Authorization: Token your_api_token_hereContent-Type: application/json

Request (JSON-RPC):

json
{  "jsonrpc": "2.0",  "method": "tools/call",  "params": {    "name": "get_container",    "arguments": {      "id": "123e4567-e89b-12d3-a456-426614174000"    }  },  "id": 1}

Response:

json
{  "jsonrpc": "2.0",  "result": {    "content": [      {        "type": "text",        "text": "{\"id\":\"...\",\"container_number\":\"...\", ...}"      }    ]  },  "id": 1}

Available Methods

MethodDescription
initializeInitialize MCP connection
tools/listList available tools
tools/callExecute a tool
resources/listList available resources
resources/readRead a resource

🔐 Authentication

For Vercel Deployment (HTTP)

Set as environment variable in Vercel dashboard:

T49_API_TOKEN=your_token_here

Or include in request headers:

Authorization: Token your_token_here

Token is the preferred scheme. Bearer your_token_here is also accepted for backward compatibility.

For Local stdio

Set in your environment:

bash
export T49_API_TOKEN=your_token_here

🧪 Testing

bash
# Run testsnpm test
# Type checkingnpm run type-check
# Lintingnpm run lint

📝 Environment Variables

VariableRequiredDefaultDescription
T49_API_TOKEN✅ Yes-Terminal49 API token
T49_API_BASE_URLNohttps://api.terminal49.com/v2API base URL
T49_MCP_TOOLSETSNocore,documents,operations,tradeComma-separated toolsets this deployment serves. See Toolsets.
T49_MCP_READ_ONLYNofalseServe only tools whose readOnlyHint is true. Accepts true, false, 1 or 0, in any case.
T49_MCP_ALLOW_SHARED_TOKEN_WRITESNofalseServe toolsets other than core and trade when callers share T49_API_TOKEN
T49_MCP_CONFIRMATION_SECRETFor tier C writes over HTTP-Signs confirmation tokens. At least 32 characters. See Confirming writes.
OPENAI_APPS_CHALLENGEOnly for ChatGPT submission-Exact domain-verification token issued by the OpenAI submission portal
NODE_ENVNodevelopmentEnvironment
LOG_LEVELNoinfoLogging level
REDACT_LOGSNotrueRedact tokens in logs
SENTRY_ENABLEDNotrueEnables or disables Sentry when a DSN is configured
SENTRY_DSNNo-Enables Sentry MCP Monitoring when set
SENTRY_ENVIRONMENTNoNODE_ENVSentry environment name
SENTRY_RELEASENoVERCEL_GIT_COMMIT_SHASentry release identifier
SENTRY_TRACES_SAMPLE_RATENo1.0Trace sampling rate from 0 to 1
SENTRY_MCP_RECORD_INPUTSNofalseRecord MCP tool/prompt inputs in Sentry
SENTRY_MCP_RECORD_OUTPUTSNofalseRecord MCP tool/prompt outputs in Sentry
SENTRY_SEND_DEFAULT_PIINofalseEnables Sentry default PII behavior

Only enable SENTRY_MCP_RECORD_INPUTS or SENTRY_MCP_RECORD_OUTPUTS after confirming that your Sentry project is approved to store shipment identifiers, references, and customer data.

Credential headers (Authorization, cookies, and any header whose name contains auth, token, secret, cookie, session, api-key, password, or signature) and request cookies are removed from every error and transaction event before it is sent, regardless of SENTRY_SEND_DEFAULT_PII.

Signed URLs, such as the document download link that get_document returns, are replaced with [REDACTED_URL] in logs, Sentry events and PostHog events. Confirmation tokens are replaced with [REDACTED_CONFIRMATION_TOKEN] in the same places. This holds even when SENTRY_MCP_RECORD_OUTPUTS is on.

Toolsets

Each tool belongs to one toolset in src/tools/registry.ts: core, documents, operations, tracking_lifecycle, documents_write, developer or trade. list_documents and get_document are in documents. set_party_role, set_custom_field and update_record are in operations. stop_shipment_tracking, resume_shipment_tracking and cancel_tracking_request are in tracking_lifecycle, which no deployment serves until T49_MCP_TOOLSETS lists it. The trade intelligence tools are in trade. Every other tool today is in core. documents_write and developer have no tools yet. The default toolsets are core, documents, operations and trade. whoami reports the toolsets a session serves and whether it has write tools.

  • T49_MCP_TOOLSETS lists the toolsets the server allows. stdio and the HTTP gateway both read it. An unknown name, or a value made only of commas, stops stdio with an error that names the variable. HTTP requests fail with a generic 500, and the gateway logs the cause.
  • The X-T49-MCP-Toolsets request header can only narrow that list. The server serves the toolsets that appear in both. An unknown name, or a value made only of commas, returns 400.
  • X-T49-MCP-Read-Only: true or T49_MCP_READ_ONLY=true removes every tool whose readOnlyHint is false, including track_container. Both accept true, false, 1 or 0, in any case. Any other header value returns 400. The header cannot turn off read-only mode that the env turned on.
  • The server instructions name only the tools the session serves.
  • When the gateway uses one shared T49_API_TOKEN, it serves only core and the read-only trade toolset unless T49_MCP_ALLOW_SHARED_TOKEN_WRITES=true.
  • Toolsets are never read from the connector URL. The OAuth resource stays the root origin.

Confirming writes

Clients own the permission UI. The server supplies write annotations, consequence descriptions and preview flows so clients and models can distinguish consequential actions even when routine tool calls are auto-approved. Additive does not mean free: track_container and resume_shipment_tracking consume tracking quota and may incur pay-as-you-go charges. Both carry the client interaction hint without being mislabeled destructive; explain the cost consequence before acting. The hint's effect depends on the client.

State checks are best-effort reads, not atomic preconditions on the Terminal49 write. A concurrent edit after the check can still be overwritten, including a field classified as empty before another writer fills it. Preventing that race requires backend conditional writes.

Each write tool has a tier in the registry. A tier A tool, such as resume_shipment_tracking, is additive or reversible and runs in one call. Its result names the tool that undoes it. A tier C tool, such as stop_shipment_tracking or cancel_tracking_request, has destructiveHint: true, carries _meta["anthropic/requiresUserInteraction"]: true to request interaction in clients that support this hint, and needs the user's approval of a preview. Its first call never writes. It reads the record, builds a preview with current, proposed and reach, and issues a confirmation token: an HMAC-SHA256, keyed with T49_MCP_CONFIRMATION_SECRET, over the channel, the tool name, the other arguments, the account, the credential, an expiry five minutes out, a random nonce and a fingerprint of the record fields the preview showed. Which channel carries the token depends on the request.

Elicitation channel. A request whose 2026-07-28 _meta envelope declares form elicitation (io.modelcontextprotocol/clientCapabilities.elicitation.form, or a bare elicitation: {}) gets an input_required result per the MCP multi round-trip pattern: one embedded elicitation/create request whose message is the preview as text and whose form has one boolean confirm field, plus the token as requestState. The client shows the user the preview, then retries the call with the user's answer in inputResponses and the requestState echoed back. The tool verifies the state against the same call, account, credential, expiry and record fingerprint, and:

  • writes when the answer is accept with confirm: true;
  • returns status: "declined" and changes nothing on decline, cancel, or an accept without confirm;
  • asks again, with a note that the record changed, when the fingerprint no longer matches;
  • returns invalid_confirmation when the state is malformed, edited, expired, or bound to another call, account or credential.

A confirmation_token argument on such a request is refused with token_not_accepted before the record is read, so a model cannot route around the user. The model never receives a token on this channel.

Token channel. Any other request, including every 2025-era connection, gets the preview-then-token flow:

  1. Called without confirmation_token, the tool returns status: "confirmation_required", the preview, a confirmation_token and expires_at.
  2. Called again with the same arguments and that token, it reads the record again and writes only if the token still matches.

A call with a token returns invalid_confirmation when the token is malformed, edited, expired, or was issued for another tool, other arguments, another account or another credential; stale_preview with a new preview and token when the record changed after the preview; and the tool's own result when the token matches. Nothing changes in the first two cases.

A token minted for one channel never verifies on the other, because the channel is part of the MAC. For an API key or the shared env token, the credential is a hash of the token. For an OAuth user or a WorkOS agent, it is the credential that /me names, because the gateway can call Terminal49 with a new access token on each request.

On the elicitation channel the human decides, because only the client can answer the embedded request. On the token channel the token proves that a preview of the current state was produced. It blocks blind one-shot destructive calls and detects state changes visible to its reread, but it is not a security boundary, because a model can make both calls itself. The Terminal49 API still decides what each credential may do.

Batch tools. set_party_role and set_custom_field change up to 50 records per call and are tier C with confirms: "destructive_only" in the registry. Every call reads each record first and plans one change per record. A call whose changes only add (action: "add", a replace that detaches nobody, or filling fields that are empty) writes at once, with no preview and no token. A call in which any record would lose a party or a value asks once for the whole batch: the preview lists each record that changes (id, current, proposed), counts the unchanged ones, and names records that cannot be changed with their error. The approval's fingerprint covers the state of every record the call read, changing or not, so a change to any of them between the preview and the approval asks again. A batch that mixes additive and destructive records asks for all of it. After the approval the result keeps the per-record shape (updated, unchanged, failed, not_attempted, summary); a record that fails after approval does not release the approval, because other records in the batch may have been written, and a repeat call plans again from the current state. Reads get half of the call's remaining time budget so one slow record cannot hold every write until the deadline.

Every tier C tool fingerprints the fields its write changes: stop_shipment_tracking the stop time, cancel_tracking_request the status, set_party_role the party role assignments (by assignment id) in the role on every record, and set_custom_field the field's value and its updated_at on every record. For the two batch tools a restored record never matches again: a party attached back gets a new assignment id, and a value put back gets a new updated_at, so restoring a value or assignment invalidates an earlier approval on a subsequent read. These checks are not atomic across concurrent gateway instances. The shipment resource has no such field, so after resume_shipment_tracking a shipment looks as it did before the stop. The server therefore also remembers each confirmation that made a write until it expires, and refuses a second use with invalid_confirmation and reason used. For single-record lifecycle tools, a definite 4xx refusal releases the confirmation. For batch tools, only a 429 releases it, and only if no write in the call succeeded or may have applied; other record failures require a new preview. A batch 429 stops further work and returns retry_after_s plus the per-record results; partial or uncertain writes keep the confirmation spent. After a 5xx or a lost response the write may have happened, so the confirmation stays used and the caller previews again. That memory is per process. On a deployment with several instances, such as the HTTP gateway, another instance can still accept a stop_shipment_tracking confirmation once more within its five minutes, after a resume.

The HTTP gateway reads T49_MCP_CONFIRMATION_SECRET and has no fallback, because serverless instances share no memory. Without a secret of at least 32 characters, a tier C call that needs the user's approval returns not_permitted with a message that names the variable, and the server logs mcp.config.error; a call that only adds, such as set_party_role with action: "add", still runs. Set it in Vercel before you serve operations or tracking_lifecycle. stdio uses the variable when it is at least 32 characters. Otherwise it makes a random secret per process, and warns on stderr when the variable is set but too short. Rotating the secret only means an open preview must be requested again.

Each call to a write tool, track_container included, emits one mcp.write.audit event to the log and a Sentry breadcrumb, and to PostHog when the account is known. It carries the tool, tier, phase, outcome, entity type and ID, account ID and credential type, and nothing else. Values, reference numbers, party names, URLs and tokens never reach it.


🆚 Ruby vs TypeScript

This repo includes two implementations:

FeatureRuby (/mcp)TypeScript (/packages/mcp + /api)
DeploymentRailway, Fly.io, Heroku✅ Vercel (native)
HTTP TransportRack/Puma✅ Vercel Serverless
stdio Transport✅ Yes✅ Yes
StatusCompleteComplete
Use CaseStandalone serversVercel deployments

Recommendation: Use TypeScript for Vercel deployments (zero-config, auto-scaling).


🚦 Vercel Configuration

The project includes vercel.json for optimal Vercel deployment:

json
{  "functions": {    "api/mcp.ts": {      "runtime": "nodejs20.x",      "maxDuration": 30,      "memory": 1024    }  }}

Configuration Notes

  • Runtime: Node.js 20.x
  • Max Duration: 30 seconds (adjustable for Pro/Enterprise)
  • Memory: 1024 MB
  • CORS: Enabled for all origins (Access-Control-Allow-Origin: *)

🐛 Troubleshooting

"T49_API_TOKEN is required" error

Solution: Set environment variable in Vercel dashboard or locally:

bash
vercel env add T49_API_TOKEN

"Method not allowed" error

Solution: Ensure you're using POST method, not GET:

bash
curl -X POST https://your-deployment.vercel.app/api/mcp \  -H "Authorization: Token your_token" \  -H "Content-Type: application/json" \  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

CORS errors in browser

Solution: CORS is configured in vercel.json. If issues persist, check Vercel deployment logs:

bash
vercel logs

Timeout errors

Solution: Increase maxDuration in vercel.json (requires Vercel Pro/Enterprise):

json
{  "functions": {    "api/mcp.ts": {      "maxDuration": 60    }  }}

📚 Documentation


🤝 Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/my-tool
  3. Make changes in /packages/mcp/src/
  4. Add tests
  5. Run type check: npm run type-check
  6. Submit PR

📄 License

Copyright 2024 Terminal49. All rights reserved.


🆘 Support


Built with MCP TypeScript SDK 🚀

來源:packages/mcp/README.md,提交 3f4f777

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

2
  1. v1.1.0最新Oct 31, 2026
  2. v1.0.0Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分