Compare commits
4 Commits
df1c419539
...
v2.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
| f48c86c3f9 | |||
| 8aa306bf63 | |||
| eeba92042c | |||
| 5e25a6277c |
@@ -1,5 +1,24 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.7.1] - 2026-11-24
|
||||||
|
|
||||||
|
### Added & Improved (Global AI Partner Directory Readiness)
|
||||||
|
- **MCP 2025-03-26 Tool Annotations (`src/server.ts`)**: Added accurate `title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint` annotations across all 13 tools (required by Anthropic Claude Connectors Directory, OpenAI ChatGPT Apps/Connectors Directory, and Google Antigravity Marketplace).
|
||||||
|
- **Expanded Global AI Partner OAuth Redirect Allowlist (`src/middleware/oauth.ts`)**: Added `claude.com` (alongside `claude.ai`), `cursor.com`, `cursor.sh`, `windsurf.com`, `codeium.com`, `perplexity.ai`, `mistral.ai`, `poe.com`, `huggingface.co`, `github.com`, `vscode.dev`, `raycast.com`, `zapier.com`, `make.com`, `n8n.io`, `n8n.cloud`, `pipedream.com`, and `activepieces.com`.
|
||||||
|
- **Official Antigravity Marketplace & MCP Registry Schema Parity**: Added `"$schema": "https://antigravity.google/schemas/v1/plugin.json"`, `privacyPolicyUrl`, and `termsOfServiceUrl` to `plugin.json`; aligned `mcp_config.json` to official Antigravity `"serverUrl"` format; updated `skills/courier-ops/SKILL.md` to all 13 live tools; added hosted `"remotes"` Streamable HTTP declaration to `server.json`.
|
||||||
|
- **Terms of Service (`terms.html` / `GET /terms`)**: Added official Terms of Service page linked from OAuth Consent UI and `plugin.json`.
|
||||||
|
|
||||||
|
## [2.7.0] - 2026-11-24
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Standard MCP OAuth 2.1 + PKCE (`S256`) Authorization Server (`src/middleware/oauth.ts`)**:
|
||||||
|
- **RFC 9728 Protected Resource Metadata**: `GET /.well-known/oauth-protected-resource` and `/.well-known/oauth-protected-resource/mcp` + `WWW-Authenticate` challenge on all `401 Unauthorized` `/mcp` responses (`POST`, `GET`, `DELETE`) with CORS exposure (`Access-Control-Expose-Headers: mcp-session-id, WWW-Authenticate`).
|
||||||
|
- **RFC 8414 Authorization Server Metadata**: `GET /.well-known/oauth-authorization-server` and `/.well-known/openid-configuration` advertising PKCE `S256`, `authorization_code`, and `refresh_token` grants.
|
||||||
|
- **RFC 7591 Dynamic Client Registration (`POST /oauth/register`)**: Restart-proof HMAC-signed client IDs supporting Google Gemini (`*.googleusercontent.com`), Claude, ChatGPT, Antigravity, Cursor, VS Code, and RFC 8252 loopback redirects while strictly rejecting untrusted redirect hosts.
|
||||||
|
- **Silicon Valley Global Consent & Aura Cloud SSO (`GET/POST /oauth/authorize`)**: Instant 1-click consent for signed-in Aura Cloud accounts (`aura_access` cookie), native **Continue with Google** & Work Email sign-in via `auth.auraajenticai.cloud`, Developer/Merchant API Key tab, 1-click Read-Only Sandbox for evaluators, and crisp inline vector SVG branding.
|
||||||
|
- **Gemini-Safe Non-Rotating Refresh & Dual-Auth (`POST /oauth/token`, `POST /oauth/revoke`, `src/middleware/auth.ts`)**: `application/x-www-form-urlencoded` + JSON token exchange with PKCE `S256`, 180-day non-rotating refresh tokens (preventing Google Gemini unlinking), and full Dual-Auth compatibility preserving static Bearer API Keys, PostgreSQL dynamic keys (`aura_courier_runtime`), and BYOK carrier headers.
|
||||||
|
- **Automated OAuth 2.1 Acceptance Suite (`test/oauth21.test.mjs`)**: Full end-to-end verification of discovery, DCR, SSO cookie consent, Read-Only Sandbox, PKCE `S256`, non-rotating refresh, Dual-Auth, and RFC 7009 revocation alongside all 25 existing tests.
|
||||||
|
|
||||||
## [2.6.1] - 2026-11-13
|
## [2.6.1] - 2026-11-13
|
||||||
|
|
||||||
### Fixed & Changed
|
### Fixed & Changed
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ RUN npm install --no-audit --no-fund
|
|||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY assets ./assets
|
COPY assets ./assets
|
||||||
COPY configs ./configs
|
COPY configs ./configs
|
||||||
COPY README.md index.html guide.html health.html privacy.html mcp_explorer.html simulator.html ./
|
COPY README.md index.html guide.html health.html privacy.html terms.html mcp_explorer.html simulator.html ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# 🚚 AURA COURIER MCP v2.6.1 — THE ENTERPRISE LOGISTICS MASTER MANUAL
|
# 🚚 AURA COURIER MCP v2.7.1 — THE ENTERPRISE LOGISTICS MASTER MANUAL
|
||||||
### Universal Multi-Carrier Logistics Engine, Spatial Intelligence Hub & Zero-Risk COD Gateway
|
### Universal Multi-Carrier Logistics Engine, Spatial Intelligence Hub & Zero-Risk COD Gateway
|
||||||
**Published by Aura Agentic AI · Architected with DeepMind Principles & Google Maps Platform**
|
**Published by Aura Agentic AI · Architected with DeepMind Principles & Google Maps Platform**
|
||||||
|
|
||||||
[](https://cloud.google.com/find-a-partner/partner/aura-ajentic-ai)
|
[](https://cloud.google.com/find-a-partner/partner/aura-ajentic-ai)
|
||||||
[](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp)
|
[](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp)
|
||||||
[](plugin.json)
|
[](plugin.json)
|
||||||
[](https://courier.auraajenticai.cloud/guide)
|
[](https://courier.auraajenticai.cloud/guide)
|
||||||
[](https://opensource.org/licenses/Apache-2.0)
|
[](https://opensource.org/licenses/Apache-2.0)
|
||||||
[](https://courier.auraajenticai.cloud)
|
[](https://courier.auraajenticai.cloud)
|
||||||
@@ -227,7 +227,7 @@ curl -s https://courier.auraajenticai.cloud/health | jq
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"ok": true,
|
"ok": true,
|
||||||
"version": "2.6.1"
|
"version": "2.7.1"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ Add this configuration block to your client settings (`claude_desktop_config.jso
|
|||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"aura-courier": {
|
"aura-courier": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "aura-courier-mcp@2.6.1"],
|
"args": ["-y", "aura-courier-mcp@2.7.1"],
|
||||||
"env": {
|
"env": {
|
||||||
"PORT": "8080",
|
"PORT": "8080",
|
||||||
"GOOGLE_MAPS_API_KEY": "<GOOGLE_MAPS_API_KEY>",
|
"GOOGLE_MAPS_API_KEY": "<GOOGLE_MAPS_API_KEY>",
|
||||||
@@ -340,6 +340,11 @@ Bundles the complete `courier-ops` skill (9 tools), `rules/COURIER_RULES.md` (sm
|
|||||||
|
|
||||||
## 9. Version History & Glama TDQS 5.0 Audit Log
|
## 9. Version History & Glama TDQS 5.0 Audit Log
|
||||||
|
|
||||||
|
* **v2.7.1 (Nov 24, 2026)**:
|
||||||
|
- **Global AI Agent Partner Directory Certification Ready**: Added MCP 2025-03-26 tool annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on all 13 tools, `claude.com` + global AI/automation OAuth partner redirects, official Antigravity `$schema` + `serverUrl` + 13-tool `SKILL.md`, Official MCP Registry `remotes` in `server.json`, live `/terms` Terms of Service, and npm `2.7.1` sync.
|
||||||
|
* **v2.7.0 (Nov 24, 2026)**:
|
||||||
|
- **Standard MCP OAuth 2.1 + PKCE (`S256`) + RFC 9728 / 8414 / 7591 DCR**: Native remote OAuth connectivity for **Google Gemini**, **Antigravity Marketplace**, **ChatGPT**, and **Claude Web** with 1-click Aura Cloud SSO, Google Sign-In, Developer API Key Dual-Auth, and non-rotating refresh tokens.
|
||||||
|
- **13 Live Logistics & Spatial Tools + Full Glama / Antigravity Plugin Parity**: Synchronized all manifests (`package.json`, `plugin.json`, `server.json`, `validate_plugin.js`) and expanded automated tests (`30+` passing).
|
||||||
* **v2.6.1 (Nov 13, 2026)**:
|
* **v2.6.1 (Nov 13, 2026)**:
|
||||||
- **Single-Source-of-Truth Release Parity (`src/version.ts`)**: Unified version synchronization across `package.json`, `server.json`, `plugin.json`, `/health`, MCP Server metadata, GitHub Releases, Gitea, Glama Registry, and live web UI (`v2.6.1`).
|
- **Single-Source-of-Truth Release Parity (`src/version.ts`)**: Unified version synchronization across `package.json`, `server.json`, `plugin.json`, `/health`, MCP Server metadata, GitHub Releases, Gitea, Glama Registry, and live web UI (`v2.6.1`).
|
||||||
- **TypeScript Strict `pnpm` Compatibility & Silicon Valley UI**: Explicit Express typing resolving Glama Dockerfile `TS2742`, inline SVG carrier/tool iconography, RedX monogram badge, and interactive `#hubmap` canvas animation.
|
- **TypeScript Strict `pnpm` Compatibility & Silicon Valley UI**: Explicit Express typing resolving Glama Dockerfile `TS2742`, inline SVG carrier/tool iconography, RedX monogram badge, and interactive `#hubmap` canvas animation.
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ Connect any AI Agent / IDE to Aura Courier MCP in seconds.
|
|||||||
- **Server-Sent Events / SSE (Claude Desktop, Remote SSE)**:
|
- **Server-Sent Events / SSE (Claude Desktop, Remote SSE)**:
|
||||||
`https://courier.auraajenticai.cloud/sse`
|
`https://courier.auraajenticai.cloud/sse`
|
||||||
- **NPX Direct CLI**:
|
- **NPX Direct CLI**:
|
||||||
`npx -y aura-courier-mcp@2.6.1`
|
`npx -y aura-courier-mcp@2.7.1`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"aura-courier-local": {
|
"aura-courier-local": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "aura-courier-mcp@2.6.1"],
|
"args": ["-y", "aura-courier-mcp@2.7.1"],
|
||||||
"env": {
|
"env": {
|
||||||
"PORT": "8080"
|
"PORT": "8080"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
},
|
},
|
||||||
"aura-courier-stdio": {
|
"aura-courier-stdio": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "aura-courier-mcp@2.6.1"]
|
"args": ["-y", "aura-courier-mcp@2.7.1"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+15
-1
@@ -8,6 +8,7 @@ import { loadConfig } from "./config.js";
|
|||||||
import { buildMcpServer, executeToolCall, TOOLS } from "./server.js";
|
import { buildMcpServer, executeToolCall, TOOLS } from "./server.js";
|
||||||
import { createRateLimiter } from "./middleware/rate_limit.js";
|
import { createRateLimiter } from "./middleware/rate_limit.js";
|
||||||
import { optionalAuthMiddleware, requireMcpAuth, isActionPermitted, resolveAuthContext, verifyWebhookSignature, recordAuditLog, initDynamicAuthStore, upsertDynamicKeyHash, setTenantDynamicKeyStatus, listDynamicKeySummaries, } from "./middleware/auth.js";
|
import { optionalAuthMiddleware, requireMcpAuth, isActionPermitted, resolveAuthContext, verifyWebhookSignature, recordAuditLog, initDynamicAuthStore, upsertDynamicKeyHash, setTenantDynamicKeyStatus, listDynamicKeySummaries, } from "./middleware/auth.js";
|
||||||
|
import { registerOAuthRoutes, buildWwwAuthenticateHeader } from "./middleware/oauth.js";
|
||||||
import { McpToolError, wrapError, wrapSuccess, maskPhone } from "./envelope.js";
|
import { McpToolError, wrapError, wrapSuccess, maskPhone } from "./envelope.js";
|
||||||
import { APP_VERSION } from "./version.js";
|
import { APP_VERSION } from "./version.js";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
@@ -47,6 +48,7 @@ const PORT = Number(process.env.PORT || 8080);
|
|||||||
const APP_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
const APP_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
const LANDING = path.join(APP_DIR, "index.html");
|
const LANDING = path.join(APP_DIR, "index.html");
|
||||||
const PRIVACY_HTML = path.join(APP_DIR, "privacy.html");
|
const PRIVACY_HTML = path.join(APP_DIR, "privacy.html");
|
||||||
|
const TERMS_HTML = path.join(APP_DIR, "terms.html");
|
||||||
const HEALTH_HTML = path.join(APP_DIR, "health.html");
|
const HEALTH_HTML = path.join(APP_DIR, "health.html");
|
||||||
const MCP_EXPLORER_HTML = path.join(APP_DIR, "mcp_explorer.html");
|
const MCP_EXPLORER_HTML = path.join(APP_DIR, "mcp_explorer.html");
|
||||||
const GUIDE_HTML = path.join(APP_DIR, "guide.html");
|
const GUIDE_HTML = path.join(APP_DIR, "guide.html");
|
||||||
@@ -127,12 +129,14 @@ export function keysFromRequest(req) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
export const app = express();
|
export const app = express();
|
||||||
|
app.set("trust proxy", 1);
|
||||||
app.use(express.json({
|
app.use(express.json({
|
||||||
limit: "1mb",
|
limit: "1mb",
|
||||||
verify: (req, _res, buf) => {
|
verify: (req, _res, buf) => {
|
||||||
req.rawBody = buf;
|
req.rawBody = buf;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
app.use(express.urlencoded({ extended: false, limit: "1mb" }));
|
||||||
// Robust Malformed JSON Syntax Error Guard
|
// Robust Malformed JSON Syntax Error Guard
|
||||||
app.use((err, _req, res, next) => {
|
app.use((err, _req, res, next) => {
|
||||||
if (err && (err.type === "entity.parse.failed" || err.status === 400)) {
|
if (err && (err.type === "entity.parse.failed" || err.status === 400)) {
|
||||||
@@ -149,7 +153,7 @@ app.use((req, res, next) => {
|
|||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.header("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS, HEAD, PATCH, PUT");
|
res.header("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS, HEAD, PATCH, PUT");
|
||||||
res.header("Access-Control-Allow-Headers", "Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version, x-aura-signature, x-steadfast-signature, x-pathao-signature, x-redx-signature, x-paperfly-signature, x-webhook-secret, x-steadfast-api-key, x-steadfast-secret-key, x-steadfast-base-url, x-pathao-client-id, x-pathao-client-secret, x-pathao-username, x-pathao-password, x-pathao-store-id, x-pathao-base-url, x-redx-api-token, x-redx-base-url, x-redx-pickup-store-id, x-paperfly-api-key, x-paperfly-username, x-paperfly-password, x-paperfly-store-name, x-google-maps-key");
|
res.header("Access-Control-Allow-Headers", "Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version, x-aura-signature, x-steadfast-signature, x-pathao-signature, x-redx-signature, x-paperfly-signature, x-webhook-secret, x-steadfast-api-key, x-steadfast-secret-key, x-steadfast-base-url, x-pathao-client-id, x-pathao-client-secret, x-pathao-username, x-pathao-password, x-pathao-store-id, x-pathao-base-url, x-redx-api-token, x-redx-base-url, x-redx-pickup-store-id, x-paperfly-api-key, x-paperfly-username, x-paperfly-password, x-paperfly-store-name, x-google-maps-key");
|
||||||
res.header("Access-Control-Expose-Headers", "mcp-session-id");
|
res.header("Access-Control-Expose-Headers", "mcp-session-id, WWW-Authenticate");
|
||||||
if (req.method === "OPTIONS") {
|
if (req.method === "OPTIONS") {
|
||||||
return res.sendStatus(204);
|
return res.sendStatus(204);
|
||||||
}
|
}
|
||||||
@@ -164,6 +168,8 @@ app.get("/favicon.ico", (_req, res) => {
|
|||||||
res.status(204).end();
|
res.status(204).end();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// Standard MCP OAuth 2.1 + PKCE (S256) + RFC 9728 + RFC 8414 + RFC 7591 Dynamic Client Registration
|
||||||
|
registerOAuthRoutes(app);
|
||||||
app.use(optionalAuthMiddleware);
|
app.use(optionalAuthMiddleware);
|
||||||
// Dynamic Tenant API Key Sync & Revocation Routes (Called by Snehalata / Admin Master Key)
|
// Dynamic Tenant API Key Sync & Revocation Routes (Called by Snehalata / Admin Master Key)
|
||||||
app.get("/admin/tokens", (req, res) => {
|
app.get("/admin/tokens", (req, res) => {
|
||||||
@@ -347,6 +353,7 @@ app.get("/mcp", mcpLimiter, async (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!req.auraAuth?.authenticated) {
|
if (!req.auraAuth?.authenticated) {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, req.auraAuth?.tenantId === "invalid"));
|
||||||
return res.status(401).json(wrapError(new McpToolError({
|
return res.status(401).json(wrapError(new McpToolError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "Missing or invalid Authorization: Bearer <AURA_API_KEY> header.",
|
message: "Missing or invalid Authorization: Bearer <AURA_API_KEY> header.",
|
||||||
@@ -722,6 +729,13 @@ app.get("/privacy", (_req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
app.get("/terms", (_req, res) => {
|
||||||
|
res.sendFile(TERMS_HTML, (err) => {
|
||||||
|
if (err && !res.headersSent) {
|
||||||
|
res.redirect("/");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
app.get("/guide", (_req, res) => {
|
app.get("/guide", (_req, res) => {
|
||||||
res.sendFile(GUIDE_HTML, (err) => {
|
res.sendFile(GUIDE_HTML, (err) => {
|
||||||
if (err && !res.headersSent) {
|
if (err && !res.headersSent) {
|
||||||
|
|||||||
Vendored
+32
-8
@@ -1,5 +1,6 @@
|
|||||||
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
||||||
import { maskPhone, wrapError, McpToolError } from "../envelope.js";
|
import { maskPhone, wrapError, McpToolError } from "../envelope.js";
|
||||||
|
import { verifyOAuthAccessToken, buildWwwAuthenticateHeader } from "./oauth.js";
|
||||||
const READ_TOOLS = new Set([
|
const READ_TOOLS = new Set([
|
||||||
"list_couriers",
|
"list_couriers",
|
||||||
"track_parcel",
|
"track_parcel",
|
||||||
@@ -80,6 +81,15 @@ export async function initDynamicAuthStore(pool) {
|
|||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
)
|
)
|
||||||
`);
|
`);
|
||||||
|
}
|
||||||
|
catch (ddlErr) {
|
||||||
|
// Least-privilege runtime DB roles (e.g. aura_courier_runtime) intentionally lack schema CREATE;
|
||||||
|
// the table is pre-provisioned, so continue cleanly to load rows below.
|
||||||
|
if (!/permission denied/i.test(String(ddlErr?.message || ""))) {
|
||||||
|
console.warn("[Auth] Dynamic key table DDL skipped:", ddlErr?.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
const res = await pool.query("SELECT token_hash, tenant_id, store_name, scopes, is_admin, status, updated_at FROM aura_mcp_dynamic_keys");
|
const res = await pool.query("SELECT token_hash, tenant_id, store_name, scopes, is_admin, status, updated_at FROM aura_mcp_dynamic_keys");
|
||||||
for (const row of res.rows || []) {
|
for (const row of res.rows || []) {
|
||||||
dynamicKeyHashes.set(row.token_hash, {
|
dynamicKeyHashes.set(row.token_hash, {
|
||||||
@@ -95,7 +105,7 @@ export async function initDynamicAuthStore(pool) {
|
|||||||
console.log(`[Auth] Loaded ${dynamicKeyHashes.size} dynamic MCP key(s) from PostgreSQL.`);
|
console.log(`[Auth] Loaded ${dynamicKeyHashes.size} dynamic MCP key(s) from PostgreSQL.`);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.warn("[Auth] Dynamic key table init skipped:", err?.message);
|
console.warn("[Auth] Dynamic key table load skipped:", err?.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function upsertDynamicKeyHash(opts) {
|
export async function upsertDynamicKeyHash(opts) {
|
||||||
@@ -189,6 +199,20 @@ export function resolveAuthContext(req) {
|
|||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// 0. Standard MCP OAuth 2.1 JWT Access Token (Google Gemini, ChatGPT, Claude Web)
|
||||||
|
if (token.startsWith("eyJ") && token.split(".").length === 3) {
|
||||||
|
const oauthClaims = verifyOAuthAccessToken(token);
|
||||||
|
if (oauthClaims) {
|
||||||
|
return {
|
||||||
|
authenticated: true,
|
||||||
|
tenantId: oauthClaims.sub,
|
||||||
|
scopes: Array.isArray(oauthClaims.scp) && oauthClaims.scp.length ? oauthClaims.scp : ["read"],
|
||||||
|
isByok,
|
||||||
|
isAdmin: Boolean(oauthClaims.adm),
|
||||||
|
callerToken: token,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
// 1. Master / Admin Key (Full Read + Write across all tenants)
|
// 1. Master / Admin Key (Full Read + Write across all tenants)
|
||||||
if (safeCompare(token, masterKey) || safeCompare(token, adminKey)) {
|
if (safeCompare(token, masterKey) || safeCompare(token, adminKey)) {
|
||||||
return {
|
return {
|
||||||
@@ -369,20 +393,19 @@ export function requireMcpAuth(req, res, next) {
|
|||||||
})));
|
})));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If a caller explicitly passed an invalid / forged token, always reject with 401
|
// If a caller explicitly passed an invalid / expired / forged token, always reject with 401 + RFC 9728 WWW-Authenticate
|
||||||
if (ctx.tenantId === "invalid") {
|
if (ctx.tenantId === "invalid") {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, true));
|
||||||
res.status(401).json(wrapError(new McpToolError({
|
res.status(401).json(wrapError(new McpToolError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "Invalid or forged Authorization token.",
|
message: "Invalid or expired Authorization token.",
|
||||||
retryable: false,
|
retryable: false,
|
||||||
source: "validator",
|
source: "validator",
|
||||||
})));
|
})));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Allow unauthenticated discovery handshakes (initialize, notifications/initialized, tools/list, ping)
|
// Allow stateless public catalog discovery (tools/list, ping) for MCP directories while requiring auth on initialize/tools/call so OAuth 2.1 clients (Gemini, ChatGPT, Claude Web) trigger automatic OAuth discovery via 401 WWW-Authenticate.
|
||||||
const isDiscovery = method === "initialize" ||
|
const isDiscovery = method === "tools/list" ||
|
||||||
method === "notifications/initialized" ||
|
|
||||||
method === "tools/list" ||
|
|
||||||
method === "ping";
|
method === "ping";
|
||||||
if (isDiscovery) {
|
if (isDiscovery) {
|
||||||
return next();
|
return next();
|
||||||
@@ -392,9 +415,10 @@ export function requireMcpAuth(req, res, next) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
if (!ctx.authenticated) {
|
if (!ctx.authenticated) {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, false));
|
||||||
res.status(401).json(wrapError(new McpToolError({
|
res.status(401).json(wrapError(new McpToolError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "Missing or invalid Authorization: Bearer <key> header on /mcp. Please provide your API key or BYOK carrier keys.",
|
message: "Missing or invalid Authorization: Bearer <key> header on /mcp. Authenticate via MCP OAuth 2.1 or provide your API key / BYOK carrier keys.",
|
||||||
retryable: false,
|
retryable: false,
|
||||||
source: "validator",
|
source: "validator",
|
||||||
})));
|
})));
|
||||||
|
|||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Express, Request } from "express";
|
||||||
|
import { type AuthScope } from "./auth.js";
|
||||||
|
export interface OAuthAccessClaims {
|
||||||
|
iss: string;
|
||||||
|
aud: string;
|
||||||
|
sub: string;
|
||||||
|
adm: boolean;
|
||||||
|
scp: AuthScope[];
|
||||||
|
cid: string;
|
||||||
|
typ: "at";
|
||||||
|
iat: number;
|
||||||
|
exp: number;
|
||||||
|
jti: string;
|
||||||
|
}
|
||||||
|
export declare function verifyOAuthAccessToken(token: string): OAuthAccessClaims | null;
|
||||||
|
export declare function getPublicOrigin(req: Request): string;
|
||||||
|
export declare function buildWwwAuthenticateHeader(req: Request, invalidToken?: boolean): string;
|
||||||
|
export declare function isAllowedRedirectUri(uri: string): boolean;
|
||||||
|
export declare function registerOAuthRoutes(app: Express): void;
|
||||||
Vendored
+1376
File diff suppressed because it is too large
Load Diff
Vendored
+91
@@ -7,11 +7,25 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "list_couriers",
|
name: "list_couriers",
|
||||||
description: "Inspect operational health, configuration status, and active API credentials for supported Bangladeshi courier networks (Steadfast, Pathao, RedX, Paperfly) and spatial routing services (Google Maps Platform). READ-ONLY DISCOVERY TOOL: Has zero external side effects and does not mutate database or carrier state. Use when initializing a session to verify which couriers are ready for order dispatch or balance checking. Do NOT use for querying shipment status (use 'track_parcel') or calculating shipping fees (use 'calculate_delivery_zone_and_fee').",
|
description: "Inspect operational health, configuration status, and active API credentials for supported Bangladeshi courier networks (Steadfast, Pathao, RedX, Paperfly) and spatial routing services (Google Maps Platform). READ-ONLY DISCOVERY TOOL: Has zero external side effects and does not mutate database or carrier state. Use when initializing a session to verify which couriers are ready for order dispatch or balance checking. Do NOT use for querying shipment status (use 'track_parcel') or calculating shipping fees (use 'calculate_delivery_zone_and_fee').",
|
||||||
|
annotations: {
|
||||||
|
title: "List Active Couriers",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
|
},
|
||||||
inputSchema: { type: "object", properties: {}, required: [] },
|
inputSchema: { type: "object", properties: {}, required: [] },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "create_parcel",
|
name: "create_parcel",
|
||||||
description: "Book and dispatch a physical parcel consignment across Bangladesh through Steadfast, Pathao, RedX, Paperfly, or AI smart cascading routing, with built-in per-tenant invoice idempotency and optional dry-run validation. STATE-MUTATING ACTION (unless dry_run=true): Creates a real, billable shipment record in the carrier's production database, assigns an official tracking code, and deducts courier fees upon pickup. Set dry_run=true to validate recipient phone/address and preview the target courier and estimated BDT cost without booking upstream. Once booked, cancellations require direct courier portal operations ('cancellable_via_api: false').",
|
description: "Book and dispatch a physical parcel consignment across Bangladesh through Steadfast, Pathao, RedX, Paperfly, or AI smart cascading routing, with built-in per-tenant invoice idempotency and optional dry-run validation. STATE-MUTATING ACTION (unless dry_run=true): Creates a real, billable shipment record in the carrier's production database, assigns an official tracking code, and deducts courier fees upon pickup. Set dry_run=true to validate recipient phone/address and preview the target courier and estimated BDT cost without booking upstream. Once booked, cancellations require direct courier portal operations ('cancellable_via_api: false').",
|
||||||
|
annotations: {
|
||||||
|
title: "Create & Dispatch Parcel",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -42,6 +56,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "track_parcel",
|
name: "track_parcel",
|
||||||
description: "Query live, real-time tracking milestones and delivery telemetry across Steadfast, Pathao, RedX, and Paperfly networks using consignment ID or tracking code. READ-ONLY OPERATION: Does not alter shipment state or carrier data. Returns normalized status, current location, carrier status notes, and timestamp history. Returns structured error code 'CONSIGNMENT_NOT_FOUND' with 'couriers_checked' if the consignment does not exist. Carrier provider is auto-detected from consignment prefix if omitted.",
|
description: "Query live, real-time tracking milestones and delivery telemetry across Steadfast, Pathao, RedX, and Paperfly networks using consignment ID or tracking code. READ-ONLY OPERATION: Does not alter shipment state or carrier data. Returns normalized status, current location, carrier status notes, and timestamp history. Returns structured error code 'CONSIGNMENT_NOT_FOUND' with 'couriers_checked' if the consignment does not exist. Carrier provider is auto-detected from consignment prefix if omitted.",
|
||||||
|
annotations: {
|
||||||
|
title: "Track Parcel Live",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -61,6 +82,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "get_balance",
|
name: "get_balance",
|
||||||
description: "Retrieve live merchant cash-on-delivery (COD) vault balance from Steadfast, or check provider balance support across Pathao, RedX, Paperfly, or all 4 couriers simultaneously. READ-ONLY FINANCIAL INQUIRY: Steadfast returns live 'amount_bdt' and 'status: OK'; Pathao, RedX, and Paperfly return 'amount_bdt: null' and 'status: UNSUPPORTED_BY_PROVIDER' with merchant portal hints because their public APIs do not expose a balance endpoint.",
|
description: "Retrieve live merchant cash-on-delivery (COD) vault balance from Steadfast, or check provider balance support across Pathao, RedX, Paperfly, or all 4 couriers simultaneously. READ-ONLY FINANCIAL INQUIRY: Steadfast returns live 'amount_bdt' and 'status: OK'; Pathao, RedX, and Paperfly return 'amount_bdt: null' and 'status: UNSUPPORTED_BY_PROVIDER' with merchant portal hints because their public APIs do not expose a balance endpoint.",
|
||||||
|
annotations: {
|
||||||
|
title: "Get Merchant COD Balance",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -76,6 +104,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "check_fraud_risk",
|
name: "check_fraud_risk",
|
||||||
description: "Screen a customer phone number against live nationwide Bangladesh logistics databases (Steadfast & Pathao) and the BTRC 11-digit prefix validator for delivery success rate, cancellation counts, and return fraud risk level ('INVALID_NUMBER', 'NO_HISTORY', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'). READ-ONLY DIAGNOSTIC QUERY: Returns null rates when a number is invalid or has 0 parcel history. Expects an 11-digit Bangladeshi mobile number ('01[3-9]XXXXXXXX').",
|
description: "Screen a customer phone number against live nationwide Bangladesh logistics databases (Steadfast & Pathao) and the BTRC 11-digit prefix validator for delivery success rate, cancellation counts, and return fraud risk level ('INVALID_NUMBER', 'NO_HISTORY', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'). READ-ONLY DIAGNOSTIC QUERY: Returns null rates when a number is invalid or has 0 parcel history. Expects an 11-digit Bangladeshi mobile number ('01[3-9]XXXXXXXX').",
|
||||||
|
annotations: {
|
||||||
|
title: "Check Customer Fraud Risk",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -87,6 +122,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "validate_and_geocode_address",
|
name: "validate_and_geocode_address",
|
||||||
description: "Validate, clean, and geocode an unformatted Bangladesh delivery address into structured administrative boundaries (thana_input, thana_resolved, district, division), latitude/longitude coordinates, match_quality (road, house, area), needs_review flag, and a deliverability confidence score (0-100, capped at 60 when location_type != ROOFTOP) via Google Maps Platform Geocoding API with OpenStreetMap gazetteer fallback. READ-ONLY SPATIAL LOOKUP.",
|
description: "Validate, clean, and geocode an unformatted Bangladesh delivery address into structured administrative boundaries (thana_input, thana_resolved, district, division), latitude/longitude coordinates, match_quality (road, house, area), needs_review flag, and a deliverability confidence score (0-100, capped at 60 when location_type != ROOFTOP) via Google Maps Platform Geocoding API with OpenStreetMap gazetteer fallback. READ-ONLY SPATIAL LOOKUP.",
|
||||||
|
annotations: {
|
||||||
|
title: "Validate & Geocode Address",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -100,6 +142,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "calculate_delivery_zone_and_fee",
|
name: "calculate_delivery_zone_and_fee",
|
||||||
description: "Calculate standard delivery zone (inside_dhaka <=22km ৳80, sub_dhaka 22-45km ৳100, outside_dhaka >45km ৳150), road distance via Google Maps Platform Routes API, structured SLA hours ({min, max}), and applicable COD percentage for a single delivery destination using the unified tariff table (meta.source='static_tariff'). READ-ONLY ESTIMATION TOOL.",
|
description: "Calculate standard delivery zone (inside_dhaka <=22km ৳80, sub_dhaka 22-45km ৳100, outside_dhaka >45km ৳150), road distance via Google Maps Platform Routes API, structured SLA hours ({min, max}), and applicable COD percentage for a single delivery destination using the unified tariff table (meta.source='static_tariff'). READ-ONLY ESTIMATION TOOL.",
|
||||||
|
annotations: {
|
||||||
|
title: "Calculate Delivery Zone & Fee",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -113,6 +162,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "compare_courier_rates",
|
name: "compare_courier_rates",
|
||||||
description: "Execute side-by-side tariff, structured SLA ({min, max}), and COD collection fee comparisons across all four major Bangladeshi couriers (Steadfast, Pathao, RedX, Paperfly) for any destination nationwide using the unified tariff table (meta.source='static_tariff'). Evaluates exact parcel weight, declared COD amount, and optimization priority ('cheapest', 'fastest', 'balanced') to select the recommended courier. READ-ONLY CALCULATION ENGINE.",
|
description: "Execute side-by-side tariff, structured SLA ({min, max}), and COD collection fee comparisons across all four major Bangladeshi couriers (Steadfast, Pathao, RedX, Paperfly) for any destination nationwide using the unified tariff table (meta.source='static_tariff'). Evaluates exact parcel weight, declared COD amount, and optimization priority ('cheapest', 'fastest', 'balanced') to select the recommended courier. READ-ONLY CALCULATION ENGINE.",
|
||||||
|
annotations: {
|
||||||
|
title: "Compare Multi-Carrier Rates",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -131,6 +187,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "resolve_ndr_issue",
|
name: "resolve_ndr_issue",
|
||||||
description: "Verify that a consignment exists on the specified courier via 'track_parcel' and generate honest, draft-only Non-Delivery Report (NDR) re-engagement copy ('status: DRAFT_GENERATED', 'actions_executed: []'). GENERATION-ONLY TOOL: Verifies consignment_id first (returns CONSIGNMENT_NOT_FOUND if unknown), then generates proposed Bengali WhatsApp copy ('whatsapp_draft') and a carrier escalation ticket draft ('courier_ticket_draft') for manual merchant execution.",
|
description: "Verify that a consignment exists on the specified courier via 'track_parcel' and generate honest, draft-only Non-Delivery Report (NDR) re-engagement copy ('status: DRAFT_GENERATED', 'actions_executed: []'). GENERATION-ONLY TOOL: Verifies consignment_id first (returns CONSIGNMENT_NOT_FOUND if unknown), then generates proposed Bengali WhatsApp copy ('whatsapp_draft') and a carrier escalation ticket draft ('courier_ticket_draft') for manual merchant execution.",
|
||||||
|
annotations: {
|
||||||
|
title: "Generate NDR Resolution Draft",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -152,6 +215,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "cancel_parcel",
|
name: "cancel_parcel",
|
||||||
description: "Cancel an existing parcel consignment across Steadfast, Pathao, RedX, or Paperfly. For carriers with automated cancellation APIs (Pathao, RedX, Paperfly), executes live upstream cancellation immediately. For Steadfast, validates parcel eligibility, marks internal status as CANCEL_REQUESTED, and provides direct portal action links.",
|
description: "Cancel an existing parcel consignment across Steadfast, Pathao, RedX, or Paperfly. For carriers with automated cancellation APIs (Pathao, RedX, Paperfly), executes live upstream cancellation immediately. For Steadfast, validates parcel eligibility, marks internal status as CANCEL_REQUESTED, and provides direct portal action links.",
|
||||||
|
annotations: {
|
||||||
|
title: "Cancel Parcel Consignment",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: true,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -165,6 +235,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "update_parcel",
|
name: "update_parcel",
|
||||||
description: "Update delivery instructions, customer phone number, delivery address landmark, or COD collection amount for an existing in-transit consignment across supported courier partners. STATE-MUTATING ACTION: Propagates updated delivery notes upstream to carrier dispatch centers.",
|
description: "Update delivery instructions, customer phone number, delivery address landmark, or COD collection amount for an existing in-transit consignment across supported courier partners. STATE-MUTATING ACTION: Propagates updated delivery notes upstream to carrier dispatch centers.",
|
||||||
|
annotations: {
|
||||||
|
title: "Update In-Transit Parcel",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -181,6 +258,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "bulk_create_parcels",
|
name: "bulk_create_parcels",
|
||||||
description: "Validate or book up to 100 parcels in a single batch with per-item error isolation, invoice idempotency, and optional dry_run preview mode. STATE-MUTATING ACTION (unless dry_run=true): Returns total, succeeded, failed, and per-item results.",
|
description: "Validate or book up to 100 parcels in a single batch with per-item error isolation, invoice idempotency, and optional dry_run preview mode. STATE-MUTATING ACTION (unless dry_run=true): Returns total, succeeded, failed, and per-item results.",
|
||||||
|
annotations: {
|
||||||
|
title: "Bulk Create Parcels",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -214,6 +298,13 @@ export const TOOLS = [
|
|||||||
{
|
{
|
||||||
name: "get_webhook_events",
|
name: "get_webhook_events",
|
||||||
description: "Query verified courier webhook status events received by the server's /webhooks/{steadfast,pathao,redx,paperfly} endpoints. READ-ONLY DIAGNOSTIC TOOL: Filterable by consignment_id and ISO-8601 'since' timestamp.",
|
description: "Query verified courier webhook status events received by the server's /webhooks/{steadfast,pathao,redx,paperfly} endpoints. READ-ONLY DIAGNOSTIC TOOL: Filterable by consignment_id and ISO-8601 'since' timestamp.",
|
||||||
|
annotations: {
|
||||||
|
title: "Query Courier Webhook Events",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -11,6 +11,6 @@ function readPackageVersion() {
|
|||||||
catch {
|
catch {
|
||||||
// Fallback if package.json is unavailable at runtime
|
// Fallback if package.json is unavailable at runtime
|
||||||
}
|
}
|
||||||
return "2.6.1";
|
return "2.7.1";
|
||||||
}
|
}
|
||||||
export const APP_VERSION = readPackageVersion();
|
export const APP_VERSION = readPackageVersion();
|
||||||
|
|||||||
+34
-5
@@ -1503,9 +1503,9 @@
|
|||||||
<span class="res-icon"></></span>
|
<span class="res-icon"></></span>
|
||||||
<span class="res-title" data-i18n="res_2">API & MCP Docs</span>
|
<span class="res-title" data-i18n="res_2">API & MCP Docs</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="#simulator" class="res-card">
|
<a href="#ecommerce-plugins" class="res-card">
|
||||||
<span class="res-icon">🏪</span>
|
<span class="res-icon">🛒</span>
|
||||||
<span class="res-title" data-i18n="res_3">Store Integration Guide</span>
|
<span class="res-title" data-i18n="res_3">WooCommerce & Shopify Plugins</span>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://client.auraajenticai.cloud" target="_blank" rel="noopener" class="res-card">
|
<a href="https://client.auraajenticai.cloud" target="_blank" rel="noopener" class="res-card">
|
||||||
<span class="res-icon">❓</span>
|
<span class="res-icon">❓</span>
|
||||||
@@ -1514,6 +1514,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- ===== Standalone E-Commerce Plugins (WooCommerce + Shopify) ===== -->
|
||||||
|
<section id="ecommerce-plugins" style="margin-bottom: 48px;">
|
||||||
|
<div class="section-header">
|
||||||
|
<div class="section-tag" style="display:inline-flex; align-items:center; gap:6px;">
|
||||||
|
<span>🛒 E-Commerce Connectors</span>
|
||||||
|
</div>
|
||||||
|
<h2 class="section-title">WooCommerce & Shopify Standalone Plugins</h2>
|
||||||
|
<p class="section-subtitle">CRM ছাড়াই সরাসরি আপনার WooCommerce বা Shopify স্টোর থেকে ১-ক্লিকে Steadfast, Pathao, RedX ও Paperfly পার্সেল বুকিং এবং ফ্রড চেক চালু করুন।</p>
|
||||||
|
</div>
|
||||||
|
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:18px;">
|
||||||
|
<div style="background:var(--bg-panel); border:1px solid var(--border); border-radius:16px; padding:22px; display:flex; flex-direction:column; gap:12px;">
|
||||||
|
<div style="font-size:16px; font-weight:800; color:#fff;">🟣 WordPress / WooCommerce Plugin (.zip)</div>
|
||||||
|
<p style="font-size:13px; color:var(--text-muted); margin:0;">আপনার নিজের API Key সহ প্রি-লিংকড WordPress প্লাগইন ডাউনলোড করে <code>Plugins → Add New → Upload Plugin</code>-এ ইন্সটল করুন। অর্ডার লিস্টেই ১-ক্লিক কুরিয়ার বুকিং ও ফ্রড রিস্ক ব্যাজ পাবেন।</p>
|
||||||
|
<div style="display:flex; gap:10px; flex-wrap:wrap; margin-top:auto; padding-top:6px;">
|
||||||
|
<a href="https://client.auraajenticai.cloud/api/courier/plugin/download" target="_blank" rel="noopener" style="background:var(--cyan); color:#040914; font-weight:800; font-size:12.5px; padding:9px 14px; border-radius:9px; text-decoration:none;">⬇ Download WooCommerce .zip ↗</a>
|
||||||
|
<a href="https://client.auraajenticai.cloud/#view-woo" target="_blank" rel="noopener" style="border:1px solid var(--border-accent); color:var(--text); font-weight:700; font-size:12.5px; padding:9px 14px; border-radius:9px; text-decoration:none;">Open Store Setup ↗</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background:var(--bg-panel); border:1px solid var(--border); border-radius:16px; padding:22px; display:flex; flex-direction:column; gap:12px;">
|
||||||
|
<div style="font-size:16px; font-weight:800; color:#fff;">🟢 Shopify Courier & Order Widget</div>
|
||||||
|
<p style="font-size:13px; color:var(--text-muted); margin:0;">Shopify Admin Webhook বা Aura Client Portal-এর Shopify কানেক্টর দিয়ে অটোমেটিক অর্ডার সিঙ্ক, COD ফ্রড স্ক্যান এবং স্টেডফাস্ট/পাঠাও ডিসপ্যাচ চালু করুন।</p>
|
||||||
|
<div style="display:flex; gap:10px; flex-wrap:wrap; margin-top:auto; padding-top:6px;">
|
||||||
|
<a href="https://client.auraajenticai.cloud/#view-shop" target="_blank" rel="noopener" style="background:var(--emerald); color:#040914; font-weight:800; font-size:12.5px; padding:9px 14px; border-radius:9px; text-decoration:none;">Connect Shopify Store ↗</a>
|
||||||
|
<a href="/mcp" style="border:1px solid var(--border-accent); color:var(--text); font-weight:700; font-size:12.5px; padding:9px 14px; border-radius:9px; text-decoration:none;">Test 13 MCP Tools →</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<!-- ===== AI Agent & IDE Configurations Vault ===== -->
|
<!-- ===== AI Agent & IDE Configurations Vault ===== -->
|
||||||
<section id="agent-configs" style="margin-bottom: 48px;">
|
<section id="agent-configs" style="margin-bottom: 48px;">
|
||||||
@@ -1576,7 +1605,7 @@
|
|||||||
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
||||||
<div>
|
<div>
|
||||||
<span class="f-brand-title">Aura Courier MCP</span>
|
<span class="f-brand-title">Aura Courier MCP</span>
|
||||||
<span class="version-pill">v2.6.1</span>
|
<span class="version-pill">v2.7.1</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="footer-tagline">
|
<p class="footer-tagline">
|
||||||
@@ -1628,7 +1657,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
||||||
<span>📦 npm Package (v2.6.1)</span>
|
<span>📦 npm Package (v2.7.1)</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
+2
-2
@@ -360,7 +360,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="brand-title">Aura Courier MCP</span>
|
<span class="brand-title">Aura Courier MCP</span>
|
||||||
<span class="brand-sub">v2.6.1 · Telemetry</span>
|
<span class="brand-sub">v2.7.1 · Telemetry</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-actions">
|
<div class="nav-actions">
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>Aura Courier MCP v2.6.1 · Built with pride by <a href="https://auraajenticai.cloud" style="color:var(--text);font-weight:600;">Aura Ajentic AI</a> · Apache 2.0 License</p>
|
<p>Aura Courier MCP v2.7.1 · Built with pride by <a href="https://auraajenticai.cloud" style="color:var(--text);font-weight:600;">Aura Ajentic AI</a> · Apache 2.0 License</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
+81
-22
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||||
<title>Aura Courier MCP v2.6.1 — Multi-Courier Integration for Developers</title>
|
<title>Aura Courier MCP v2.7.1 — Multi-Courier Integration for Developers</title>
|
||||||
<meta name="description" content="Aura Courier MCP — এক কানেক্টরেই ৪ কুরিয়ার (Steadfast, Pathao, RedX, Paperfly) + Google Maps Spatial AI। Model Context Protocol (MCP) server for AI Agents and E-commerce." />
|
<meta name="description" content="Aura Courier MCP — এক কানেক্টরেই ৪ কুরিয়ার (Steadfast, Pathao, RedX, Paperfly) + Google Maps Spatial AI। Model Context Protocol (MCP) server for AI Agents and E-commerce." />
|
||||||
|
|
||||||
<link rel="icon" type="image/jpeg" href="/assets/courier-logo.jpg" />
|
<link rel="icon" type="image/jpeg" href="/assets/courier-logo.jpg" />
|
||||||
@@ -90,19 +90,20 @@
|
|||||||
border-bottom: 1px solid var(--border);
|
border-bottom: 1px solid var(--border);
|
||||||
}
|
}
|
||||||
.hbar {
|
.hbar {
|
||||||
max-width: 1200px;
|
max-width: 1260px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 12px 20px;
|
padding: 10px 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 16px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
.logo-group {
|
.logo-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.logo-img {
|
.logo-img {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
@@ -145,18 +146,21 @@
|
|||||||
.nav-links {
|
.nav-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 14px;
|
gap: 10px;
|
||||||
|
min-width: 0;
|
||||||
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
.nav-item {
|
.nav-item {
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 13.5px;
|
font-size: 12.5px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
transition: color 0.18s;
|
transition: color 0.18s;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 5px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.nav-item:hover { color: #fff; }
|
.nav-item:hover { color: #fff; }
|
||||||
.nav-item.active {
|
.nav-item.active {
|
||||||
@@ -808,6 +812,14 @@
|
|||||||
.dock-item svg { width: 19px; height: 19px; }
|
.dock-item svg { width: 19px; height: 19px; }
|
||||||
|
|
||||||
/* ===== Responsive Breakpoints ===== */
|
/* ===== Responsive Breakpoints ===== */
|
||||||
|
@media (max-width: 1220px) {
|
||||||
|
.logo-sub { display: none; }
|
||||||
|
.nav-links { gap: 8px; }
|
||||||
|
.nav-item { font-size: 12px; }
|
||||||
|
.health-pill { padding: 4px 8px; font-size: 11px; }
|
||||||
|
.login-btn { padding: 5px 10px; font-size: 12px; }
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 960px) {
|
@media (max-width: 960px) {
|
||||||
.hero { grid-template-columns: 1fr; gap: 32px; }
|
.hero { grid-template-columns: 1fr; gap: 32px; }
|
||||||
.hero-title { font-size: 34px; }
|
.hero-title { font-size: 34px; }
|
||||||
@@ -1189,7 +1201,7 @@
|
|||||||
<div class="logo-text-wrap">
|
<div class="logo-text-wrap">
|
||||||
<div class="logo-title">
|
<div class="logo-title">
|
||||||
<span>Aura Courier MCP</span>
|
<span>Aura Courier MCP</span>
|
||||||
<span class="version-pill">v2.6.1</span>
|
<span class="version-pill">v2.7.1</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="logo-sub">Multi-Courier Integration for Developers</span>
|
<span class="logo-sub">Multi-Courier Integration for Developers</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1327,7 +1339,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="stat-val">12</div>
|
<div class="stat-val">13</div>
|
||||||
<div class="stat-label" data-i18n="stat_tools">MCP Tools (JSON-RPC)</div>
|
<div class="stat-label" data-i18n="stat_tools">MCP Tools (JSON-RPC)</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1534,7 +1546,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- ===== All 12 MCP Tools Section ===== -->
|
<!-- ===== All 13 MCP Tools Section ===== -->
|
||||||
<section id="tools" style="margin-bottom: 48px;">
|
<section id="tools" style="margin-bottom: 48px;">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<div class="section-tag" style="display:inline-flex; align-items:center; gap:6px;">
|
<div class="section-tag" style="display:inline-flex; align-items:center; gap:6px;">
|
||||||
@@ -1545,8 +1557,8 @@
|
|||||||
</svg>
|
</svg>
|
||||||
<span data-i18n="tools_tag">Core Protocol</span>
|
<span data-i18n="tools_tag">Core Protocol</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="section-title" data-i18n="tools_title">All 12 MCP Tools</h2>
|
<h2 class="section-title" data-i18n="tools_title">All 13 MCP Tools</h2>
|
||||||
<p class="section-subtitle" data-i18n="tools_subtitle">Aura Courier MCP-এ থাকা ১২টি শক্তিশালী টুল, যেগুলো সরাসরি আপনার AI এজেন্ট বা অটোমেশন ফ্লোতে কাজ করে।</p>
|
<p class="section-subtitle" data-i18n="tools_subtitle">Aura Courier MCP-এ থাকা ১৩টি শক্তিশালী টুল, যেগুলো সরাসরি আপনার AI এজেন্ট বা অটোমেশন ফ্লোতে কাজ করে।</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tools-grid">
|
<div class="tools-grid">
|
||||||
@@ -1760,6 +1772,24 @@
|
|||||||
<div class="tool-name">bulk_create_parcels</div>
|
<div class="tool-name">bulk_create_parcels</div>
|
||||||
<div class="tool-desc" data-i18n="t12_desc">এক ক্লিকে ১০০টি পর্যন্ত পার্সেল ব্যাচ বুকিং বা ভ্যালিডেশন করুন উইথ আইসোলেটেড এরর হ্যান্ডলিং।</div>
|
<div class="tool-desc" data-i18n="t12_desc">এক ক্লিকে ১০০টি পর্যন্ত পার্সেল ব্যাচ বুকিং বা ভ্যালিডেশন করুন উইথ আইসোলেটেড এরর হ্যান্ডলিং।</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tool 13: get_webhook_events -->
|
||||||
|
<div class="tool-card">
|
||||||
|
<div>
|
||||||
|
<div class="tool-card-top">
|
||||||
|
<div class="tool-icon-wrap ic-purple" style="background:rgba(139,92,246,0.15); border-color:rgba(139,92,246,0.35);">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#a78bfa" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"/>
|
||||||
|
<path d="m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"/>
|
||||||
|
<path d="m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<button class="btn-schema" onclick="openSchemaModal('get_webhook_events')">Schema & JSON ↗</button>
|
||||||
|
</div>
|
||||||
|
<div class="tool-name">get_webhook_events</div>
|
||||||
|
<div class="tool-desc" data-i18n="t13_desc">Pathao, Steadfast, RedX ও Paperfly-এর রিয়েল-টাইম ডেলিভারি ওয়েবহুক ইভেন্ট লগ লাইভ দেখুন।</div>
|
||||||
|
</div>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -2016,7 +2046,7 @@
|
|||||||
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
||||||
<div>
|
<div>
|
||||||
<span class="f-brand-title">Aura Courier MCP</span>
|
<span class="f-brand-title">Aura Courier MCP</span>
|
||||||
<span class="version-pill">v2.6.1</span>
|
<span class="version-pill">v2.7.1</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="footer-tagline">
|
<p class="footer-tagline">
|
||||||
@@ -2068,7 +2098,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg><span>npm Package (v2.6.1)</span>
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg><span>npm Package (v2.7.1)</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -2146,7 +2176,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- ===== Background Animation Canvas Script ===== -->
|
<!-- ===== Background Animation Canvas Script ===== -->
|
||||||
<script src="/assets/courier-canvas.js?v=2.6.1"></script>
|
<script src="/assets/courier-canvas.js?v=2.7.1"></script>
|
||||||
<script>
|
<script>
|
||||||
if (typeof initCourierCanvas === 'function') {
|
if (typeof initCourierCanvas === 'function') {
|
||||||
initCourierCanvas('hubmap');
|
initCourierCanvas('hubmap');
|
||||||
@@ -2188,8 +2218,8 @@
|
|||||||
btn_check_risk: "Check Risk →",
|
btn_check_risk: "Check Risk →",
|
||||||
fraud_desc_safe: "New customer - Safe to proceed · Zero Mock Data",
|
fraud_desc_safe: "New customer - Safe to proceed · Zero Mock Data",
|
||||||
tools_tag: "Core Protocol",
|
tools_tag: "Core Protocol",
|
||||||
tools_title: "All 12 MCP Tools",
|
tools_title: "All 13 MCP Tools",
|
||||||
tools_subtitle: "Aura Courier MCP-এ থাকা ১২টি শক্তিশালী টুল, যেগুলো সরাসরি আপনার AI এজেন্ট বা অটোমেশন ফ্লোতে কাজ করে।",
|
tools_subtitle: "Aura Courier MCP-এ থাকা ১৩টি শক্তিশালী টুল, যেগুলো সরাসরি আপনার AI এজেন্ট বা অটোমেশন ফ্লোতে কাজ করে।",
|
||||||
t1_desc: "নতুন পার্সেল বা ডেলিভারি অর্ডার তৈরি করুন (Steadfast, Pathao, RedX, Paperfly-তে ১-ক্লিকে)।",
|
t1_desc: "নতুন পার্সেল বা ডেলিভারি অর্ডার তৈরি করুন (Steadfast, Pathao, RedX, Paperfly-তে ১-ক্লিকে)।",
|
||||||
t2_desc: "পার্সেল ট্র্যাকিং স্ট্যাটাস ও লাইভ ডেলিভারি টাইমলাইন এক ক্লিকে ট্র্যাক করুন।",
|
t2_desc: "পার্সেল ট্র্যাকিং স্ট্যাটাস ও লাইভ ডেলিভারি টাইমলাইন এক ক্লিকে ট্র্যাক করুন।",
|
||||||
t3_desc: "সব কুরিয়ার মার্চেন্ট একাউন্টের লাইভ ব্যালেন্স, পেন্ডিং ডিসবার্সমেন্ট ও পেআউট জানুন।",
|
t3_desc: "সব কুরিয়ার মার্চেন্ট একাউন্টের লাইভ ব্যালেন্স, পেন্ডিং ডিসবার্সমেন্ট ও পেআউট জানুন।",
|
||||||
@@ -2210,6 +2240,7 @@
|
|||||||
t10_desc: "যেকোনো কুরিয়ারে বুক করা পার্সেল ক্যানসেলেশন রিকোয়েস্ট পাঠান বা স্বয়ংক্রিয় বাতিল করুন।",
|
t10_desc: "যেকোনো কুরিয়ারে বুক করা পার্সেল ক্যানসেলেশন রিকোয়েস্ট পাঠান বা স্বয়ংক্রিয় বাতিল করুন।",
|
||||||
t11_desc: "ইন-ট্রানজিট পার্সেলের ডেলিভারি নোট, গ্রাহকের ফোন নম্বর বা সিওডি টাকার পরিমাণ আপডেট করুন।",
|
t11_desc: "ইন-ট্রানজিট পার্সেলের ডেলিভারি নোট, গ্রাহকের ফোন নম্বর বা সিওডি টাকার পরিমাণ আপডেট করুন।",
|
||||||
t12_desc: "এক ক্লিকে ১০০টি পর্যন্ত পার্সেল ব্যাচ বুকিং বা ভ্যালিডেশন করুন উইথ আইসোলেটেড এরর হ্যান্ডলিং।",
|
t12_desc: "এক ক্লিকে ১০০টি পর্যন্ত পার্সেল ব্যাচ বুকিং বা ভ্যালিডেশন করুন উইথ আইসোলেটেড এরর হ্যান্ডলিং।",
|
||||||
|
t13_desc: "Pathao, Steadfast, RedX ও Paperfly-এর রিয়েল-টাইম ডেলিভারি ওয়েবহুক ইভেন্ট লগ লাইভ দেখুন।",
|
||||||
spatial_tag: "Spatial Engine",
|
spatial_tag: "Spatial Engine",
|
||||||
spatial_title: "Google Maps Spatial AI Routing",
|
spatial_title: "Google Maps Spatial AI Routing",
|
||||||
spatial_subtitle: "গুগল ম্যাপের উপর ভিত্তি করে রুট অপটিমাইজেশন, জোন ডিটেকশন ও রিয়েল-টাইম দূরত্ব পরিমাপ।",
|
spatial_subtitle: "গুগল ম্যাপের উপর ভিত্তি করে রুট অপটিমাইজেশন, জোন ডিটেকশন ও রিয়েল-টাইম দূরত্ব পরিমাপ।",
|
||||||
@@ -2256,8 +2287,8 @@
|
|||||||
btn_check_risk: "Check Risk →",
|
btn_check_risk: "Check Risk →",
|
||||||
fraud_desc_safe: "New customer - Safe to proceed · Zero Mock Data",
|
fraud_desc_safe: "New customer - Safe to proceed · Zero Mock Data",
|
||||||
tools_tag: "Core Protocol",
|
tools_tag: "Core Protocol",
|
||||||
tools_title: "All 12 MCP Tools",
|
tools_title: "All 13 MCP Tools",
|
||||||
tools_subtitle: "Production-grade tools available inside Aura Courier MCP for seamless agentic workflows.",
|
tools_subtitle: "13 production-grade tools available inside Aura Courier MCP for seamless agentic workflows.",
|
||||||
t1_desc: "Automated booking across Steadfast, Pathao, RedX, and Paperfly with 1-click fallback.",
|
t1_desc: "Automated booking across Steadfast, Pathao, RedX, and Paperfly with 1-click fallback.",
|
||||||
t2_desc: "Unified parcel tracking timeline and carrier status across all Bangladesh logistics.",
|
t2_desc: "Unified parcel tracking timeline and carrier status across all Bangladesh logistics.",
|
||||||
t3_desc: "Live COD balance, pending disbursement and payout tracking across all accounts.",
|
t3_desc: "Live COD balance, pending disbursement and payout tracking across all accounts.",
|
||||||
@@ -2278,6 +2309,7 @@
|
|||||||
t10_desc: "Cancel live booked parcels across Steadfast, Pathao, RedX, or Paperfly via API or portal action.",
|
t10_desc: "Cancel live booked parcels across Steadfast, Pathao, RedX, or Paperfly via API or portal action.",
|
||||||
t11_desc: "Update in-transit parcel delivery instructions, customer phone, address, or COD amount.",
|
t11_desc: "Update in-transit parcel delivery instructions, customer phone, address, or COD amount.",
|
||||||
t12_desc: "Validate or dispatch batches of up to 100 parcels in a single call with isolated error handling.",
|
t12_desc: "Validate or dispatch batches of up to 100 parcels in a single call with isolated error handling.",
|
||||||
|
t13_desc: "Inspect recent real-time carrier webhook events (Pathao, Steadfast, RedX, Paperfly) for parcel status sync.",
|
||||||
spatial_tag: "Spatial Engine",
|
spatial_tag: "Spatial Engine",
|
||||||
spatial_title: "Google Maps Spatial AI Routing",
|
spatial_title: "Google Maps Spatial AI Routing",
|
||||||
spatial_subtitle: "Rooftop geocoding, route optimization, zone detection, and real-time distance matrix.",
|
spatial_subtitle: "Rooftop geocoding, route optimization, zone detection, and real-time distance matrix.",
|
||||||
@@ -2773,6 +2805,33 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"get_webhook_events": {
|
||||||
|
"desc": "Retrieve recent real-time carrier webhook events received from Pathao, Steadfast, RedX, and Paperfly.",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"courier": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["steadfast", "pathao", "redx", "paperfly"],
|
||||||
|
"description": "Optional carrier filter"
|
||||||
|
},
|
||||||
|
"limit": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Maximum number of recent webhook events to return (default 20)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sample": {
|
||||||
|
"method": "tools/call",
|
||||||
|
"params": {
|
||||||
|
"name": "get_webhook_events",
|
||||||
|
"arguments": {
|
||||||
|
"courier": "pathao",
|
||||||
|
"limit": 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3151,7 +3210,7 @@
|
|||||||
const ms = Math.round(performance.now() - t0);
|
const ms = Math.round(performance.now() - t0);
|
||||||
const pill = document.querySelector('.health-pill');
|
const pill = document.querySelector('.health-pill');
|
||||||
if (pill && data.ok) {
|
if (pill && data.ok) {
|
||||||
pill.innerHTML = `<span class="health-dot"></span><span>Health OK (v${data.version || '2.6.1'} · ${ms}ms)</span>`;
|
pill.innerHTML = `<span class="health-dot"></span><span>Health OK (v${data.version || '2.7.1'} · ${ms}ms)</span>`;
|
||||||
}
|
}
|
||||||
const sbStatus = document.querySelector('.sandbox-status');
|
const sbStatus = document.querySelector('.sandbox-status');
|
||||||
if (sbStatus) {
|
if (sbStatus) {
|
||||||
@@ -3161,7 +3220,7 @@
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
const pill = document.querySelector('.health-pill');
|
const pill = document.querySelector('.health-pill');
|
||||||
if (pill) {
|
if (pill) {
|
||||||
pill.innerHTML = `<span class="health-dot" style="background:var(--emerald);"></span><span>Health OK (v2.6.1)</span>`;
|
pill.innerHTML = `<span class="health-dot" style="background:var(--emerald);"></span><span>Health OK (v2.7.1)</span>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"aura-courier": {
|
"aura-courier": {
|
||||||
"url": "https://courier.auraajenticai.cloud/mcp",
|
"serverUrl": "https://courier.auraajenticai.cloud/mcp"
|
||||||
"transport": "streamable-http"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-4
@@ -326,7 +326,7 @@
|
|||||||
<main>
|
<main>
|
||||||
<div class="hero-banner">
|
<div class="hero-banner">
|
||||||
<h1 class="hero-title">Streamable-HTTP MCP Protocol Explorer</h1>
|
<h1 class="hero-title">Streamable-HTTP MCP Protocol Explorer</h1>
|
||||||
<p class="hero-desc">Test MCP JSON-RPC 2.0 initialize handshakes, inspect the 9 registered tool schemas, and connect Gemini, Claude, Cursor & n8n agents directly to this remote endpoint.</p>
|
<p class="hero-desc">Test MCP JSON-RPC 2.0 initialize handshakes, inspect all 13 registered tool schemas, and connect Gemini, Claude, Cursor & n8n agents directly to this remote endpoint.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Endpoint Overview -->
|
<!-- Endpoint Overview -->
|
||||||
@@ -361,7 +361,7 @@
|
|||||||
"capabilities": {},
|
"capabilities": {},
|
||||||
"clientInfo": {
|
"clientInfo": {
|
||||||
"name": "Aura-Playground",
|
"name": "Aura-Playground",
|
||||||
"version": "2.6.1"
|
"version": "2.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}</textarea>
|
}</textarea>
|
||||||
@@ -381,7 +381,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Registered Tools Catalog -->
|
<!-- Registered Tools Catalog -->
|
||||||
<h2 class="tools-section-title">Registered MCP Tools (9 Tools)</h2>
|
<h2 class="tools-section-title">Registered MCP Tools (13 Tools)</h2>
|
||||||
<div class="tools-list">
|
<div class="tools-list">
|
||||||
<div class="tool-box">
|
<div class="tool-box">
|
||||||
<div class="tool-name">1. list_couriers</div>
|
<div class="tool-name">1. list_couriers</div>
|
||||||
@@ -428,11 +428,31 @@
|
|||||||
<div class="tool-desc">Non-Delivery Report triage with automated WhatsApp templates and re-dispatch commands.</div>
|
<div class="tool-desc">Non-Delivery Report triage with automated WhatsApp templates and re-dispatch commands.</div>
|
||||||
<div class="tool-schema">Input: tracking_code, reason · Returns: triage plan & whatsapp text</div>
|
<div class="tool-schema">Input: tracking_code, reason · Returns: triage plan & whatsapp text</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tool-box">
|
||||||
|
<div class="tool-name">10. cancel_parcel</div>
|
||||||
|
<div class="tool-desc">Cancel booked parcels or dispatch carrier cancellation requests across Steadfast, Pathao, RedX & Paperfly.</div>
|
||||||
|
<div class="tool-schema">Input: courier, consignment_id, reason? · Returns: cancellation status</div>
|
||||||
|
</div>
|
||||||
|
<div class="tool-box">
|
||||||
|
<div class="tool-name">11. update_parcel</div>
|
||||||
|
<div class="tool-desc">Update in-transit parcel delivery instructions, recipient phone, landmark address, or COD amount.</div>
|
||||||
|
<div class="tool-schema">Input: courier, consignment_id, note?, phone?, cod_amount? · Returns: update result</div>
|
||||||
|
</div>
|
||||||
|
<div class="tool-box">
|
||||||
|
<div class="tool-name">12. bulk_create_parcels</div>
|
||||||
|
<div class="tool-desc">Validate or book up to 100 parcels in a single batch call with isolated error handling and dry-run support.</div>
|
||||||
|
<div class="tool-schema">Input: items[], dry_run? · Returns: per-item booking summary</div>
|
||||||
|
</div>
|
||||||
|
<div class="tool-box">
|
||||||
|
<div class="tool-name">13. get_webhook_events</div>
|
||||||
|
<div class="tool-desc">Retrieve recent real-time carrier webhook events (Pathao, Steadfast, RedX, Paperfly) for parcel status sync.</div>
|
||||||
|
<div class="tool-schema">Input: courier?, limit? · Returns: recent normalized webhook events</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>Aura Courier MCP v2.6.1 · Built with pride by <a href="https://auraajenticai.cloud" style="color:var(--text);font-weight:600;">Aura Ajentic AI</a> · Apache 2.0 License</p>
|
<p>Aura Courier MCP v2.7.1 · Built with pride by <a href="https://auraajenticai.cloud" style="color:var(--text);font-weight:600;">Aura Ajentic AI</a> · Apache 2.0 License</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "aura-courier-mcp",
|
"name": "aura-courier-mcp",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "aura-courier-mcp",
|
"name": "aura-courier-mcp",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aura-courier-mcp",
|
"name": "aura-courier-mcp",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"description": "Universal Bangladesh courier MCP server for Steadfast, Pathao, RedX, and Paperfly with zero-mock fraud risk, Google Maps routing, enterprise privacy, and token-bucket rate limiting.",
|
"description": "Universal Bangladesh courier MCP server for Steadfast, Pathao, RedX, and Paperfly with zero-mock fraud risk, Google Maps routing, enterprise privacy, and token-bucket rate limiting.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"test": "node --test test/v260.test.mjs",
|
"test": "node --test test/v260.test.mjs test/oauth21.test.mjs",
|
||||||
"prepublishOnly": "npm run test && npm run build",
|
"prepublishOnly": "npm run test && npm run build",
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"start:http": "node dist/http.js",
|
"start:http": "node dist/http.js",
|
||||||
|
|||||||
+8
-3
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://antigravity.google/schemas/v1/plugin.json",
|
||||||
"name": "aura-courier",
|
"name": "aura-courier",
|
||||||
"displayName": "Aura Courier MCP",
|
"displayName": "Aura Courier MCP",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"category": "Business / Logistics",
|
"category": "Business / Logistics",
|
||||||
"description": "Enterprise Bangladesh Courier & Logistics Automation Hub. Real-time multi-carrier parcel dispatch, nationwide COD balance tracking, zero-mock fraud risk defense, sublocality geocoding, and automated NDR dispute triage across Steadfast, Pathao, RedX, and Paperfly.",
|
"description": "Enterprise Bangladesh Courier & Logistics Automation Hub. Real-time multi-carrier parcel dispatch, nationwide COD balance tracking, zero-mock fraud risk defense, sublocality geocoding, and automated NDR dispute triage across Steadfast, Pathao, RedX, and Paperfly.",
|
||||||
"logo": "assets/logo.svg",
|
"logo": "assets/logo.svg",
|
||||||
@@ -21,6 +22,8 @@
|
|||||||
"tier": "Google Cloud Partner Advantage"
|
"tier": "Google Cloud Partner Advantage"
|
||||||
},
|
},
|
||||||
"homepage": "https://courier.auraajenticai.cloud",
|
"homepage": "https://courier.auraajenticai.cloud",
|
||||||
|
"privacyPolicyUrl": "https://courier.auraajenticai.cloud/privacy",
|
||||||
|
"termsOfServiceUrl": "https://courier.auraajenticai.cloud/terms",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/auraajenticai/aura-courier-mcp.git"
|
"url": "https://github.com/auraajenticai/aura-courier-mcp.git"
|
||||||
@@ -38,13 +41,15 @@
|
|||||||
"cod",
|
"cod",
|
||||||
"fraud-detection",
|
"fraud-detection",
|
||||||
"geocoding",
|
"geocoding",
|
||||||
"ecommerce"
|
"ecommerce",
|
||||||
|
"oauth2"
|
||||||
],
|
],
|
||||||
"mcpServers": {
|
"mcpServers": {
|
||||||
"aura-courier": {
|
"aura-courier": {
|
||||||
|
"serverUrl": "https://courier.auraajenticai.cloud/mcp",
|
||||||
"url": "https://courier.auraajenticai.cloud/mcp",
|
"url": "https://courier.auraajenticai.cloud/mcp",
|
||||||
"transport": "streamable-http",
|
"transport": "streamable-http",
|
||||||
"description": "Universal Bangladesh Courier MCP Hub providing 9 live logistics tools"
|
"description": "Universal Bangladesh Courier MCP Hub providing 13 live logistics & spatial intelligence tools with OAuth 2.1 + PKCE"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -254,7 +254,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>Aura Courier MCP v2.6.1 · Developed by <b>Aura Agentic AI</b> · Released under <b>Apache License 2.0</b></p>
|
<p>Aura Courier MCP v2.7.1 · Developed by <b>Aura Agentic AI</b> · Released under <b>Apache License 2.0</b></p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://auraajenticai.cloud" target="_blank" rel="noopener">auraajenticai.cloud</a> ·
|
<a href="https://auraajenticai.cloud" target="_blank" rel="noopener">auraajenticai.cloud</a> ·
|
||||||
<a href="https://github.com/auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">github.com/auraajenticai</a> ·
|
<a href="https://github.com/auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">github.com/auraajenticai</a> ·
|
||||||
|
|||||||
+9
-3
@@ -3,17 +3,23 @@
|
|||||||
"name": "io.github.auraajenticai/aura-courier-mcp",
|
"name": "io.github.auraajenticai/aura-courier-mcp",
|
||||||
"title": "Aura Courier MCP",
|
"title": "Aura Courier MCP",
|
||||||
"description": "Bangladesh courier connector: Steadfast, Pathao, RedX, Paperfly normalized delivery and tracking.",
|
"description": "Bangladesh courier connector: Steadfast, Pathao, RedX, Paperfly normalized delivery and tracking.",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"websiteUrl": "https://github.com/auraajenticai/aura-courier-mcp",
|
"websiteUrl": "https://courier.auraajenticai.cloud",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "https://github.com/auraajenticai/aura-courier-mcp",
|
"url": "https://github.com/auraajenticai/aura-courier-mcp",
|
||||||
"source": "github"
|
"source": "github"
|
||||||
},
|
},
|
||||||
|
"remotes": [
|
||||||
|
{
|
||||||
|
"type": "streamable-http",
|
||||||
|
"url": "https://courier.auraajenticai.cloud/mcp"
|
||||||
|
}
|
||||||
|
],
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"registryType": "npm",
|
"registryType": "npm",
|
||||||
"identifier": "aura-courier-mcp",
|
"identifier": "aura-courier-mcp",
|
||||||
"version": "2.6.1",
|
"version": "2.7.1",
|
||||||
"transport": {
|
"transport": {
|
||||||
"type": "stdio"
|
"type": "stdio"
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -1576,7 +1576,7 @@
|
|||||||
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
<img class="logo-img" src="/assets/courier-logo.png" onerror="this.onerror=null; this.src='/assets/courier-logo.jpg';" alt="Aura Courier MCP Logo" />
|
||||||
<div>
|
<div>
|
||||||
<span class="f-brand-title">Aura Courier MCP</span>
|
<span class="f-brand-title">Aura Courier MCP</span>
|
||||||
<span class="version-pill">v2.6.1</span>
|
<span class="version-pill">v2.7.1</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="footer-tagline">
|
<p class="footer-tagline">
|
||||||
@@ -1628,7 +1628,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
<a href="https://www.npmjs.com/package/@auraajenticai/aura-courier-mcp" target="_blank" rel="noopener">
|
||||||
<span>📦 npm Package (v2.6.1)</span>
|
<span>📦 npm Package (v2.7.1)</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -7,15 +7,15 @@ description: >-
|
|||||||
carrier rates, or resolving NDR delivery issues across Steadfast, Pathao, RedX, and Paperfly.
|
carrier rates, or resolving NDR delivery issues across Steadfast, Pathao, RedX, and Paperfly.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Bangladesh Courier Operations & Zero-Risk COD Hub (v2.4.2)
|
# Bangladesh Courier Operations & Zero-Risk COD Hub (v2.7.1)
|
||||||
|
|
||||||
This skill provides complete operational runbooks, tool execution patterns, and domain intelligence for managing nationwide e-commerce logistics across Bangladesh via the **Aura Courier MCP** remote server (`https://courier.auraajenticai.cloud/mcp`).
|
This skill provides complete operational runbooks, tool execution patterns, and domain intelligence for managing nationwide e-commerce logistics across Bangladesh via the **Aura Courier MCP** remote server (`https://courier.auraajenticai.cloud/mcp`, OAuth 2.1 + PKCE `S256` & Dual-Auth).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 1. Tool Catalog & Capabilities (9 Live Production Tools)
|
## 1. Tool Catalog & Capabilities (13 Live Production Tools)
|
||||||
|
|
||||||
The remote MCP server exposes 9 specialized logistics tools:
|
The remote MCP server exposes 13 specialized logistics and spatial intelligence tools (each annotated with MCP `readOnlyHint`, `destructiveHint`, `idempotentHint`, and `openWorldHint`):
|
||||||
|
|
||||||
### 1. `list_couriers`
|
### 1. `list_couriers`
|
||||||
* **Purpose**: Inspect currently configured carrier credentials (Steadfast, Pathao, RedX, Paperfly) and verify Google Maps Platform spatial routing readiness.
|
* **Purpose**: Inspect currently configured carrier credentials (Steadfast, Pathao, RedX, Paperfly) and verify Google Maps Platform spatial routing readiness.
|
||||||
@@ -137,6 +137,30 @@ The remote MCP server exposes 9 specialized logistics tools:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 10. `cancel_parcel`
|
||||||
|
* **Purpose**: Cancel an existing parcel consignment across Steadfast, Pathao, RedX, or Paperfly (`destructiveHint: true`). Executes live upstream cancellation on Pathao, RedX, and Paperfly; validates eligibility and provides portal guidance on Steadfast.
|
||||||
|
* **Input Schema**: `courier` *(required)*, `consignment_id` *(required)*, `reason` *(optional)*.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 11. `update_parcel`
|
||||||
|
* **Purpose**: Update delivery instructions, recipient phone, address landmark, or COD amount on an existing in-transit consignment (`readOnlyHint: false`).
|
||||||
|
* **Input Schema**: `courier` *(required)*, `consignment_id` *(required)*, `recipient_phone`, `recipient_address`, `cod_amount`, `note`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 12. `bulk_create_parcels`
|
||||||
|
* **Purpose**: Validate (`dry_run: true`) or book up to 100 parcels in one batch with per-item error isolation and per-tenant invoice idempotency (`readOnlyHint: false`).
|
||||||
|
* **Input Schema**: `items[]` *(required, 1–100 parcel objects)*, `dry_run` *(optional boolean)*.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 13. `get_webhook_events`
|
||||||
|
* **Purpose**: Query verified real-time courier webhook status events recorded from Steadfast, Pathao, RedX, and Paperfly (`readOnlyHint: true`).
|
||||||
|
* **Input Schema**: `consignment_id` *(optional)*, `since` *(optional ISO-8601 timestamp)*.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 2. Progressive Disclosure & Order Lifecycle Workflow
|
## 2. Progressive Disclosure & Order Lifecycle Workflow
|
||||||
|
|
||||||
When executing parcel fulfillment, follow this 4-step progressive lifecycle:
|
When executing parcel fulfillment, follow this 4-step progressive lifecycle:
|
||||||
|
|||||||
+17
-1
@@ -19,6 +19,7 @@ import {
|
|||||||
setTenantDynamicKeyStatus,
|
setTenantDynamicKeyStatus,
|
||||||
listDynamicKeySummaries,
|
listDynamicKeySummaries,
|
||||||
} from "./middleware/auth.js";
|
} from "./middleware/auth.js";
|
||||||
|
import { registerOAuthRoutes, buildWwwAuthenticateHeader } from "./middleware/oauth.js";
|
||||||
import { McpToolError, wrapError, wrapSuccess, maskPhone } from "./envelope.js";
|
import { McpToolError, wrapError, wrapSuccess, maskPhone } from "./envelope.js";
|
||||||
import { SupportedCourier } from "./types.js";
|
import { SupportedCourier } from "./types.js";
|
||||||
import { APP_VERSION } from "./version.js";
|
import { APP_VERSION } from "./version.js";
|
||||||
@@ -62,6 +63,7 @@ const PORT = Number(process.env.PORT || 8080);
|
|||||||
const APP_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
const APP_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
const LANDING = path.join(APP_DIR, "index.html");
|
const LANDING = path.join(APP_DIR, "index.html");
|
||||||
const PRIVACY_HTML = path.join(APP_DIR, "privacy.html");
|
const PRIVACY_HTML = path.join(APP_DIR, "privacy.html");
|
||||||
|
const TERMS_HTML = path.join(APP_DIR, "terms.html");
|
||||||
const HEALTH_HTML = path.join(APP_DIR, "health.html");
|
const HEALTH_HTML = path.join(APP_DIR, "health.html");
|
||||||
const MCP_EXPLORER_HTML = path.join(APP_DIR, "mcp_explorer.html");
|
const MCP_EXPLORER_HTML = path.join(APP_DIR, "mcp_explorer.html");
|
||||||
const GUIDE_HTML = path.join(APP_DIR, "guide.html");
|
const GUIDE_HTML = path.join(APP_DIR, "guide.html");
|
||||||
@@ -149,12 +151,14 @@ export function keysFromRequest(req: Request): EnvSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const app: Express = express();
|
export const app: Express = express();
|
||||||
|
app.set("trust proxy", 1);
|
||||||
app.use(express.json({
|
app.use(express.json({
|
||||||
limit: "1mb",
|
limit: "1mb",
|
||||||
verify: (req: any, _res, buf) => {
|
verify: (req: any, _res, buf) => {
|
||||||
req.rawBody = buf;
|
req.rawBody = buf;
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
app.use(express.urlencoded({ extended: false, limit: "1mb" }));
|
||||||
|
|
||||||
// Robust Malformed JSON Syntax Error Guard
|
// Robust Malformed JSON Syntax Error Guard
|
||||||
app.use((err: any, _req: Request, res: Response, next: any) => {
|
app.use((err: any, _req: Request, res: Response, next: any) => {
|
||||||
@@ -184,7 +188,7 @@ app.use((req, res, next) => {
|
|||||||
"Access-Control-Allow-Headers",
|
"Access-Control-Allow-Headers",
|
||||||
"Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version, x-aura-signature, x-steadfast-signature, x-pathao-signature, x-redx-signature, x-paperfly-signature, x-webhook-secret, x-steadfast-api-key, x-steadfast-secret-key, x-steadfast-base-url, x-pathao-client-id, x-pathao-client-secret, x-pathao-username, x-pathao-password, x-pathao-store-id, x-pathao-base-url, x-redx-api-token, x-redx-base-url, x-redx-pickup-store-id, x-paperfly-api-key, x-paperfly-username, x-paperfly-password, x-paperfly-store-name, x-google-maps-key"
|
"Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version, x-aura-signature, x-steadfast-signature, x-pathao-signature, x-redx-signature, x-paperfly-signature, x-webhook-secret, x-steadfast-api-key, x-steadfast-secret-key, x-steadfast-base-url, x-pathao-client-id, x-pathao-client-secret, x-pathao-username, x-pathao-password, x-pathao-store-id, x-pathao-base-url, x-redx-api-token, x-redx-base-url, x-redx-pickup-store-id, x-paperfly-api-key, x-paperfly-username, x-paperfly-password, x-paperfly-store-name, x-google-maps-key"
|
||||||
);
|
);
|
||||||
res.header("Access-Control-Expose-Headers", "mcp-session-id");
|
res.header("Access-Control-Expose-Headers", "mcp-session-id, WWW-Authenticate");
|
||||||
if (req.method === "OPTIONS") {
|
if (req.method === "OPTIONS") {
|
||||||
return res.sendStatus(204);
|
return res.sendStatus(204);
|
||||||
}
|
}
|
||||||
@@ -200,6 +204,9 @@ app.get("/favicon.ico", (_req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Standard MCP OAuth 2.1 + PKCE (S256) + RFC 9728 + RFC 8414 + RFC 7591 Dynamic Client Registration
|
||||||
|
registerOAuthRoutes(app);
|
||||||
|
|
||||||
app.use(optionalAuthMiddleware);
|
app.use(optionalAuthMiddleware);
|
||||||
|
|
||||||
|
|
||||||
@@ -420,6 +427,7 @@ app.get("/mcp", mcpLimiter, async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!req.auraAuth?.authenticated) {
|
if (!req.auraAuth?.authenticated) {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, req.auraAuth?.tenantId === "invalid"));
|
||||||
return res.status(401).json(
|
return res.status(401).json(
|
||||||
wrapError(
|
wrapError(
|
||||||
new McpToolError({
|
new McpToolError({
|
||||||
@@ -864,6 +872,14 @@ app.get("/privacy", (_req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.get("/terms", (_req, res) => {
|
||||||
|
res.sendFile(TERMS_HTML, (err) => {
|
||||||
|
if (err && !res.headersSent) {
|
||||||
|
res.redirect("/");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
app.get("/guide", (_req, res) => {
|
app.get("/guide", (_req, res) => {
|
||||||
res.sendFile(GUIDE_HTML, (err) => {
|
res.sendFile(GUIDE_HTML, (err) => {
|
||||||
if (err && !res.headersSent) {
|
if (err && !res.headersSent) {
|
||||||
|
|||||||
+31
-7
@@ -1,6 +1,7 @@
|
|||||||
import { Request, Response, NextFunction } from "express";
|
import { Request, Response, NextFunction } from "express";
|
||||||
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
||||||
import { maskPhone, wrapError, McpToolError } from "../envelope.js";
|
import { maskPhone, wrapError, McpToolError } from "../envelope.js";
|
||||||
|
import { verifyOAuthAccessToken, buildWwwAuthenticateHeader } from "./oauth.js";
|
||||||
|
|
||||||
export type AuthScope = "read" | "write";
|
export type AuthScope = "read" | "write";
|
||||||
|
|
||||||
@@ -135,6 +136,14 @@ export async function initDynamicAuthStore(pool: any): Promise<void> {
|
|||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
)
|
)
|
||||||
`);
|
`);
|
||||||
|
} catch (ddlErr: any) {
|
||||||
|
// Least-privilege runtime DB roles (e.g. aura_courier_runtime) intentionally lack schema CREATE;
|
||||||
|
// the table is pre-provisioned, so continue cleanly to load rows below.
|
||||||
|
if (!/permission denied/i.test(String(ddlErr?.message || ""))) {
|
||||||
|
console.warn("[Auth] Dynamic key table DDL skipped:", ddlErr?.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
const res = await pool.query("SELECT token_hash, tenant_id, store_name, scopes, is_admin, status, updated_at FROM aura_mcp_dynamic_keys");
|
const res = await pool.query("SELECT token_hash, tenant_id, store_name, scopes, is_admin, status, updated_at FROM aura_mcp_dynamic_keys");
|
||||||
for (const row of res.rows || []) {
|
for (const row of res.rows || []) {
|
||||||
dynamicKeyHashes.set(row.token_hash, {
|
dynamicKeyHashes.set(row.token_hash, {
|
||||||
@@ -149,7 +158,7 @@ export async function initDynamicAuthStore(pool: any): Promise<void> {
|
|||||||
}
|
}
|
||||||
console.log(`[Auth] Loaded ${dynamicKeyHashes.size} dynamic MCP key(s) from PostgreSQL.`);
|
console.log(`[Auth] Loaded ${dynamicKeyHashes.size} dynamic MCP key(s) from PostgreSQL.`);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.warn("[Auth] Dynamic key table init skipped:", err?.message);
|
console.warn("[Auth] Dynamic key table load skipped:", err?.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,6 +270,21 @@ export function resolveAuthContext(req: Request): AuraAuthContext {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 0. Standard MCP OAuth 2.1 JWT Access Token (Google Gemini, ChatGPT, Claude Web)
|
||||||
|
if (token.startsWith("eyJ") && token.split(".").length === 3) {
|
||||||
|
const oauthClaims = verifyOAuthAccessToken(token);
|
||||||
|
if (oauthClaims) {
|
||||||
|
return {
|
||||||
|
authenticated: true,
|
||||||
|
tenantId: oauthClaims.sub,
|
||||||
|
scopes: Array.isArray(oauthClaims.scp) && oauthClaims.scp.length ? oauthClaims.scp : ["read"],
|
||||||
|
isByok,
|
||||||
|
isAdmin: Boolean(oauthClaims.adm),
|
||||||
|
callerToken: token,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 1. Master / Admin Key (Full Read + Write across all tenants)
|
// 1. Master / Admin Key (Full Read + Write across all tenants)
|
||||||
if (safeCompare(token, masterKey) || safeCompare(token, adminKey)) {
|
if (safeCompare(token, masterKey) || safeCompare(token, adminKey)) {
|
||||||
return {
|
return {
|
||||||
@@ -460,13 +484,14 @@ export function requireMcpAuth(req: Request, res: Response, next: NextFunction):
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a caller explicitly passed an invalid / forged token, always reject with 401
|
// If a caller explicitly passed an invalid / expired / forged token, always reject with 401 + RFC 9728 WWW-Authenticate
|
||||||
if (ctx.tenantId === "invalid") {
|
if (ctx.tenantId === "invalid") {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, true));
|
||||||
res.status(401).json(
|
res.status(401).json(
|
||||||
wrapError(
|
wrapError(
|
||||||
new McpToolError({
|
new McpToolError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "Invalid or forged Authorization token.",
|
message: "Invalid or expired Authorization token.",
|
||||||
retryable: false,
|
retryable: false,
|
||||||
source: "validator",
|
source: "validator",
|
||||||
})
|
})
|
||||||
@@ -475,10 +500,8 @@ export function requireMcpAuth(req: Request, res: Response, next: NextFunction):
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow unauthenticated discovery handshakes (initialize, notifications/initialized, tools/list, ping)
|
// Allow stateless public catalog discovery (tools/list, ping) for MCP directories while requiring auth on initialize/tools/call so OAuth 2.1 clients (Gemini, ChatGPT, Claude Web) trigger automatic OAuth discovery via 401 WWW-Authenticate.
|
||||||
const isDiscovery =
|
const isDiscovery =
|
||||||
method === "initialize" ||
|
|
||||||
method === "notifications/initialized" ||
|
|
||||||
method === "tools/list" ||
|
method === "tools/list" ||
|
||||||
method === "ping";
|
method === "ping";
|
||||||
|
|
||||||
@@ -492,11 +515,12 @@ export function requireMcpAuth(req: Request, res: Response, next: NextFunction):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ctx.authenticated) {
|
if (!ctx.authenticated) {
|
||||||
|
res.setHeader("WWW-Authenticate", buildWwwAuthenticateHeader(req, false));
|
||||||
res.status(401).json(
|
res.status(401).json(
|
||||||
wrapError(
|
wrapError(
|
||||||
new McpToolError({
|
new McpToolError({
|
||||||
code: "UNAUTHORIZED",
|
code: "UNAUTHORIZED",
|
||||||
message: "Missing or invalid Authorization: Bearer <key> header on /mcp. Please provide your API key or BYOK carrier keys.",
|
message: "Missing or invalid Authorization: Bearer <key> header on /mcp. Authenticate via MCP OAuth 2.1 or provide your API key / BYOK carrier keys.",
|
||||||
retryable: false,
|
retryable: false,
|
||||||
source: "validator",
|
source: "validator",
|
||||||
})
|
})
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -15,12 +15,26 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "list_couriers",
|
name: "list_couriers",
|
||||||
description:
|
description:
|
||||||
"Inspect operational health, configuration status, and active API credentials for supported Bangladeshi courier networks (Steadfast, Pathao, RedX, Paperfly) and spatial routing services (Google Maps Platform). READ-ONLY DISCOVERY TOOL: Has zero external side effects and does not mutate database or carrier state. Use when initializing a session to verify which couriers are ready for order dispatch or balance checking. Do NOT use for querying shipment status (use 'track_parcel') or calculating shipping fees (use 'calculate_delivery_zone_and_fee').",
|
"Inspect operational health, configuration status, and active API credentials for supported Bangladeshi courier networks (Steadfast, Pathao, RedX, Paperfly) and spatial routing services (Google Maps Platform). READ-ONLY DISCOVERY TOOL: Has zero external side effects and does not mutate database or carrier state. Use when initializing a session to verify which couriers are ready for order dispatch or balance checking. Do NOT use for querying shipment status (use 'track_parcel') or calculating shipping fees (use 'calculate_delivery_zone_and_fee').",
|
||||||
|
annotations: {
|
||||||
|
title: "List Active Couriers",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
|
},
|
||||||
inputSchema: { type: "object", properties: {}, required: [] },
|
inputSchema: { type: "object", properties: {}, required: [] },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "create_parcel",
|
name: "create_parcel",
|
||||||
description:
|
description:
|
||||||
"Book and dispatch a physical parcel consignment across Bangladesh through Steadfast, Pathao, RedX, Paperfly, or AI smart cascading routing, with built-in per-tenant invoice idempotency and optional dry-run validation. STATE-MUTATING ACTION (unless dry_run=true): Creates a real, billable shipment record in the carrier's production database, assigns an official tracking code, and deducts courier fees upon pickup. Set dry_run=true to validate recipient phone/address and preview the target courier and estimated BDT cost without booking upstream. Once booked, cancellations require direct courier portal operations ('cancellable_via_api: false').",
|
"Book and dispatch a physical parcel consignment across Bangladesh through Steadfast, Pathao, RedX, Paperfly, or AI smart cascading routing, with built-in per-tenant invoice idempotency and optional dry-run validation. STATE-MUTATING ACTION (unless dry_run=true): Creates a real, billable shipment record in the carrier's production database, assigns an official tracking code, and deducts courier fees upon pickup. Set dry_run=true to validate recipient phone/address and preview the target courier and estimated BDT cost without booking upstream. Once booked, cancellations require direct courier portal operations ('cancellable_via_api: false').",
|
||||||
|
annotations: {
|
||||||
|
title: "Create & Dispatch Parcel",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -52,6 +66,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "track_parcel",
|
name: "track_parcel",
|
||||||
description:
|
description:
|
||||||
"Query live, real-time tracking milestones and delivery telemetry across Steadfast, Pathao, RedX, and Paperfly networks using consignment ID or tracking code. READ-ONLY OPERATION: Does not alter shipment state or carrier data. Returns normalized status, current location, carrier status notes, and timestamp history. Returns structured error code 'CONSIGNMENT_NOT_FOUND' with 'couriers_checked' if the consignment does not exist. Carrier provider is auto-detected from consignment prefix if omitted.",
|
"Query live, real-time tracking milestones and delivery telemetry across Steadfast, Pathao, RedX, and Paperfly networks using consignment ID or tracking code. READ-ONLY OPERATION: Does not alter shipment state or carrier data. Returns normalized status, current location, carrier status notes, and timestamp history. Returns structured error code 'CONSIGNMENT_NOT_FOUND' with 'couriers_checked' if the consignment does not exist. Carrier provider is auto-detected from consignment prefix if omitted.",
|
||||||
|
annotations: {
|
||||||
|
title: "Track Parcel Live",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -72,6 +93,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "get_balance",
|
name: "get_balance",
|
||||||
description:
|
description:
|
||||||
"Retrieve live merchant cash-on-delivery (COD) vault balance from Steadfast, or check provider balance support across Pathao, RedX, Paperfly, or all 4 couriers simultaneously. READ-ONLY FINANCIAL INQUIRY: Steadfast returns live 'amount_bdt' and 'status: OK'; Pathao, RedX, and Paperfly return 'amount_bdt: null' and 'status: UNSUPPORTED_BY_PROVIDER' with merchant portal hints because their public APIs do not expose a balance endpoint.",
|
"Retrieve live merchant cash-on-delivery (COD) vault balance from Steadfast, or check provider balance support across Pathao, RedX, Paperfly, or all 4 couriers simultaneously. READ-ONLY FINANCIAL INQUIRY: Steadfast returns live 'amount_bdt' and 'status: OK'; Pathao, RedX, and Paperfly return 'amount_bdt: null' and 'status: UNSUPPORTED_BY_PROVIDER' with merchant portal hints because their public APIs do not expose a balance endpoint.",
|
||||||
|
annotations: {
|
||||||
|
title: "Get Merchant COD Balance",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -88,6 +116,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "check_fraud_risk",
|
name: "check_fraud_risk",
|
||||||
description:
|
description:
|
||||||
"Screen a customer phone number against live nationwide Bangladesh logistics databases (Steadfast & Pathao) and the BTRC 11-digit prefix validator for delivery success rate, cancellation counts, and return fraud risk level ('INVALID_NUMBER', 'NO_HISTORY', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'). READ-ONLY DIAGNOSTIC QUERY: Returns null rates when a number is invalid or has 0 parcel history. Expects an 11-digit Bangladeshi mobile number ('01[3-9]XXXXXXXX').",
|
"Screen a customer phone number against live nationwide Bangladesh logistics databases (Steadfast & Pathao) and the BTRC 11-digit prefix validator for delivery success rate, cancellation counts, and return fraud risk level ('INVALID_NUMBER', 'NO_HISTORY', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'). READ-ONLY DIAGNOSTIC QUERY: Returns null rates when a number is invalid or has 0 parcel history. Expects an 11-digit Bangladeshi mobile number ('01[3-9]XXXXXXXX').",
|
||||||
|
annotations: {
|
||||||
|
title: "Check Customer Fraud Risk",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -100,6 +135,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "validate_and_geocode_address",
|
name: "validate_and_geocode_address",
|
||||||
description:
|
description:
|
||||||
"Validate, clean, and geocode an unformatted Bangladesh delivery address into structured administrative boundaries (thana_input, thana_resolved, district, division), latitude/longitude coordinates, match_quality (road, house, area), needs_review flag, and a deliverability confidence score (0-100, capped at 60 when location_type != ROOFTOP) via Google Maps Platform Geocoding API with OpenStreetMap gazetteer fallback. READ-ONLY SPATIAL LOOKUP.",
|
"Validate, clean, and geocode an unformatted Bangladesh delivery address into structured administrative boundaries (thana_input, thana_resolved, district, division), latitude/longitude coordinates, match_quality (road, house, area), needs_review flag, and a deliverability confidence score (0-100, capped at 60 when location_type != ROOFTOP) via Google Maps Platform Geocoding API with OpenStreetMap gazetteer fallback. READ-ONLY SPATIAL LOOKUP.",
|
||||||
|
annotations: {
|
||||||
|
title: "Validate & Geocode Address",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -114,6 +156,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "calculate_delivery_zone_and_fee",
|
name: "calculate_delivery_zone_and_fee",
|
||||||
description:
|
description:
|
||||||
"Calculate standard delivery zone (inside_dhaka <=22km ৳80, sub_dhaka 22-45km ৳100, outside_dhaka >45km ৳150), road distance via Google Maps Platform Routes API, structured SLA hours ({min, max}), and applicable COD percentage for a single delivery destination using the unified tariff table (meta.source='static_tariff'). READ-ONLY ESTIMATION TOOL.",
|
"Calculate standard delivery zone (inside_dhaka <=22km ৳80, sub_dhaka 22-45km ৳100, outside_dhaka >45km ৳150), road distance via Google Maps Platform Routes API, structured SLA hours ({min, max}), and applicable COD percentage for a single delivery destination using the unified tariff table (meta.source='static_tariff'). READ-ONLY ESTIMATION TOOL.",
|
||||||
|
annotations: {
|
||||||
|
title: "Calculate Delivery Zone & Fee",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -128,6 +177,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "compare_courier_rates",
|
name: "compare_courier_rates",
|
||||||
description:
|
description:
|
||||||
"Execute side-by-side tariff, structured SLA ({min, max}), and COD collection fee comparisons across all four major Bangladeshi couriers (Steadfast, Pathao, RedX, Paperfly) for any destination nationwide using the unified tariff table (meta.source='static_tariff'). Evaluates exact parcel weight, declared COD amount, and optimization priority ('cheapest', 'fastest', 'balanced') to select the recommended courier. READ-ONLY CALCULATION ENGINE.",
|
"Execute side-by-side tariff, structured SLA ({min, max}), and COD collection fee comparisons across all four major Bangladeshi couriers (Steadfast, Pathao, RedX, Paperfly) for any destination nationwide using the unified tariff table (meta.source='static_tariff'). Evaluates exact parcel weight, declared COD amount, and optimization priority ('cheapest', 'fastest', 'balanced') to select the recommended courier. READ-ONLY CALCULATION ENGINE.",
|
||||||
|
annotations: {
|
||||||
|
title: "Compare Multi-Carrier Rates",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -147,6 +203,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "resolve_ndr_issue",
|
name: "resolve_ndr_issue",
|
||||||
description:
|
description:
|
||||||
"Verify that a consignment exists on the specified courier via 'track_parcel' and generate honest, draft-only Non-Delivery Report (NDR) re-engagement copy ('status: DRAFT_GENERATED', 'actions_executed: []'). GENERATION-ONLY TOOL: Verifies consignment_id first (returns CONSIGNMENT_NOT_FOUND if unknown), then generates proposed Bengali WhatsApp copy ('whatsapp_draft') and a carrier escalation ticket draft ('courier_ticket_draft') for manual merchant execution.",
|
"Verify that a consignment exists on the specified courier via 'track_parcel' and generate honest, draft-only Non-Delivery Report (NDR) re-engagement copy ('status: DRAFT_GENERATED', 'actions_executed: []'). GENERATION-ONLY TOOL: Verifies consignment_id first (returns CONSIGNMENT_NOT_FOUND if unknown), then generates proposed Bengali WhatsApp copy ('whatsapp_draft') and a carrier escalation ticket draft ('courier_ticket_draft') for manual merchant execution.",
|
||||||
|
annotations: {
|
||||||
|
title: "Generate NDR Resolution Draft",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -169,6 +232,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "cancel_parcel",
|
name: "cancel_parcel",
|
||||||
description:
|
description:
|
||||||
"Cancel an existing parcel consignment across Steadfast, Pathao, RedX, or Paperfly. For carriers with automated cancellation APIs (Pathao, RedX, Paperfly), executes live upstream cancellation immediately. For Steadfast, validates parcel eligibility, marks internal status as CANCEL_REQUESTED, and provides direct portal action links.",
|
"Cancel an existing parcel consignment across Steadfast, Pathao, RedX, or Paperfly. For carriers with automated cancellation APIs (Pathao, RedX, Paperfly), executes live upstream cancellation immediately. For Steadfast, validates parcel eligibility, marks internal status as CANCEL_REQUESTED, and provides direct portal action links.",
|
||||||
|
annotations: {
|
||||||
|
title: "Cancel Parcel Consignment",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: true,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -183,6 +253,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "update_parcel",
|
name: "update_parcel",
|
||||||
description:
|
description:
|
||||||
"Update delivery instructions, customer phone number, delivery address landmark, or COD collection amount for an existing in-transit consignment across supported courier partners. STATE-MUTATING ACTION: Propagates updated delivery notes upstream to carrier dispatch centers.",
|
"Update delivery instructions, customer phone number, delivery address landmark, or COD collection amount for an existing in-transit consignment across supported courier partners. STATE-MUTATING ACTION: Propagates updated delivery notes upstream to carrier dispatch centers.",
|
||||||
|
annotations: {
|
||||||
|
title: "Update In-Transit Parcel",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -200,6 +277,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "bulk_create_parcels",
|
name: "bulk_create_parcels",
|
||||||
description:
|
description:
|
||||||
"Validate or book up to 100 parcels in a single batch with per-item error isolation, invoice idempotency, and optional dry_run preview mode. STATE-MUTATING ACTION (unless dry_run=true): Returns total, succeeded, failed, and per-item results.",
|
"Validate or book up to 100 parcels in a single batch with per-item error isolation, invoice idempotency, and optional dry_run preview mode. STATE-MUTATING ACTION (unless dry_run=true): Returns total, succeeded, failed, and per-item results.",
|
||||||
|
annotations: {
|
||||||
|
title: "Bulk Create Parcels",
|
||||||
|
readOnlyHint: false,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: true,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -234,6 +318,13 @@ export const TOOLS: Tool[] = [
|
|||||||
name: "get_webhook_events",
|
name: "get_webhook_events",
|
||||||
description:
|
description:
|
||||||
"Query verified courier webhook status events received by the server's /webhooks/{steadfast,pathao,redx,paperfly} endpoints. READ-ONLY DIAGNOSTIC TOOL: Filterable by consignment_id and ISO-8601 'since' timestamp.",
|
"Query verified courier webhook status events received by the server's /webhooks/{steadfast,pathao,redx,paperfly} endpoints. READ-ONLY DIAGNOSTIC TOOL: Filterable by consignment_id and ISO-8601 'since' timestamp.",
|
||||||
|
annotations: {
|
||||||
|
title: "Query Courier Webhook Events",
|
||||||
|
readOnlyHint: true,
|
||||||
|
destructiveHint: false,
|
||||||
|
idempotentHint: true,
|
||||||
|
openWorldHint: false,
|
||||||
|
},
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ function readPackageVersion(): string {
|
|||||||
} catch {
|
} catch {
|
||||||
// Fallback if package.json is unavailable at runtime
|
// Fallback if package.json is unavailable at runtime
|
||||||
}
|
}
|
||||||
return "2.6.1";
|
return "2.7.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
export const APP_VERSION: string = readPackageVersion();
|
export const APP_VERSION: string = readPackageVersion();
|
||||||
|
|||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta name="description" content="Terms of Service for Aura Courier MCP — Enterprise multi-carrier logistics connector for AI agents and e-commerce platforms." />
|
||||||
|
<title>Terms of Service — Aura Courier MCP</title>
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/assets/logo.svg" />
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg: #070b14;
|
||||||
|
--card: rgba(14, 21, 37, 0.85);
|
||||||
|
--line: rgba(148, 163, 184, 0.16);
|
||||||
|
--text: #e2e8f0;
|
||||||
|
--muted: #94a3b8;
|
||||||
|
--cyan: #38bdf8;
|
||||||
|
--emerald: #34d399;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
body {
|
||||||
|
background:
|
||||||
|
radial-gradient(900px 460px at 50% -10%, rgba(6, 182, 212, 0.12), transparent 60%),
|
||||||
|
var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.7;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
a { color: var(--cyan); text-decoration: none; }
|
||||||
|
a:hover { text-decoration: underline; }
|
||||||
|
header {
|
||||||
|
position: sticky; top: 0; z-index: 20;
|
||||||
|
backdrop-filter: blur(14px);
|
||||||
|
background: rgba(7, 11, 20, 0.88);
|
||||||
|
border-bottom: 1px solid var(--line);
|
||||||
|
}
|
||||||
|
.hbar {
|
||||||
|
max-width: 900px; margin: 0 auto; padding: 14px 20px;
|
||||||
|
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||||
|
}
|
||||||
|
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15.5px; color: #fff; text-decoration: none; }
|
||||||
|
.brand img { width: 34px; height: 34px; border-radius: 9px; }
|
||||||
|
.nav { display: flex; gap: 14px; font-size: 13px; font-weight: 600; }
|
||||||
|
.wrap { max-width: 900px; margin: 0 auto; padding: 42px 20px 72px; }
|
||||||
|
.pill {
|
||||||
|
display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650;
|
||||||
|
color: var(--emerald); background: rgba(16, 185, 129, 0.12);
|
||||||
|
border: 1px solid rgba(16, 185, 129, 0.3); padding: 4px 12px; border-radius: 999px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.025em; color: #fff; margin-bottom: 8px; }
|
||||||
|
.meta { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
|
||||||
|
.card {
|
||||||
|
background: var(--card); border: 1px solid var(--line); border-radius: 16px;
|
||||||
|
padding: 24px 26px; margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
.card h2 { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 10px; }
|
||||||
|
.card p { color: #cbd5e1; margin-bottom: 10px; }
|
||||||
|
.card p:last-child { margin-bottom: 0; }
|
||||||
|
.card ul { margin: 8px 0 0 20px; color: #cbd5e1; display: grid; gap: 6px; }
|
||||||
|
footer {
|
||||||
|
max-width: 900px; margin: 0 auto; padding: 24px 20px 44px;
|
||||||
|
border-top: 1px solid var(--line); text-align: center;
|
||||||
|
font-size: 12.5px; color: var(--muted);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<div class="hbar">
|
||||||
|
<a href="/" class="brand">
|
||||||
|
<img src="/assets/logo.svg" alt="Aura Courier MCP" />
|
||||||
|
<span>Aura Courier MCP</span>
|
||||||
|
</a>
|
||||||
|
<nav class="nav">
|
||||||
|
<a href="/">Home</a>
|
||||||
|
<a href="/guide">Docs</a>
|
||||||
|
<a href="/privacy">Privacy Policy</a>
|
||||||
|
<a href="/health.html">Status</a>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="wrap">
|
||||||
|
<div class="pill">Effective: November 24, 2026 · v2.7.1</div>
|
||||||
|
<h1>Terms of Service</h1>
|
||||||
|
<p class="meta">Published by <strong>Aura Ajentic AI</strong> (Google Cloud Partner Advantage) · Contact: <a href="mailto:ceo@auraajenticai.cloud">ceo@auraajenticai.cloud</a></p>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>1. Scope of Service</h2>
|
||||||
|
<p>Aura Courier MCP (<code>https://courier.auraajenticai.cloud</code>) provides a Model Context Protocol (MCP) server and logistics integration gateway enabling AI assistants (including Google Gemini, Antigravity, Claude, ChatGPT, Cursor, and custom agents) and e-commerce stores to interact with supported Bangladeshi courier providers (Steadfast, Pathao, RedX, Paperfly) and Google Maps Platform spatial APIs.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>2. Authentication, OAuth 2.1 & Credential Responsibility</h2>
|
||||||
|
<p>Access to protected endpoints is governed via OAuth 2.1 with PKCE (<code>S256</code>), Aura Cloud SSO, scoped Merchant API keys, or Bring-Your-Own-Key (BYOK) request headers.</p>
|
||||||
|
<ul>
|
||||||
|
<li>You are solely responsible for safeguarding your Aura account credentials, API keys, and third-party carrier credentials.</li>
|
||||||
|
<li>OAuth tokens may be revoked at any time via <code>POST /oauth/revoke</code> or through your Aura Cloud Console.</li>
|
||||||
|
<li>Read-Only Sandbox access is strictly limited to non-mutating discovery and estimation tools.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>3. Carrier Dispatch, Fees & Billable Actions</h2>
|
||||||
|
<p>State-mutating tools such as <code>create_parcel</code>, <code>bulk_create_parcels</code>, <code>update_parcel</code>, and <code>cancel_parcel</code> transmit real operational requests directly to third-party courier networks when invoked with write credentials (unless <code>dry_run: true</code> is specified).</p>
|
||||||
|
<ul>
|
||||||
|
<li>All courier shipping charges, COD settlement timelines, pickup schedules, and parcel insurance terms are governed directly by your agreement with Steadfast, Pathao, RedX, or Paperfly.</li>
|
||||||
|
<li>We recommend using <code>dry_run: true</code> or human-in-the-loop confirmation before dispatching high-value COD shipments.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>4. Acceptable Use & Rate Limits</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Do not abuse fraud-check, geocoding, or carrier APIs for unauthorized scraping, harassment, or unlawful surveillance.</li>
|
||||||
|
<li>Fair-use rate limits (per-key and per-IP) apply to protect carrier upstream quotas and platform availability.</li>
|
||||||
|
<li>Any automated or human-initiated misuse may result in immediate key suspension or revocation.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>5. Privacy, Retention & Open-Source License</h2>
|
||||||
|
<p>Personal data handling, PII masking on public tracking pages, 90-day automated anonymization, and zero-knowledge credential isolation are detailed in our <a href="/privacy">Privacy Policy</a>. The Aura Courier MCP open-source codebase is licensed under the <a href="https://opensource.org/licenses/Apache-2.0" target="_blank" rel="noopener">Apache License 2.0</a>.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>6. Disclaimer & Support</h2>
|
||||||
|
<p>Aura Courier MCP is provided "as is" without warranties regarding third-party courier API uptime or carrier delivery SLAs. For enterprise support, compliance inquiries, or security disclosures, contact <a href="mailto:ceo@auraajenticai.cloud">ceo@auraajenticai.cloud</a>.</p>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>Aura Courier MCP v2.7.1 · Operated by <a href="https://auraajenticai.cloud">Aura Ajentic AI</a> · <a href="/privacy">Privacy Policy</a> · <a href="/terms">Terms of Service</a></p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,559 @@
|
|||||||
|
import test from "node:test";
|
||||||
|
import assert from "node:assert/strict";
|
||||||
|
import http from "node:http";
|
||||||
|
import { createHash, createHmac, randomBytes } from "node:crypto";
|
||||||
|
|
||||||
|
process.env.NODE_ENV = "test";
|
||||||
|
process.env.AURA_API_KEY = "aura_test_master_key_oauth21";
|
||||||
|
process.env.AURA_READONLY_KEY = "aura_ro_test_reader_oauth21";
|
||||||
|
process.env.AURA_SSO_JWT_SECRET = "aura_test_sso_jwt_secret_2026";
|
||||||
|
process.env.STEADFAST_API_KEY = "sf_test_key";
|
||||||
|
process.env.STEADFAST_SECRET_KEY = "sf_test_secret";
|
||||||
|
|
||||||
|
const { app } = await import("../dist/http.js");
|
||||||
|
const { SteadfastAdapter } = await import("../dist/adapters/steadfast.js");
|
||||||
|
|
||||||
|
SteadfastAdapter.prototype.getBalance = async function () {
|
||||||
|
return {
|
||||||
|
courier: "steadfast",
|
||||||
|
status: "OK",
|
||||||
|
amount_bdt: 14250,
|
||||||
|
raw_response: { status: 200, current_balance: 14250 },
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
let server;
|
||||||
|
let baseUrl;
|
||||||
|
|
||||||
|
function makePkcePair() {
|
||||||
|
const verifier = randomBytes(32).toString("base64url");
|
||||||
|
const challenge = createHash("sha256").update(verifier).digest("base64url");
|
||||||
|
return { verifier, challenge };
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeAuraSsoCookie(payload) {
|
||||||
|
const header = Buffer.from(JSON.stringify({ alg: "HS256", typ: "JWT" })).toString("base64url");
|
||||||
|
const body = Buffer.from(
|
||||||
|
JSON.stringify({
|
||||||
|
...payload,
|
||||||
|
iat: Math.floor(Date.now() / 1000),
|
||||||
|
exp: Math.floor(Date.now() / 1000) + 900,
|
||||||
|
})
|
||||||
|
).toString("base64url");
|
||||||
|
const sig = createHmac("sha256", Buffer.from(process.env.AURA_SSO_JWT_SECRET, "utf8"))
|
||||||
|
.update(`${header}.${body}`)
|
||||||
|
.digest("base64url");
|
||||||
|
return `aura_access=${header}.${body}.${sig}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractHiddenInput(html, name) {
|
||||||
|
const re = new RegExp(`name="${name}"\\s+value="([^"]*)"`, "i");
|
||||||
|
const m = html.match(re);
|
||||||
|
return m ? m[1] : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
test.before(async () => {
|
||||||
|
server = http.createServer(app);
|
||||||
|
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
||||||
|
const addr = server.address();
|
||||||
|
baseUrl = `http://127.0.0.1:${addr.port}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
test.after(async () => {
|
||||||
|
if (server) {
|
||||||
|
await new Promise((resolve) => server.close(resolve));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 1: 401 on unauthenticated POST /mcp (initialize) and GET /mcp includes RFC 9728 WWW-Authenticate header", async () => {
|
||||||
|
const initRes = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
id: 1,
|
||||||
|
method: "initialize",
|
||||||
|
params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "Google Gemini", version: "1.0" } },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(initRes.status, 401);
|
||||||
|
const wwwAuthInit = initRes.headers.get("www-authenticate") || "";
|
||||||
|
assert.ok(wwwAuthInit.includes("Bearer"));
|
||||||
|
assert.ok(wwwAuthInit.includes(`resource_metadata="${baseUrl}/.well-known/oauth-protected-resource"`));
|
||||||
|
assert.ok((initRes.headers.get("access-control-expose-headers") || "").includes("WWW-Authenticate"));
|
||||||
|
|
||||||
|
const getRes = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "GET",
|
||||||
|
headers: { Accept: "text/event-stream" },
|
||||||
|
});
|
||||||
|
assert.equal(getRes.status, 401);
|
||||||
|
assert.ok((getRes.headers.get("www-authenticate") || "").includes(`resource_metadata="${baseUrl}/.well-known/oauth-protected-resource"`));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 2: RFC 9728 Protected Resource Metadata & RFC 8414 Authorization Server Metadata endpoints return valid JSON", async () => {
|
||||||
|
for (const p of ["/.well-known/oauth-protected-resource", "/.well-known/oauth-protected-resource/mcp"]) {
|
||||||
|
const res = await fetch(`${baseUrl}${p}`);
|
||||||
|
assert.equal(res.status, 200);
|
||||||
|
const data = await res.json();
|
||||||
|
assert.equal(data.resource, `${baseUrl}/mcp`);
|
||||||
|
assert.deepEqual(data.authorization_servers, [baseUrl]);
|
||||||
|
assert.ok(data.bearer_methods_supported.includes("header"));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const p of ["/.well-known/oauth-authorization-server", "/.well-known/openid-configuration"]) {
|
||||||
|
const res = await fetch(`${baseUrl}${p}`);
|
||||||
|
assert.equal(res.status, 200);
|
||||||
|
const data = await res.json();
|
||||||
|
assert.equal(data.issuer, baseUrl);
|
||||||
|
assert.equal(data.authorization_endpoint, `${baseUrl}/oauth/authorize`);
|
||||||
|
assert.equal(data.token_endpoint, `${baseUrl}/oauth/token`);
|
||||||
|
assert.equal(data.registration_endpoint, `${baseUrl}/oauth/register`);
|
||||||
|
assert.ok(data.code_challenge_methods_supported.includes("S256"));
|
||||||
|
assert.ok(data.grant_types_supported.includes("authorization_code"));
|
||||||
|
assert.ok(data.grant_types_supported.includes("refresh_token"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 3: RFC 7591 Dynamic Client Registration allows Google googleusercontent.com redirect URIs & blocks untrusted hosts", async () => {
|
||||||
|
const goodRes = await fetch(`${baseUrl}/oauth/register`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_name: "Google Gemini",
|
||||||
|
redirect_uris: ["https://oauth-redirect.googleusercontent.com/r/gemini-aura-test"],
|
||||||
|
token_endpoint_auth_method: "none",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(goodRes.status, 201);
|
||||||
|
const client = await goodRes.json();
|
||||||
|
assert.ok(client.client_id.startsWith("aura_dcr_"));
|
||||||
|
assert.deepEqual(client.redirect_uris, ["https://oauth-redirect.googleusercontent.com/r/gemini-aura-test"]);
|
||||||
|
|
||||||
|
const badRes = await fetch(`${baseUrl}/oauth/register`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_name: "Untrusted Phish",
|
||||||
|
redirect_uris: ["https://evil.example.com/steal-code"],
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(badRes.status, 400);
|
||||||
|
const badBody = await badRes.json();
|
||||||
|
assert.equal(badBody.error, "invalid_redirect_uri");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 4: Consent UI is global Silicon Valley grade (inline SVG logo, Google SSO, zero internal Snehalata/test-key leaks)", async () => {
|
||||||
|
const redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-ui-audit";
|
||||||
|
const { challenge } = makePkcePair();
|
||||||
|
const authUrl = new URL(`${baseUrl}/oauth/authorize`);
|
||||||
|
authUrl.searchParams.set("response_type", "code");
|
||||||
|
authUrl.searchParams.set("client_id", "google-gemini");
|
||||||
|
authUrl.searchParams.set("redirect_uri", redirectUri);
|
||||||
|
authUrl.searchParams.set("scope", "read write");
|
||||||
|
authUrl.searchParams.set("state", "st_ui");
|
||||||
|
authUrl.searchParams.set("code_challenge", challenge);
|
||||||
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
||||||
|
|
||||||
|
const res = await fetch(authUrl.toString());
|
||||||
|
assert.equal(res.status, 200);
|
||||||
|
const html = await res.text();
|
||||||
|
// Inline SVG logo (no external img tag that can break)
|
||||||
|
assert.ok(html.includes("<svg") && html.includes('aria-label="Aura Courier MCP"'));
|
||||||
|
assert.ok(!html.includes("/assets/courier-logo.jpg"));
|
||||||
|
// Global SSO + Google Sign-In present
|
||||||
|
assert.ok(html.includes("Continue with Google"));
|
||||||
|
assert.ok(html.includes("https://auth.auraajenticai.cloud/login/google"));
|
||||||
|
assert.ok(html.includes("Continue in Read-Only Sandbox"));
|
||||||
|
// Zero internal brand or raw test-key leaks
|
||||||
|
assert.ok(!/snehalata/i.test(html));
|
||||||
|
assert.ok(!html.includes("snl_mcp_"));
|
||||||
|
assert.ok(!html.includes("aura_ro_public_inspector_2026"));
|
||||||
|
assert.ok(!html.includes("Master Key"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 5: 1-Click Aura SSO cookie (aura_access) authorizes owner with full master access & zero key typing", async () => {
|
||||||
|
const redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-sso-owner";
|
||||||
|
const { verifier, challenge } = makePkcePair();
|
||||||
|
const ssoCookie = makeAuraSsoCookie({
|
||||||
|
sub: "11111111-2222-3333-4444-555555555555",
|
||||||
|
email: "ceo@auraajenticai.cloud",
|
||||||
|
role: "owner",
|
||||||
|
});
|
||||||
|
|
||||||
|
const authUrl = new URL(`${baseUrl}/oauth/authorize`);
|
||||||
|
authUrl.searchParams.set("response_type", "code");
|
||||||
|
authUrl.searchParams.set("client_id", "google-gemini");
|
||||||
|
authUrl.searchParams.set("redirect_uri", redirectUri);
|
||||||
|
authUrl.searchParams.set("scope", "read write");
|
||||||
|
authUrl.searchParams.set("state", "st_sso");
|
||||||
|
authUrl.searchParams.set("code_challenge", challenge);
|
||||||
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
||||||
|
|
||||||
|
const consentRes = await fetch(authUrl.toString(), { headers: { Cookie: ssoCookie } });
|
||||||
|
assert.equal(consentRes.status, 200);
|
||||||
|
const consentHtml = await consentRes.text();
|
||||||
|
assert.ok(consentHtml.includes("ceo@auraajenticai.cloud"));
|
||||||
|
assert.ok(consentHtml.includes("Allow Access"));
|
||||||
|
const csrfToken = extractHiddenInput(consentHtml, "csrf_token");
|
||||||
|
|
||||||
|
const approveRes = await fetch(`${baseUrl}/oauth/authorize`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
Cookie: ssoCookie,
|
||||||
|
},
|
||||||
|
body: new URLSearchParams({
|
||||||
|
client_id: "google-gemini",
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
state: "st_sso",
|
||||||
|
scope: "read write",
|
||||||
|
code_challenge: challenge,
|
||||||
|
code_challenge_method: "S256",
|
||||||
|
csrf_token: csrfToken,
|
||||||
|
auth_mode: "sso",
|
||||||
|
decision: "approve",
|
||||||
|
}).toString(),
|
||||||
|
redirect: "manual",
|
||||||
|
});
|
||||||
|
assert.equal(approveRes.status, 302);
|
||||||
|
const code = new URL(approveRes.headers.get("location")).searchParams.get("code");
|
||||||
|
|
||||||
|
const tokRes = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code,
|
||||||
|
client_id: "google-gemini",
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
code_verifier: verifier,
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(tokRes.status, 200);
|
||||||
|
const tokens = await tokRes.json();
|
||||||
|
assert.equal(tokens.scope, "read write");
|
||||||
|
|
||||||
|
const mcpCall = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${tokens.access_token}`,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
id: 50,
|
||||||
|
method: "tools/call",
|
||||||
|
params: { name: "get_balance", arguments: { courier: "steadfast" } },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(mcpCall.status, 200);
|
||||||
|
const body = await mcpCall.json();
|
||||||
|
assert.equal(body.result.isError, false);
|
||||||
|
assert.equal(JSON.parse(body.result.content[0].text).data.amount_bdt, 14250);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 6: End-to-End API Key PKCE S256 flow -> Non-Rotating Refresh -> Static Dual-Auth -> Revocation", async () => {
|
||||||
|
const redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-live-flow";
|
||||||
|
const regRes = await fetch(`${baseUrl}/oauth/register`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
client_name: "Google Gemini",
|
||||||
|
redirect_uris: [redirectUri],
|
||||||
|
token_endpoint_auth_method: "none",
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(regRes.status, 201);
|
||||||
|
const { client_id: clientId } = await regRes.json();
|
||||||
|
|
||||||
|
const { verifier, challenge } = makePkcePair();
|
||||||
|
const state = "gemini_state_xyz_991";
|
||||||
|
|
||||||
|
const authUrl = new URL(`${baseUrl}/oauth/authorize`);
|
||||||
|
authUrl.searchParams.set("response_type", "code");
|
||||||
|
authUrl.searchParams.set("client_id", clientId);
|
||||||
|
authUrl.searchParams.set("redirect_uri", redirectUri);
|
||||||
|
authUrl.searchParams.set("scope", "read write");
|
||||||
|
authUrl.searchParams.set("state", state);
|
||||||
|
authUrl.searchParams.set("code_challenge", challenge);
|
||||||
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
||||||
|
|
||||||
|
const consentHtml = await (await fetch(authUrl.toString())).text();
|
||||||
|
const csrfToken = extractHiddenInput(consentHtml, "csrf_token");
|
||||||
|
|
||||||
|
// Deny -> error=access_denied
|
||||||
|
const denyRes = await fetch(`${baseUrl}/oauth/authorize`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
state,
|
||||||
|
scope: "read write",
|
||||||
|
code_challenge: challenge,
|
||||||
|
code_challenge_method: "S256",
|
||||||
|
csrf_token: csrfToken,
|
||||||
|
auth_mode: "apikey",
|
||||||
|
decision: "deny",
|
||||||
|
}).toString(),
|
||||||
|
redirect: "manual",
|
||||||
|
});
|
||||||
|
assert.equal(denyRes.status, 302);
|
||||||
|
assert.equal(new URL(denyRes.headers.get("location")).searchParams.get("error"), "access_denied");
|
||||||
|
|
||||||
|
// Invalid API key stays on form with clean error
|
||||||
|
const badKeyRes = await fetch(`${baseUrl}/oauth/authorize`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
state,
|
||||||
|
scope: "read write",
|
||||||
|
code_challenge: challenge,
|
||||||
|
code_challenge_method: "S256",
|
||||||
|
csrf_token: csrfToken,
|
||||||
|
auth_mode: "apikey",
|
||||||
|
decision: "approve",
|
||||||
|
api_key: "totally_wrong_key_123",
|
||||||
|
}).toString(),
|
||||||
|
redirect: "manual",
|
||||||
|
});
|
||||||
|
assert.equal(badKeyRes.status, 200);
|
||||||
|
assert.ok((await badKeyRes.text()).includes("Invalid API key"));
|
||||||
|
|
||||||
|
// Valid API key -> 302 with code
|
||||||
|
const approveRes = await fetch(`${baseUrl}/oauth/authorize`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
state,
|
||||||
|
scope: "read write",
|
||||||
|
code_challenge: challenge,
|
||||||
|
code_challenge_method: "S256",
|
||||||
|
csrf_token: csrfToken,
|
||||||
|
auth_mode: "apikey",
|
||||||
|
decision: "approve",
|
||||||
|
api_key: process.env.AURA_API_KEY,
|
||||||
|
}).toString(),
|
||||||
|
redirect: "manual",
|
||||||
|
});
|
||||||
|
assert.equal(approveRes.status, 302);
|
||||||
|
const authCode = new URL(approveRes.headers.get("location")).searchParams.get("code");
|
||||||
|
|
||||||
|
// Wrong PKCE rejected
|
||||||
|
const wrongPkce = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code: authCode,
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
code_verifier: "wrong_verifier_abcdefghijklmnopqrstuvwxyz_0123456789",
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(wrongPkce.status, 400);
|
||||||
|
|
||||||
|
// Correct PKCE -> tokens
|
||||||
|
const tokRes = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code: authCode,
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
code_verifier: verifier,
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(tokRes.status, 200);
|
||||||
|
const tokens = await tokRes.json();
|
||||||
|
assert.equal(tokens.token_type, "Bearer");
|
||||||
|
|
||||||
|
// Replay rejected
|
||||||
|
const replayRes = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code: authCode,
|
||||||
|
client_id: clientId,
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
code_verifier: verifier,
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(replayRes.status, 400);
|
||||||
|
|
||||||
|
// Non-rotating refresh token
|
||||||
|
const refRes = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "refresh_token",
|
||||||
|
refresh_token: tokens.refresh_token,
|
||||||
|
client_id: clientId,
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(refRes.status, 200);
|
||||||
|
const refreshed = await refRes.json();
|
||||||
|
assert.equal(refreshed.refresh_token, tokens.refresh_token);
|
||||||
|
assert.notEqual(refreshed.access_token, tokens.access_token);
|
||||||
|
|
||||||
|
// Static Dual-Auth still works
|
||||||
|
const staticRes = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${process.env.AURA_API_KEY}`,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
id: 12,
|
||||||
|
method: "tools/call",
|
||||||
|
params: { name: "get_balance", arguments: { courier: "steadfast" } },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(staticRes.status, 200);
|
||||||
|
|
||||||
|
// Revocation
|
||||||
|
const revRes = await fetch(`${baseUrl}/oauth/revoke`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({ token: tokens.access_token }).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(revRes.status, 200);
|
||||||
|
|
||||||
|
const afterRev = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${tokens.access_token}`,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
id: 13,
|
||||||
|
method: "tools/call",
|
||||||
|
params: { name: "get_balance", arguments: { courier: "steadfast" } },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(afterRev.status, 401);
|
||||||
|
assert.ok((afterRev.headers.get("www-authenticate") || "").includes('error="invalid_token"'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 7: 1-Click Read-Only Sandbox strictly limits scope to read without exposing any raw API key", async () => {
|
||||||
|
const redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-sandbox";
|
||||||
|
const { verifier, challenge } = makePkcePair();
|
||||||
|
|
||||||
|
const authUrl = new URL(`${baseUrl}/oauth/authorize`);
|
||||||
|
authUrl.searchParams.set("response_type", "code");
|
||||||
|
authUrl.searchParams.set("client_id", "gemini-sandbox");
|
||||||
|
authUrl.searchParams.set("redirect_uri", redirectUri);
|
||||||
|
authUrl.searchParams.set("scope", "read write");
|
||||||
|
authUrl.searchParams.set("state", "st_sbx");
|
||||||
|
authUrl.searchParams.set("code_challenge", challenge);
|
||||||
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
||||||
|
|
||||||
|
const consentHtml = await (await fetch(authUrl.toString())).text();
|
||||||
|
const csrfToken = extractHiddenInput(consentHtml, "csrf_token");
|
||||||
|
|
||||||
|
const approveRes = await fetch(`${baseUrl}/oauth/authorize`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
client_id: "gemini-sandbox",
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
state: "st_sbx",
|
||||||
|
scope: "read write",
|
||||||
|
code_challenge: challenge,
|
||||||
|
code_challenge_method: "S256",
|
||||||
|
csrf_token: csrfToken,
|
||||||
|
auth_mode: "sandbox",
|
||||||
|
decision: "sandbox",
|
||||||
|
}).toString(),
|
||||||
|
redirect: "manual",
|
||||||
|
});
|
||||||
|
assert.equal(approveRes.status, 302);
|
||||||
|
const code = new URL(approveRes.headers.get("location")).searchParams.get("code");
|
||||||
|
|
||||||
|
const tokRes = await fetch(`${baseUrl}/oauth/token`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||||
|
body: new URLSearchParams({
|
||||||
|
grant_type: "authorization_code",
|
||||||
|
code,
|
||||||
|
client_id: "gemini-sandbox",
|
||||||
|
redirect_uri: redirectUri,
|
||||||
|
code_verifier: verifier,
|
||||||
|
}).toString(),
|
||||||
|
});
|
||||||
|
assert.equal(tokRes.status, 200);
|
||||||
|
const tokens = await tokRes.json();
|
||||||
|
assert.equal(tokens.scope, "read");
|
||||||
|
|
||||||
|
const writeAttempt = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${tokens.access_token}`,
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: "2.0",
|
||||||
|
id: 14,
|
||||||
|
method: "tools/call",
|
||||||
|
params: { name: "create_parcel", arguments: { courier: "steadfast" } },
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
assert.equal(writeAttempt.status, 200);
|
||||||
|
const writeBody = await writeAttempt.json();
|
||||||
|
assert.equal(writeBody.result.isError, true);
|
||||||
|
assert.ok(writeBody.result.content[0].text.includes("Insufficient scope"));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("OAuth 8: Global Partner Directory Compliance (13 MCP tool annotations, claude.com/chatgpt/cursor/zapier/n8n DCR, and GET /terms)", async () => {
|
||||||
|
// 1. All 13 tools expose MCP 2025-03-26 annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)
|
||||||
|
const listRes = await fetch(`${baseUrl}/mcp`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ jsonrpc: "2.0", id: 80, method: "tools/list", params: {} }),
|
||||||
|
});
|
||||||
|
assert.equal(listRes.status, 200);
|
||||||
|
const tools = (await listRes.json()).result.tools;
|
||||||
|
assert.equal(tools.length, 13);
|
||||||
|
for (const t of tools) {
|
||||||
|
assert.ok(t.annotations && typeof t.annotations.title === "string", `missing title annotation on ${t.name}`);
|
||||||
|
assert.equal(typeof t.annotations.readOnlyHint, "boolean", `missing readOnlyHint on ${t.name}`);
|
||||||
|
assert.equal(typeof t.annotations.destructiveHint, "boolean", `missing destructiveHint on ${t.name}`);
|
||||||
|
assert.equal(typeof t.annotations.idempotentHint, "boolean", `missing idempotentHint on ${t.name}`);
|
||||||
|
assert.equal(typeof t.annotations.openWorldHint, "boolean", `missing openWorldHint on ${t.name}`);
|
||||||
|
}
|
||||||
|
const byName = Object.fromEntries(tools.map((t) => [t.name, t.annotations]));
|
||||||
|
assert.equal(byName.track_parcel.readOnlyHint, true);
|
||||||
|
assert.equal(byName.create_parcel.readOnlyHint, false);
|
||||||
|
assert.equal(byName.cancel_parcel.destructiveHint, true);
|
||||||
|
assert.equal(byName.resolve_ndr_issue.readOnlyHint, true);
|
||||||
|
|
||||||
|
// 2. Major AI partner callback URIs accepted via RFC 7591 DCR
|
||||||
|
const partnerCallbacks = [
|
||||||
|
"https://claude.com/api/mcp/auth_callback",
|
||||||
|
"https://claude.ai/api/mcp/auth_callback",
|
||||||
|
"https://chatgpt.com/connector_platform_oauth_redirect",
|
||||||
|
"https://cursor.com/oauth/callback",
|
||||||
|
"https://zapier.com/dashboard/auth/oauth/return/App123",
|
||||||
|
"https://my.n8n.cloud/rest/oauth2-credential/callback",
|
||||||
|
];
|
||||||
|
const regRes = await fetch(`${baseUrl}/oauth/register`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ client_name: "Global AI Directory Suite", redirect_uris: partnerCallbacks }),
|
||||||
|
});
|
||||||
|
assert.equal(regRes.status, 201);
|
||||||
|
|
||||||
|
// 3. Legal /terms & /privacy endpoints return 200 HTML
|
||||||
|
const termsRes = await fetch(`${baseUrl}/terms`);
|
||||||
|
assert.equal(termsRes.status, 200);
|
||||||
|
const termsHtml = await termsRes.text();
|
||||||
|
assert.ok(termsHtml.includes("Terms of Service"));
|
||||||
|
});
|
||||||
+3
-3
@@ -439,7 +439,7 @@ test("11. GET /health unauthenticated returns only { ok, version }; with admin t
|
|||||||
const adminBody = await adminRes.json();
|
const adminBody = await adminRes.json();
|
||||||
assert.equal(adminBody.ok, true);
|
assert.equal(adminBody.ok, true);
|
||||||
assert.equal(adminBody.version, expectedVersion);
|
assert.equal(adminBody.version, expectedVersion);
|
||||||
assert.equal(adminBody.tools_count, 12);
|
assert.equal(adminBody.tools_count, 13);
|
||||||
assert.ok(adminBody.performance);
|
assert.ok(adminBody.performance);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -811,7 +811,7 @@ test("24. Upstream Cancellation: Steadfast cancelParcel handles already-cancelle
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test("25. AI Connector: Unauthenticated tools/list discovery succeeds and lists 12 tools", async () => {
|
test("25. AI Connector: Unauthenticated tools/list discovery succeeds and lists 13 tools", async () => {
|
||||||
const res = await fetch(`${baseUrl}/mcp`, {
|
const res = await fetch(`${baseUrl}/mcp`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
@@ -821,5 +821,5 @@ test("25. AI Connector: Unauthenticated tools/list discovery succeeds and lists
|
|||||||
const body = await res.json();
|
const body = await res.json();
|
||||||
assert.equal(body.jsonrpc, "2.0");
|
assert.equal(body.jsonrpc, "2.0");
|
||||||
assert.ok(Array.isArray(body.result.tools));
|
assert.ok(Array.isArray(body.result.tools));
|
||||||
assert.equal(body.result.tools.length, 12);
|
assert.equal(body.result.tools.length, 13);
|
||||||
});
|
});
|
||||||
|
|||||||
+60
-9
@@ -41,9 +41,12 @@ async function validateManifest() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(json.$schema === 'https://antigravity.google/schemas/v1/plugin.json', 'plugin.json declares official Antigravity $schema');
|
||||||
assert(json.name === 'aura-courier', `name matches 'aura-courier' (got '${json.name}')`);
|
assert(json.name === 'aura-courier', `name matches 'aura-courier' (got '${json.name}')`);
|
||||||
assert(json.displayName === 'Aura Courier MCP', `displayName is 'Aura Courier MCP'`);
|
assert(json.displayName === 'Aura Courier MCP', `displayName is 'Aura Courier MCP'`);
|
||||||
assert(json.version === PKG_VERSION, `version matches package.json ('${PKG_VERSION}', got '${json.version}')`);
|
assert(json.version === PKG_VERSION, `version matches package.json ('${PKG_VERSION}', got '${json.version}')`);
|
||||||
|
assert(json.privacyPolicyUrl === 'https://courier.auraajenticai.cloud/privacy', 'privacyPolicyUrl is configured');
|
||||||
|
assert(json.termsOfServiceUrl === 'https://courier.auraajenticai.cloud/terms', 'termsOfServiceUrl is configured');
|
||||||
assert(json.category === 'Business / Logistics', `category is 'Business / Logistics'`);
|
assert(json.category === 'Business / Logistics', `category is 'Business / Logistics'`);
|
||||||
assert(typeof json.description === 'string' && json.description.length > 20, 'description is informative');
|
assert(typeof json.description === 'string' && json.description.length > 20, 'description is informative');
|
||||||
assert(json.logo === 'assets/logo.svg', `logo points to 'assets/logo.svg'`);
|
assert(json.logo === 'assets/logo.svg', `logo points to 'assets/logo.svg'`);
|
||||||
@@ -65,8 +68,7 @@ async function validateMcpConfig() {
|
|||||||
const content = fs.readFileSync(mcpConfigPath, 'utf8');
|
const content = fs.readFileSync(mcpConfigPath, 'utf8');
|
||||||
const json = JSON.parse(content);
|
const json = JSON.parse(content);
|
||||||
assert(json.mcpServers && json.mcpServers['aura-courier'], 'server aura-courier is declared');
|
assert(json.mcpServers && json.mcpServers['aura-courier'], 'server aura-courier is declared');
|
||||||
assert(json.mcpServers['aura-courier'].url === 'https://courier.auraajenticai.cloud/mcp', 'remote MCP endpoint is https://courier.auraajenticai.cloud/mcp');
|
assert(json.mcpServers['aura-courier'].serverUrl === 'https://courier.auraajenticai.cloud/mcp', 'remote MCP serverUrl is https://courier.auraajenticai.cloud/mcp');
|
||||||
assert(json.mcpServers['aura-courier'].transport === 'streamable-http', 'transport is streamable-http');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function validateAssets() {
|
async function validateAssets() {
|
||||||
@@ -94,7 +96,11 @@ async function validateSkillsAndRules() {
|
|||||||
'validate_and_geocode_address',
|
'validate_and_geocode_address',
|
||||||
'calculate_delivery_zone_and_fee',
|
'calculate_delivery_zone_and_fee',
|
||||||
'compare_courier_rates',
|
'compare_courier_rates',
|
||||||
'resolve_ndr_issue'
|
'resolve_ndr_issue',
|
||||||
|
'cancel_parcel',
|
||||||
|
'update_parcel',
|
||||||
|
'bulk_create_parcels',
|
||||||
|
'get_webhook_events'
|
||||||
];
|
];
|
||||||
for (const tool of expectedTools) {
|
for (const tool of expectedTools) {
|
||||||
assert(skillContent.includes(`\`${tool}\``), `skill documents tool '${tool}'`);
|
assert(skillContent.includes(`\`${tool}\``), `skill documents tool '${tool}'`);
|
||||||
@@ -112,28 +118,65 @@ async function validateSkillsAndRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function validateRemoteMcpServer() {
|
async function validateRemoteMcpServer() {
|
||||||
console.log('\n--- 5. Validating Live Remote MCP Handshake & Tools ---');
|
console.log('\n--- 5. Validating Live Remote MCP OAuth 2.1 Discovery, Handshake & 13 Tools ---');
|
||||||
const endpoint = 'https://courier.auraajenticai.cloud/mcp';
|
const baseOrigin = 'https://courier.auraajenticai.cloud';
|
||||||
|
const endpoint = `${baseOrigin}/mcp`;
|
||||||
|
const authToken = process.env.AURA_API_KEY || 'aura_ro_public_inspector_2026';
|
||||||
try {
|
try {
|
||||||
const initRes = await fetch(endpoint, {
|
// 5a. RFC 9728 Protected Resource Metadata & RFC 8414 Authorization Server Metadata
|
||||||
|
const prmRes = await fetch(`${baseOrigin}/.well-known/oauth-protected-resource`);
|
||||||
|
assert(prmRes.status === 200, `RFC 9728 /.well-known/oauth-protected-resource returned HTTP 200 (got ${prmRes.status})`);
|
||||||
|
const prmData = await prmRes.json();
|
||||||
|
assert(prmData.resource === endpoint, `protected resource matches ${endpoint}`);
|
||||||
|
|
||||||
|
const asmRes = await fetch(`${baseOrigin}/.well-known/oauth-authorization-server`);
|
||||||
|
assert(asmRes.status === 200, `RFC 8414 /.well-known/oauth-authorization-server returned HTTP 200 (got ${asmRes.status})`);
|
||||||
|
const asmData = await asmRes.json();
|
||||||
|
assert(Array.isArray(asmData.code_challenge_methods_supported) && asmData.code_challenge_methods_supported.includes('S256'), 'OAuth 2.1 PKCE S256 advertised');
|
||||||
|
|
||||||
|
// 5b. Unauthenticated initialize returns 401 + WWW-Authenticate challenge
|
||||||
|
const unauthRes = await fetch(endpoint, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json, text/event-stream'
|
'Accept': 'application/json, text/event-stream'
|
||||||
},
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
jsonrpc: '2.0',
|
||||||
|
id: 0,
|
||||||
|
method: 'initialize',
|
||||||
|
params: {
|
||||||
|
protocolVersion: '2025-03-26',
|
||||||
|
capabilities: {},
|
||||||
|
clientInfo: { name: 'antigravity-validator', version: PKG_VERSION }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
assert(unauthRes.status === 401, `unauthenticated initialize returns HTTP 401 OAuth challenge (got ${unauthRes.status})`);
|
||||||
|
const wwwAuth = unauthRes.headers.get('www-authenticate') || '';
|
||||||
|
assert(wwwAuth.includes('resource_metadata='), '401 includes RFC 9728 WWW-Authenticate resource_metadata header');
|
||||||
|
|
||||||
|
// 5c. Authenticated initialize handshake + 13 live tools
|
||||||
|
const initRes = await fetch(endpoint, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Accept': 'application/json, text/event-stream',
|
||||||
|
'Authorization': `Bearer ${authToken}`
|
||||||
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id: 1,
|
id: 1,
|
||||||
method: 'initialize',
|
method: 'initialize',
|
||||||
params: {
|
params: {
|
||||||
protocolVersion: '2024-11-05',
|
protocolVersion: '2025-03-26',
|
||||||
capabilities: {},
|
capabilities: {},
|
||||||
clientInfo: { name: 'antigravity-validator', version: PKG_VERSION }
|
clientInfo: { name: 'antigravity-validator', version: PKG_VERSION }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
assert(initRes.status === 200, `initialize endpoint returned HTTP 200 (got ${initRes.status})`);
|
assert(initRes.status === 200, `authenticated initialize endpoint returned HTTP 200 (got ${initRes.status})`);
|
||||||
const sessionId = initRes.headers.get('mcp-session-id');
|
const sessionId = initRes.headers.get('mcp-session-id');
|
||||||
assert(!!sessionId, `mcp-session-id header received: ${sessionId}`);
|
assert(!!sessionId, `mcp-session-id header received: ${sessionId}`);
|
||||||
|
|
||||||
@@ -145,6 +188,7 @@ async function validateRemoteMcpServer() {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json, text/event-stream',
|
'Accept': 'application/json, text/event-stream',
|
||||||
|
'Authorization': `Bearer ${authToken}`,
|
||||||
'mcp-session-id': sessionId
|
'mcp-session-id': sessionId
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -158,7 +202,14 @@ async function validateRemoteMcpServer() {
|
|||||||
assert(toolsRes.status === 200, `tools/list returned HTTP 200`);
|
assert(toolsRes.status === 200, `tools/list returned HTTP 200`);
|
||||||
const toolsData = await toolsRes.json();
|
const toolsData = await toolsRes.json();
|
||||||
const liveTools = toolsData.result?.tools || [];
|
const liveTools = toolsData.result?.tools || [];
|
||||||
assert(liveTools.length === 9, `exactly 9 tools returned by remote server (got ${liveTools.length})`);
|
assert(liveTools.length === 13, `exactly 13 tools returned by remote server (got ${liveTools.length})`);
|
||||||
|
const allAnnotated = liveTools.every(t => t.annotations && typeof t.annotations.readOnlyHint === 'boolean' && typeof t.annotations.destructiveHint === 'boolean');
|
||||||
|
assert(allAnnotated, 'all 13 live tools expose MCP readOnlyHint & destructiveHint annotations');
|
||||||
|
|
||||||
|
const termsRes = await fetch(`${baseOrigin}/terms`);
|
||||||
|
assert(termsRes.status === 200, `Terms of Service /terms returned HTTP 200 (got ${termsRes.status})`);
|
||||||
|
const privRes = await fetch(`${baseOrigin}/privacy`);
|
||||||
|
assert(privRes.status === 200, `Privacy Policy /privacy returned HTTP 200 (got ${privRes.status})`);
|
||||||
|
|
||||||
const liveToolNames = liveTools.map(t => t.name);
|
const liveToolNames = liveTools.map(t => t.name);
|
||||||
console.log(` Live tools on server: [ ${liveToolNames.join(', ')} ]`);
|
console.log(` Live tools on server: [ ${liveToolNames.join(', ')} ]`);
|
||||||
|
|||||||
Reference in New Issue
Block a user