Skip to content

Make "Try this route" work on every API docs page - #567

Merged
hugodemenez merged 1 commit into
betafrom
fix/docs-tryit-openapi-base
Oct 23, 2026
Merged

hugodemenez merged 1 commit into
betafrom
fix/docs-tryit-openapi-base

Conversation

@hugodemenez

@hugodemenez hugodemenez commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Base: beta

The docs pages use full paths like /api/v1/trades, but /openapi.json lists paths relative to its server URL (https://www.deltalytix.app/api), e.g. /v1/trades. The exact-match lookup in getOpenApiOperation never matched, so every try panel showed "This endpoint isn't in the live OpenAPI document" (FR: "Cet endpoint n’est pas disponible dans le document OpenAPI live").

Fix: the lookup also tries the path with the spec's server base path (/api) stripped. Requests still go to the full same-origin /api/... path. Adds unit tests.

/oauth/authorize is a browser redirect, not in the spec, and still shows no playground (expected).

Open in Web Open in Cursor 

Note

Low Risk
Docs-only lookup logic with unit tests; no change to how API requests are sent.

Reviewed by Cursor Bugbot for commit 2e84ea3. Configure here.

Docs pages use full /api paths while openapi.json paths are relative to the server URL. Strip that base so getOpenApiOperation finds the operation.

Co-authored-by: Hugo Demenez <hugodemenez@users.noreply.github.com>
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
deltalytix Ignored Ignored Oct 23, 2026 7:26pm UTC

@cursor

cursor Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 3256e522-93b7-4ef1-872d-57977275e5d1)

@hugodemenez
hugodemenez merged commit 8f24a23 into beta Oct 23, 2026
5 checks passed
hugodemenez added a commit that referenced this pull request Nov 1, 2026
## Summary

Promote beta to main so production gets the streamable HTTP MCP server
and one-click OAuth connect for Claude, ChatGPT, Cursor, and other MCP
clients.

### Shipping
- **MCP** (`#573`, `#577`): `POST /api/mcp` with OAuth DCR + PKCE; tools
bound to the token user; docs at `/docs/mcp` (EN + FR); `serverInfo` /
server-card icons so clients show the Deltalytix mark
- **OAuth consent**: “Use another account” link (`#564`)
- **Connections**: automatic daily end-of-day sync on by default for new
connections (`#563`)
- **API docs**: live “Try this route” on every page (`#567`); keep new
token visible until closed (`#568`); Try with Claude / ChatGPT / Grok
(`#571`, `#572`)
- **Rithmic**: stop mis-sizing split orders and duplicating stored
trades (`#569`)
- **Email**: release newsletter images under `public/email` (`#570`)

### Migrations
- `20261024160000_oauth_public_clients_and_audience`
- `20261024160100_oauth_registration_attempt_row_level_security`

### Notes
- Prod MCP was 404 before this; after merge, clients use
`https://www.deltalytix.app/api/mcp`
- Connection management / revocable tokens & apps already on main from
earlier work
- Hugh does not merge this — wait for Hugo

### Test plan
- [ ] Vercel prod deploy green; migrations applied
- [ ] `GET /.well-known/mcp/server-card.json` returns icons on
`www.deltalytix.app`
- [ ] Connect from Cursor / Claude custom connector / ChatGPT custom MCP
and call `list_trades`
- [ ] Consent screen shows Use another account; new connections default
to daily auto-sync

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **High Risk**
> Introduces a new authenticated data surface (MCP) and substantial
OAuth changes (public clients, audience-bound tokens, PKCE rules) on top
of shared read logic—any bug affects authorization and multi-tenant
isolation.
> 
> **Overview**
> Adds a **production MCP server** at `POST /api/mcp` (streamable HTTP,
stateless JSON-RPC) so AI clients can read the same trading data as
`/api/v1` via eight **read-only tools**, always scoped to the bearer
token’s user.
> 
> **OAuth & discovery** are extended for MCP connect flows: RFC 7591
**`POST /oauth/register`** (public clients, PKCE S256 required,
rate-limited), RFC 8707 **`resource`** audience binding to `/api/mcp`,
RFC 9207 **`iss`** on authorize redirects, and new
**`/.well-known/oauth-authorization-server`** plus **MCP
protected-resource** metadata. The **server card** now advertises
streamable HTTP, OAuth on that transport, and the real tool catalog.
OpenID discovery delegates to shared authorization-server metadata.
> 
> **REST handlers** are refactored to **`lib/api/v1/reads`** so MCP and
HTTP share one read path; auth rejects tokens whose **`resource`**
doesn’t match the request URL. Consent shows an **“Unverified app”**
badge for dynamically registered clients; redirect URI validation
**rejects wildcards**.
> 
> Docs (EN/FR MCP guides), OpenAPI `/mcp`, agent discovery, WebMCP
resources, and broad tests (including cross-tenant isolation) ship with
the feature. **`@modelcontextprotocol/sdk`** is added as a direct
dependency.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f09776b. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants