Skip to content

Commit cd23582

Browse files
authored
Overhaul docs tabs: Overview, Testing, App Framework, MCP Apps (#45)
* Overhaul docs site tabs: Overview, MCP Testing Framework, MCP App Framework, MCP Apps Restructure the documentation website from three tabs (Documentation, API Reference, MCP Apps) to four tabs that cleanly separate the testing framework from the app framework. Rename api-reference/ to app-framework/, split testing content into dedicated pages, move guides and framework details to their respective tabs, add CLI groups per tab, and add 85 redirects to preserve all old URLs. * List unit tests first across testing docs * Use consistent test type ordering: Unit, E2E, Visual, Live, Evals * Fix validate script: update hook doc path from api-reference to app-framework
1 parent d493480 commit cd23582

123 files changed

Lines changed: 1456 additions & 1102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The `uri` is generated using the resource name and a build timestamp for cache i
8080

8181
## App Identity
8282

83-
Each built resource is wrapped in an [`AppProvider`](/api-reference/components/app-provider) that identifies the app to the host during the `ui/initialize` handshake. The `name` and `version` are read from your project's `package.json`:
83+
Each built resource is wrapped in an [`AppProvider`](/app-framework/components/app-provider) that identifies the app to the host during the `ui/initialize` handshake. The `name` and `version` are read from your project's `package.json`:
8484

8585
```json
8686
{
@@ -125,10 +125,10 @@ sunpeak build
125125
After building, start the production server or deploy:
126126

127127
<CardGroup cols={2}>
128-
<Card horizontal title="sunpeak start" icon="play" href="/api-reference/cli/start">
128+
<Card horizontal title="sunpeak start" icon="play" href="/app-framework/cli/start">
129129
Start the production MCP server.
130130
</Card>
131-
<Card horizontal title="Deployment Guide" icon="rocket" href="/guides/deployment">
131+
<Card horizontal title="Deployment Guide" icon="rocket" href="/app-framework/guides/deployment">
132132
Deploy your app to production.
133133
</Card>
134134
</CardGroup>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ Then connect the tunnel URL at the `/mcp` path (e.g., `https://your-subdomain.ng
179179
## Related Commands
180180

181181
<CardGroup cols={2}>
182-
<Card horizontal title="sunpeak build" icon="hammer" href="/api-reference/cli/build">
182+
<Card horizontal title="sunpeak build" icon="hammer" href="/app-framework/cli/build">
183183
Build resources and compile tools.
184184
</Card>
185-
<Card horizontal title="sunpeak start" icon="play" href="/api-reference/cli/start">
185+
<Card horizontal title="sunpeak start" icon="play" href="/app-framework/cli/start">
186186
Start the production MCP server.
187187
</Card>
188188
</CardGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ After creating your project:
9595
2. Start the dev server: `sunpeak dev`
9696
3. Open `http://localhost:3000` to see the inspector
9797

98-
<Card horizontal title="Project Scaffold" icon="folder-tree" href="/framework/project-scaffold">
98+
<Card horizontal title="Project Scaffold" icon="folder-tree" href="/app-framework/project-scaffold">
9999
Learn more about the project structure and available commands.
100100
</Card>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Tools are registered with the MCP protocol using `registerAppTool` from the MCP
3030
| `--host <address>` | | Bind address (default: `0.0.0.0`, also respects `HOST` env var) |
3131
| `--json-logs` | | Output structured JSON lines to stdout/stderr |
3232
| `--sse` | | Use SSE streaming instead of JSON responses (default: JSON) |
33-
| `--stateless` | | Stateless mode — no session tracking, fresh server per request. For serverless and horizontally-scaled deployments. See [Deployment Guide](/guides/deployment#serverless--edge-deployment). |
33+
| `--stateless` | | Stateless mode — no session tracking, fresh server per request. For serverless and horizontally-scaled deployments. See [Deployment Guide](/app-framework/guides/deployment#serverless--edge-deployment). |
3434

3535
## Usage
3636

@@ -64,7 +64,7 @@ The production server uses the MCP Streamable HTTP transport. In the default sta
6464

6565
## Authentication
6666

67-
If your project includes a `src/server.ts` with an `auth()` export, the production server calls it on every MCP request. See [Server Entry](/api-reference/tools/server-entry) for details.
67+
If your project includes a `src/server.ts` with an `auth()` export, the production server calls it on every MCP request. See [Server Entry](/app-framework/tools/server-entry) for details.
6868

6969
## Testing Locally
7070

@@ -79,16 +79,16 @@ Then expose the server with a tunnel (e.g., `ngrok http 8000`) and connect from
7979
## Related Commands
8080

8181
<CardGroup cols={2}>
82-
<Card horizontal title="sunpeak build" icon="hammer" href="/api-reference/cli/build">
82+
<Card horizontal title="sunpeak build" icon="hammer" href="/app-framework/cli/build">
8383
Build resources and compile tools.
8484
</Card>
85-
<Card horizontal title="Production Server API" icon="server" href="/api-reference/tools/production-server">
85+
<Card horizontal title="Production Server API" icon="server" href="/app-framework/tools/production-server">
8686
createMcpHandler, createHandler, and config types.
8787
</Card>
88-
<Card horizontal title="Deployment Guide" icon="rocket" href="/guides/deployment">
88+
<Card horizontal title="Deployment Guide" icon="rocket" href="/app-framework/guides/deployment">
8989
Full deployment walkthrough with custom server examples.
9090
</Card>
91-
<Card horizontal title="sunpeak dev" icon="code" href="/api-reference/cli/dev">
91+
<Card horizontal title="sunpeak dev" icon="code" href="/app-framework/cli/dev">
9292
Development server with inspector.
9393
</Card>
9494
</CardGroup>

docs/api-reference/components/app-provider.mdx renamed to docs/app-framework/components/app-provider.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { AppProvider } from 'sunpeak';
6868

6969
## AppState
7070

71-
The context value provided to child components via [`useApp`](/api-reference/hooks/use-app).
71+
The context value provided to child components via [`useApp`](/app-framework/hooks/use-app).
7272

7373
```tsx
7474
import type { AppState } from 'sunpeak';
@@ -94,6 +94,6 @@ import type { AppState } from 'sunpeak';
9494

9595
## Related
9696

97-
- [`useApp`](/api-reference/hooks/use-app) — Access the `App` instance from context
97+
- [`useApp`](/app-framework/hooks/use-app) — Access the `App` instance from context
9898
- [App class](/mcp-apps/app/app-class) — The underlying SDK class
9999
- [Lifecycle](/mcp-apps/lifecycle) — Connection and initialization flow
File renamed without changes.

docs/api-reference/functions/host-detection.mdx renamed to docs/app-framework/functions/host-detection.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,20 @@ function MyResource() {
116116

117117
## Inspector Behavior
118118

119-
In the [Inspector](/api-reference/simulations/inspector), host detection reflects the currently selected host:
119+
In the [Inspector](/testing/inspector), host detection reflects the currently selected host:
120120

121121
| Host selected | `isChatGPT()` | `isClaude()` | `detectHost()` |
122122
|---|---|---|---|
123123
| ChatGPT | `true` | `false` | `'chatgpt'` |
124124
| Claude | `false` | `false`* | `'unknown'`* |
125125

126-
\* Claude detection relies on user agent or hostname, which aren't present in the inspector. Use [`useHostContext()`](/api-reference/hooks/use-host-context) to read host identity from the MCP protocol instead.
126+
\* Claude detection relies on user agent or hostname, which aren't present in the inspector. Use [`useHostContext()`](/app-framework/hooks/use-host-context) to read host identity from the MCP protocol instead.
127127

128128
## See Also
129129

130-
<Card horizontal title="ChatGPT Hooks" icon="bolt" href="/api-reference/hooks/chatgpt-hooks">
130+
<Card horizontal title="ChatGPT Hooks" icon="bolt" href="/app-framework/hooks/chatgpt-hooks">
131131
Host-specific hooks for ChatGPT features.
132132
</Card>
133-
<Card horizontal title="useHostContext" icon="circle-info" href="/api-reference/hooks/use-host-context">
133+
<Card horizontal title="useHostContext" icon="circle-info" href="/app-framework/hooks/use-host-context">
134134
Read host identity and capabilities via the MCP protocol.
135135
</Card>

docs/api-reference/functions/utilities.mdx renamed to docs/app-framework/functions/utilities.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function InteractiveMap() {
107107
```
108108

109109
<Tip>
110-
For host-reported device capabilities, use [`useDeviceCapabilities`](/api-reference/hooks/use-device-capabilities) which reads the `touch` and `hover` values from the host context.
110+
For host-reported device capabilities, use [`useDeviceCapabilities`](/app-framework/hooks/use-device-capabilities) which reads the `touch` and `hover` values from the host context.
111111
</Tip>
112112

113113
---

docs/guides/authorization.mdx renamed to docs/app-framework/guides/authorization.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MCP Apps can protect tools behind OAuth-based authorization, as defined in the [
1111
- **Per-server authorization** — every MCP request requires a valid token. Simple when all tools are sensitive.
1212
- **Per-tool authorization** — only specific tools require authorization. Public tools work without a token, and the OAuth flow triggers only when the user calls a protected tool.
1313

14-
sunpeak supports both approaches through the [`src/server.ts`](/api-reference/tools/server-entry) auth export.
14+
sunpeak supports both approaches through the [`src/server.ts`](/app-framework/tools/server-entry) auth export.
1515

1616
## Server auth with `src/server.ts`
1717

@@ -80,7 +80,7 @@ export default async function (args: { accountId: string }, extra: ToolHandlerEx
8080
A powerful pattern: load the app with public data (no auth required), then trigger the OAuth flow only when the user performs a protected action.
8181

8282
1. A public tool loads the UI without authorization
83-
2. The user clicks a button that calls a protected tool via [`useCallServerTool`](/api-reference/hooks/use-call-server-tool)
83+
2. The user clicks a button that calls a protected tool via [`useCallServerTool`](/app-framework/hooks/use-call-server-tool)
8484
3. The host receives HTTP 401, automatically runs the OAuth flow
8585
4. After the user completes OAuth, the host retries the tool call with the token
8686
5. The protected data appears in the UI
@@ -122,7 +122,7 @@ The [MCP specification](https://modelcontextprotocol.io/specification/latest/bas
122122

123123
**Authorization Server Metadata** (`/.well-known/oauth-authorization-server`) — advertises authorization and token endpoints, supported scopes, and client registration support.
124124

125-
For custom server setups (using [`createMcpHandler`](/api-reference/tools/production-server)), you may need to implement these endpoints yourself. See the [MCP authorization spec](https://modelcontextprotocol.io/specification/latest/basic/authorization) for full requirements.
125+
For custom server setups (using [`createMcpHandler`](/app-framework/tools/production-server)), you may need to implement these endpoints yourself. See the [MCP authorization spec](https://modelcontextprotocol.io/specification/latest/basic/authorization) for full requirements.
126126

127127
## Token verification
128128

@@ -173,7 +173,7 @@ MCP servers must validate that tokens were issued specifically for them. See [To
173173

174174
## See also
175175

176-
<Card horizontal title="Server Entry" icon="lock" href="/api-reference/tools/server-entry">
176+
<Card horizontal title="Server Entry" icon="lock" href="/app-framework/tools/server-entry">
177177
The `src/server.ts` auth export and `AuthInfo` type reference.
178178
</Card>
179179
<Card horizontal title="MCP Auth Specification" icon="link" href="https://modelcontextprotocol.io/specification/latest/basic/authorization">
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Then expose the MCP server with a tunnel (e.g., `ngrok http 8000`) and connect f
6767

6868
For full control over the HTTP server (custom middleware, CORS, health checks, etc.), use `createMcpHandler` to mount the MCP protocol handler on your own server.
6969

70-
Unlike `sunpeak start` which auto-discovers from `dist/`, these handlers accept pre-loaded config objects — you load tools, resources, and auth yourself. See [Production Server API](/api-reference/tools/production-server) for config types.
70+
Unlike `sunpeak start` which auto-discovers from `dist/`, these handlers accept pre-loaded config objects — you load tools, resources, and auth yourself. See [Production Server API](/app-framework/tools/production-server) for config types.
7171

7272
```typescript
7373
import express from 'express';
@@ -154,10 +154,10 @@ const handler = createHandler({
154154

155155
For custom MCP clients that don't send identifiable headers, `detectClientFromHeaders` is exported from `sunpeak/mcp` so you can build your own detection logic in a custom handler.
156156

157-
Both `createMcpHandler` and `createHandler` use JSON responses by default (`enableJsonResponse: true`), which works reliably across all environments including serverless. If you need SSE streaming (e.g., for progress updates on long-running tool calls), set `enableJsonResponse: false` in your config. See [Production Server API](/api-reference/tools/production-server) for details.
157+
Both `createMcpHandler` and `createHandler` use JSON responses by default (`enableJsonResponse: true`), which works reliably across all environments including serverless. If you need SSE streaming (e.g., for progress updates on long-running tool calls), set `enableJsonResponse: false` in your config. See [Production Server API](/app-framework/tools/production-server) for details.
158158

159159
<Info>
160-
For fully custom MCP server setups, `sunpeak/mcp` also re-exports `registerAppTool`, `registerAppResource`, and `RESOURCE_MIME_TYPE` from the [MCP Apps SDK](https://github.com/anthropics/ext-apps). See [Server Helpers](/api-reference/simulations/run-mcp-server#server-helpers) for the full list.
160+
For fully custom MCP server setups, `sunpeak/mcp` also re-exports `registerAppTool`, `registerAppResource`, and `RESOURCE_MIME_TYPE` from the [MCP Apps SDK](https://github.com/anthropics/ext-apps). See [Server Helpers](/app-framework/run-mcp-server#server-helpers) for the full list.
161161
</Info>
162162

163163
## Production Operations
@@ -270,7 +270,7 @@ These are handled at the infrastructure layer, not by `sunpeak start`:
270270
- **Rate limiting** — Configure at the proxy or CDN level
271271
- **Request body limits** — Handled by the proxy or platform
272272

273-
For full control over the HTTP server (custom middleware, metrics, etc.), use [`createMcpHandler`](/api-reference/tools/production-server#createmcphandler) to mount the MCP handler on your own Express, Fastify, or http server.
273+
For full control over the HTTP server (custom middleware, metrics, etc.), use [`createMcpHandler`](/app-framework/tools/production-server#createmcphandler) to mount the MCP handler on your own Express, Fastify, or http server.
274274

275275
## Publish to ChatGPT
276276

0 commit comments

Comments
 (0)