chore(release): v2.7.0 — Silicon Valley OAuth 2.1 + Aura SSO/Google Sign-In, Antigravity Plugin & Glama parity

This commit is contained in:
Amirul Islam Redwan71
2026-11-24 05:05:07 +06:00
parent eeba92042c
commit 8aa306bf63
21 changed files with 1534 additions and 723 deletions
+11
View File
@@ -1,5 +1,16 @@
# Changelog # Changelog
## [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
+7 -4
View File
@@ -1,10 +1,10 @@
# 🚚 AURA COURIER MCP v2.6.1 — THE ENTERPRISE LOGISTICS MASTER MANUAL # 🚚 AURA COURIER MCP v2.7.0 — 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**
[![Google Cloud Partner Advantage](https://img.shields.io/badge/Google_Cloud_Partner-Aura_Ajentic_AI-4285F4?logo=google-cloud&logoColor=white)](https://cloud.google.com/find-a-partner/partner/aura-ajentic-ai) [![Google Cloud Partner Advantage](https://img.shields.io/badge/Google_Cloud_Partner-Aura_Ajentic_AI-4285F4?logo=google-cloud&logoColor=white)](https://cloud.google.com/find-a-partner/partner/aura-ajentic-ai)
[![auraajenticai/aura-courier-mcp MCP server](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp/badges/score.svg)](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp) [![auraajenticai/aura-courier-mcp MCP server](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp/badges/score.svg)](https://glama.ai/mcp/servers/auraajenticai/aura-courier-mcp)
[![Antigravity Plugin](https://img.shields.io/badge/Antigravity_Plugin-v2.6.1-0676FF?logo=google&logoColor=white)](plugin.json) [![Antigravity Plugin](https://img.shields.io/badge/Antigravity_Plugin-v2.7.0-0676FF?logo=google&logoColor=white)](plugin.json)
[![User Guide BN/EN](https://img.shields.io/badge/User_Guide-বাংলা_%26_English-f59e0b)](https://courier.auraajenticai.cloud/guide) [![User Guide BN/EN](https://img.shields.io/badge/User_Guide-বাংলা_%26_English-f59e0b)](https://courier.auraajenticai.cloud/guide)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Status](https://img.shields.io/badge/Status-Production%20Active-success.svg)](https://courier.auraajenticai.cloud) [![Status](https://img.shields.io/badge/Status-Production%20Active-success.svg)](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.0"
} }
``` ```
@@ -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.0"],
"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,9 @@ 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.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
View File
@@ -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.0`
--- ---
+1 -1
View File
@@ -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.0"],
"env": { "env": {
"PORT": "8080" "PORT": "8080"
} }
+1 -1
View File
@@ -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.0"]
} }
} }
} }
+614 -278
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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.0";
} }
export const APP_VERSION = readPackageVersion(); export const APP_VERSION = readPackageVersion();
+2 -2
View File
@@ -1605,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.0</span>
</div> </div>
</div> </div>
<p class="footer-tagline"> <p class="footer-tagline">
@@ -1657,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.0)</span>
</a> </a>
</li> </li>
</ul> </ul>
+2 -2
View File
@@ -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.0 · 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.0 · 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>
+7 -7
View File
@@ -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.0 — 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" />
@@ -1201,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.0</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>
@@ -2046,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.0</span>
</div> </div>
</div> </div>
<p class="footer-tagline"> <p class="footer-tagline">
@@ -2098,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.0)</span>
</a> </a>
</li> </li>
</ul> </ul>
@@ -2176,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.0"></script>
<script> <script>
if (typeof initCourierCanvas === 'function') { if (typeof initCourierCanvas === 'function') {
initCourierCanvas('hubmap'); initCourierCanvas('hubmap');
@@ -3210,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.0'} · ${ms}ms)</span>`;
} }
const sbStatus = document.querySelector('.sandbox-status'); const sbStatus = document.querySelector('.sandbox-status');
if (sbStatus) { if (sbStatus) {
@@ -3220,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.0)</span>`;
} }
}); });
} }
+2 -2
View File
@@ -361,7 +361,7 @@
"capabilities": {}, "capabilities": {},
"clientInfo": { "clientInfo": {
"name": "Aura-Playground", "name": "Aura-Playground",
"version": "2.6.1" "version": "2.7.0"
} }
} }
}</textarea> }</textarea>
@@ -452,7 +452,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.0 · 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>
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "aura-courier-mcp", "name": "aura-courier-mcp",
"version": "2.6.1", "version": "2.7.0",
"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.0",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.12.0", "@modelcontextprotocol/sdk": "^1.12.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "aura-courier-mcp", "name": "aura-courier-mcp",
"version": "2.6.1", "version": "2.7.0",
"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",
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"name": "aura-courier", "name": "aura-courier",
"displayName": "Aura Courier MCP", "displayName": "Aura Courier MCP",
"version": "2.6.1", "version": "2.7.0",
"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",
@@ -44,7 +44,7 @@
"aura-courier": { "aura-courier": {
"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
View File
@@ -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.0 · 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> ·
+2 -2
View File
@@ -3,7 +3,7 @@
"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.0",
"websiteUrl": "https://github.com/auraajenticai/aura-courier-mcp", "websiteUrl": "https://github.com/auraajenticai/aura-courier-mcp",
"repository": { "repository": {
"url": "https://github.com/auraajenticai/aura-courier-mcp", "url": "https://github.com/auraajenticai/aura-courier-mcp",
@@ -13,7 +13,7 @@
{ {
"registryType": "npm", "registryType": "npm",
"identifier": "aura-courier-mcp", "identifier": "aura-courier-mcp",
"version": "2.6.1", "version": "2.7.0",
"transport": { "transport": {
"type": "stdio" "type": "stdio"
}, },
+2 -2
View File
@@ -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.0</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.0)</span>
</a> </a>
</li> </li>
</ul> </ul>
+637 -283
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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.0";
} }
export const APP_VERSION: string = readPackageVersion(); export const APP_VERSION: string = readPackageVersion();
+193 -124
View File
@@ -1,11 +1,12 @@
import test from "node:test"; import test from "node:test";
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import http from "node:http"; import http from "node:http";
import { createHash, randomBytes } from "node:crypto"; import { createHash, createHmac, randomBytes } from "node:crypto";
process.env.NODE_ENV = "test"; process.env.NODE_ENV = "test";
process.env.AURA_API_KEY = "aura_test_master_key_oauth21"; process.env.AURA_API_KEY = "aura_test_master_key_oauth21";
process.env.AURA_READONLY_KEY = "aura_ro_test_reader_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_API_KEY = "sf_test_key";
process.env.STEADFAST_SECRET_KEY = "sf_test_secret"; process.env.STEADFAST_SECRET_KEY = "sf_test_secret";
@@ -30,6 +31,21 @@ function makePkcePair() {
return { verifier, challenge }; 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) { function extractHiddenInput(html, name) {
const re = new RegExp(`name="${name}"\\s+value="([^"]*)"`, "i"); const re = new RegExp(`name="${name}"\\s+value="([^"]*)"`, "i");
const m = html.match(re); const m = html.match(re);
@@ -49,7 +65,7 @@ test.after(async () => {
} }
}); });
test("OAuth 1: 401 on unauthenticated POST /mcp (initialize & tools/call) and GET /mcp includes RFC 9728 WWW-Authenticate header", async () => { 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`, { const initRes = await fetch(`${baseUrl}/mcp`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
@@ -103,7 +119,7 @@ test("OAuth 3: RFC 7591 Dynamic Client Registration allows Google googleusercont
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ body: JSON.stringify({
client_name: "Google Gemini MCP", client_name: "Google Gemini",
redirect_uris: ["https://oauth-redirect.googleusercontent.com/r/gemini-aura-test"], redirect_uris: ["https://oauth-redirect.googleusercontent.com/r/gemini-aura-test"],
token_endpoint_auth_method: "none", token_endpoint_auth_method: "none",
}), }),
@@ -126,7 +142,117 @@ test("OAuth 3: RFC 7591 Dynamic Client Registration allows Google googleusercont
assert.equal(badBody.error, "invalid_redirect_uri"); assert.equal(badBody.error, "invalid_redirect_uri");
}); });
test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rotating Refresh -> Static Dual-Auth -> Revocation", async () => { 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 redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-live-flow";
const regRes = await fetch(`${baseUrl}/oauth/register`, { const regRes = await fetch(`${baseUrl}/oauth/register`, {
method: "POST", method: "POST",
@@ -143,7 +269,6 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
const { verifier, challenge } = makePkcePair(); const { verifier, challenge } = makePkcePair();
const state = "gemini_state_xyz_991"; const state = "gemini_state_xyz_991";
// Step 4a: GET /oauth/authorize consent screen
const authUrl = new URL(`${baseUrl}/oauth/authorize`); const authUrl = new URL(`${baseUrl}/oauth/authorize`);
authUrl.searchParams.set("response_type", "code"); authUrl.searchParams.set("response_type", "code");
authUrl.searchParams.set("client_id", clientId); authUrl.searchParams.set("client_id", clientId);
@@ -153,85 +278,73 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
authUrl.searchParams.set("code_challenge", challenge); authUrl.searchParams.set("code_challenge", challenge);
authUrl.searchParams.set("code_challenge_method", "S256"); authUrl.searchParams.set("code_challenge_method", "S256");
const consentRes = await fetch(authUrl.toString()); const consentHtml = await (await fetch(authUrl.toString())).text();
assert.equal(consentRes.status, 200);
const consentHtml = await consentRes.text();
assert.ok(consentHtml.includes("Google Gemini"));
assert.ok(consentHtml.includes("oauth-redirect.googleusercontent.com"));
const csrfToken = extractHiddenInput(consentHtml, "csrf_token"); const csrfToken = extractHiddenInput(consentHtml, "csrf_token");
assert.ok(csrfToken.length > 10);
// Step 4b: Deny redirects with error=access_denied // Deny -> error=access_denied
const denyForm = new URLSearchParams({
client_id: clientId,
redirect_uri: redirectUri,
state,
scope: "read write",
code_challenge: challenge,
code_challenge_method: "S256",
csrf_token: csrfToken,
decision: "deny",
});
const denyRes = await fetch(`${baseUrl}/oauth/authorize`, { const denyRes = await fetch(`${baseUrl}/oauth/authorize`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: denyForm.toString(), 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", redirect: "manual",
}); });
assert.equal(denyRes.status, 302); assert.equal(denyRes.status, 302);
const denyLoc = new URL(denyRes.headers.get("location")); assert.equal(new URL(denyRes.headers.get("location")).searchParams.get("error"), "access_denied");
assert.equal(denyLoc.searchParams.get("error"), "access_denied");
assert.equal(denyLoc.searchParams.get("state"), state);
// Step 4c: Invalid API key stays on consent form with error message // Invalid API key stays on form with clean error
const badKeyForm = new URLSearchParams({
client_id: clientId,
redirect_uri: redirectUri,
state,
scope: "read write",
code_challenge: challenge,
code_challenge_method: "S256",
csrf_token: csrfToken,
decision: "approve",
api_key: "totally_wrong_key_123",
});
const badKeyRes = await fetch(`${baseUrl}/oauth/authorize`, { const badKeyRes = await fetch(`${baseUrl}/oauth/authorize`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: badKeyForm.toString(), 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", redirect: "manual",
}); });
assert.equal(badKeyRes.status, 200); assert.equal(badKeyRes.status, 200);
const badKeyHtml = await badKeyRes.text(); assert.ok((await badKeyRes.text()).includes("Invalid API key"));
assert.ok(badKeyHtml.includes("Invalid API Key"));
// Step 4d: Valid Master Key redirects 302 with single-use authorization code // Valid API key -> 302 with code
const okForm = new URLSearchParams({
client_id: clientId,
redirect_uri: redirectUri,
state,
scope: "read write",
code_challenge: challenge,
code_challenge_method: "S256",
csrf_token: csrfToken,
decision: "approve",
api_key: process.env.AURA_API_KEY,
});
const approveRes = await fetch(`${baseUrl}/oauth/authorize`, { const approveRes = await fetch(`${baseUrl}/oauth/authorize`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: okForm.toString(), 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", redirect: "manual",
}); });
assert.equal(approveRes.status, 302); assert.equal(approveRes.status, 302);
const cbUrl = new URL(approveRes.headers.get("location")); const authCode = new URL(approveRes.headers.get("location")).searchParams.get("code");
assert.equal(cbUrl.origin + cbUrl.pathname, redirectUri);
assert.equal(cbUrl.searchParams.get("state"), state);
const authCode = cbUrl.searchParams.get("code");
assert.ok(authCode && authCode.split(".").length === 3);
// Step 4e: Wrong PKCE code_verifier is rejected // Wrong PKCE rejected
const wrongPkceRes = await fetch(`${baseUrl}/oauth/token`, { const wrongPkce = await fetch(`${baseUrl}/oauth/token`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({ body: new URLSearchParams({
@@ -242,10 +355,9 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
code_verifier: "wrong_verifier_abcdefghijklmnopqrstuvwxyz_0123456789", code_verifier: "wrong_verifier_abcdefghijklmnopqrstuvwxyz_0123456789",
}).toString(), }).toString(),
}); });
assert.equal(wrongPkceRes.status, 400); assert.equal(wrongPkce.status, 400);
assert.equal((await wrongPkceRes.json()).error, "invalid_grant");
// Step 4f: Correct PKCE code_verifier issues access_token + refresh_token // Correct PKCE -> tokens
const tokRes = await fetch(`${baseUrl}/oauth/token`, { const tokRes = await fetch(`${baseUrl}/oauth/token`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
@@ -260,12 +372,8 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
assert.equal(tokRes.status, 200); assert.equal(tokRes.status, 200);
const tokens = await tokRes.json(); const tokens = await tokRes.json();
assert.equal(tokens.token_type, "Bearer"); assert.equal(tokens.token_type, "Bearer");
assert.equal(tokens.expires_in, 3600);
assert.ok(tokens.access_token && tokens.access_token.startsWith("eyJ"));
assert.ok(tokens.refresh_token && tokens.refresh_token.startsWith("eyJ"));
assert.equal(tokens.scope, "read write");
// Step 4g: Authorization code replay is rejected // Replay rejected
const replayRes = await fetch(`${baseUrl}/oauth/token`, { const replayRes = await fetch(`${baseUrl}/oauth/token`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
@@ -278,48 +386,9 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
}).toString(), }).toString(),
}); });
assert.equal(replayRes.status, 400); assert.equal(replayRes.status, 400);
assert.equal((await replayRes.json()).error, "invalid_grant");
// Step 4h: Call /mcp initialize & tools/call with OAuth Bearer token // Non-rotating refresh token
const mcpInit = await fetch(`${baseUrl}/mcp`, { const refRes = await fetch(`${baseUrl}/oauth/token`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
Authorization: `Bearer ${tokens.access_token}`,
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 10,
method: "initialize",
params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "Google Gemini", version: "1.0" } },
}),
});
assert.equal(mcpInit.status, 200);
assert.ok(mcpInit.headers.get("mcp-session-id"));
const mcpCall = await fetch(`${baseUrl}/mcp`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
Authorization: `Bearer ${tokens.access_token}`,
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 11,
method: "tools/call",
params: { name: "get_balance", arguments: { courier: "steadfast" } },
}),
});
assert.equal(mcpCall.status, 200);
const mcpBody = await mcpCall.json();
assert.equal(mcpBody.result.isError, false);
const env = JSON.parse(mcpBody.result.content[0].text);
assert.equal(env.data.amount_bdt, 14250);
// Step 4i: Refresh token returns fresh access_token AND keeps refresh_token NON-ROTATING for Gemini
const refreshRes = await fetch(`${baseUrl}/oauth/token`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({ body: new URLSearchParams({
@@ -328,12 +397,12 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
client_id: clientId, client_id: clientId,
}).toString(), }).toString(),
}); });
assert.equal(refreshRes.status, 200); assert.equal(refRes.status, 200);
const refreshed = await refreshRes.json(); const refreshed = await refRes.json();
assert.ok(refreshed.access_token && refreshed.access_token !== tokens.access_token);
assert.equal(refreshed.refresh_token, tokens.refresh_token); assert.equal(refreshed.refresh_token, tokens.refresh_token);
assert.notEqual(refreshed.access_token, tokens.access_token);
// Step 4j: Existing static Bearer API Key still works identically (Dual-Auth) // Static Dual-Auth still works
const staticRes = await fetch(`${baseUrl}/mcp`, { const staticRes = await fetch(`${baseUrl}/mcp`, {
method: "POST", method: "POST",
headers: { headers: {
@@ -349,7 +418,7 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
}); });
assert.equal(staticRes.status, 200); assert.equal(staticRes.status, 200);
// Step 4k: Revoke OAuth access_token -> subsequent /mcp returns 401 with error="invalid_token" // Revocation
const revRes = await fetch(`${baseUrl}/oauth/revoke`, { const revRes = await fetch(`${baseUrl}/oauth/revoke`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
@@ -374,16 +443,16 @@ test("OAuth 4: End-to-End Gemini PKCE S256 flow -> OAuth Bearer /mcp -> Non-Rota
assert.ok((afterRev.headers.get("www-authenticate") || "").includes('error="invalid_token"')); assert.ok((afterRev.headers.get("www-authenticate") || "").includes('error="invalid_token"'));
}); });
test("OAuth 5: Read-Only key authorization strictly limits OAuth JWT to read scope", async () => { 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-ro-check"; const redirectUri = "https://oauth-redirect.googleusercontent.com/r/gemini-sandbox";
const { verifier, challenge } = makePkcePair(); const { verifier, challenge } = makePkcePair();
const authUrl = new URL(`${baseUrl}/oauth/authorize`); const authUrl = new URL(`${baseUrl}/oauth/authorize`);
authUrl.searchParams.set("response_type", "code"); authUrl.searchParams.set("response_type", "code");
authUrl.searchParams.set("client_id", "gemini-ro-client"); authUrl.searchParams.set("client_id", "gemini-sandbox");
authUrl.searchParams.set("redirect_uri", redirectUri); authUrl.searchParams.set("redirect_uri", redirectUri);
authUrl.searchParams.set("scope", "read write"); authUrl.searchParams.set("scope", "read write");
authUrl.searchParams.set("state", "st_ro"); authUrl.searchParams.set("state", "st_sbx");
authUrl.searchParams.set("code_challenge", challenge); authUrl.searchParams.set("code_challenge", challenge);
authUrl.searchParams.set("code_challenge_method", "S256"); authUrl.searchParams.set("code_challenge_method", "S256");
@@ -394,15 +463,15 @@ test("OAuth 5: Read-Only key authorization strictly limits OAuth JWT to read sco
method: "POST", method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" }, headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({ body: new URLSearchParams({
client_id: "gemini-ro-client", client_id: "gemini-sandbox",
redirect_uri: redirectUri, redirect_uri: redirectUri,
state: "st_ro", state: "st_sbx",
scope: "read write", scope: "read write",
code_challenge: challenge, code_challenge: challenge,
code_challenge_method: "S256", code_challenge_method: "S256",
csrf_token: csrfToken, csrf_token: csrfToken,
decision: "approve", auth_mode: "sandbox",
api_key: process.env.AURA_READONLY_KEY, decision: "sandbox",
}).toString(), }).toString(),
redirect: "manual", redirect: "manual",
}); });
@@ -415,7 +484,7 @@ test("OAuth 5: Read-Only key authorization strictly limits OAuth JWT to read sco
body: new URLSearchParams({ body: new URLSearchParams({
grant_type: "authorization_code", grant_type: "authorization_code",
code, code,
client_id: "gemini-ro-client", client_id: "gemini-sandbox",
redirect_uri: redirectUri, redirect_uri: redirectUri,
code_verifier: verifier, code_verifier: verifier,
}).toString(), }).toString(),
+44 -6
View File
@@ -112,28 +112,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 +182,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 +196,7 @@ 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 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(', ')} ]`);