- /docs subpages canonicalized to /docs and had no descriptions; each now uses pageMetadata with its own path (was: Google could index at most one) - llms.txt claimed Team EUR 149, RBAC/SLA and BYO-cloud that do not exist; regenerated from lib/seo.ts truth + new llms-full.txt with docs content - sitemap stamped lastModified=now on every request; now real per-route dates from new lib/articles.ts registry (single source for guides index/sitemap/RSS) - new /feed.xml RSS 2.0 route + alternates link in root layout - articleJsonLd: image (per-guide opengraph-image via lib/og-article.tsx), Person author, wordCount; new breadcrumbJsonLd on guides + docs - GSC verification via NEXT_PUBLIC_GSC_VERIFICATION (documented in .env.example) - dropped fabricated Enterprise EUR 499 offer from SoftwareApplication JSON-LD - article-shell: OL/Table/Note primitives for upcoming articles Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXUwmPVRTD8AKQtio6gCN5
105 lines
4.0 KiB
TypeScript
105 lines
4.0 KiB
TypeScript
import {
|
|
DocsTitle,
|
|
DocsLead,
|
|
DocsH2,
|
|
DocsP,
|
|
DocsCode,
|
|
Mono,
|
|
} from '@/components/docs-page';
|
|
import { JsonLd } from '@/components/json-ld';
|
|
import { breadcrumbJsonLd, pageMetadata } from '@/lib/seo';
|
|
|
|
export const metadata = pageMetadata({
|
|
title: 'API reference',
|
|
description:
|
|
'REST API reference for the BuildMyMCPServer control plane — auth, server CRUD, build streaming, templates and the OAuth 2.1 endpoints.',
|
|
path: '/docs/api-reference',
|
|
});
|
|
|
|
export default function ApiReference() {
|
|
return (
|
|
<>
|
|
<JsonLd
|
|
data={breadcrumbJsonLd([
|
|
{ name: 'Home', path: '/' },
|
|
{ name: 'Docs', path: '/docs' },
|
|
{ name: 'API reference', path: '/docs/api-reference' },
|
|
])}
|
|
/>
|
|
<DocsTitle kicker="Reference">API reference</DocsTitle>
|
|
<DocsLead>
|
|
Every endpoint on the control plane. Authenticated routes use the session cookie set by
|
|
the magic-link verify call.
|
|
</DocsLead>
|
|
|
|
<DocsH2 id="auth">Auth</DocsH2>
|
|
<DocsP>
|
|
<Mono>POST /v1/auth/magic-link</Mono> — body <Mono>{`{"email":"…"}`}</Mono> — emails (or
|
|
prints in dev) a one-time link.
|
|
</DocsP>
|
|
<DocsP>
|
|
<Mono>POST /v1/auth/verify</Mono> — body <Mono>{`{"token":"…"}`}</Mono> — exchanges the
|
|
token for a session cookie.
|
|
</DocsP>
|
|
<DocsP><Mono>GET /v1/auth/me</Mono> — returns the current session user + org.</DocsP>
|
|
<DocsP><Mono>POST /v1/auth/logout</Mono> — destroys the session.</DocsP>
|
|
|
|
<DocsH2 id="servers">Servers</DocsH2>
|
|
<DocsP><Mono>GET /v1/servers</Mono> — list servers in the current org.</DocsP>
|
|
<DocsP>
|
|
<Mono>POST /v1/servers/preview</Mono> — body <Mono>{`{"prompt":"…"}`}</Mono> — runs Claude
|
|
synchronously, validates the spec, caches it, returns <Mono>{`{ previewId, source, spec }`}</Mono>.
|
|
</DocsP>
|
|
<DocsP>
|
|
<Mono>POST /v1/servers</Mono> — body <Mono>{`{name, slug, prompt, secrets, previewId?}`}</Mono>
|
|
— creates the server, queues the build, returns the server + build records.
|
|
</DocsP>
|
|
<DocsP>
|
|
<Mono>GET /v1/servers/:id</Mono> — server detail with the latest 10 build records.
|
|
</DocsP>
|
|
<DocsP>
|
|
<Mono>POST /v1/servers/:id/iterate</Mono> — body <Mono>{`{prompt, secrets}`}</Mono> —
|
|
queues a new version build.
|
|
</DocsP>
|
|
<DocsP><Mono>DELETE /v1/servers/:id</Mono> — removes the server and tears down the container.</DocsP>
|
|
|
|
<DocsH2 id="builds">Builds</DocsH2>
|
|
<DocsP>
|
|
<Mono>GET /v1/builds/:id</Mono> — build record + persisted logs.
|
|
</DocsP>
|
|
<DocsP>
|
|
<Mono>WS /v1/builds/:id/stream</Mono> — live event stream of build events:
|
|
<Mono>status</Mono>, <Mono>log</Mono>, <Mono>done</Mono>, <Mono>error</Mono>.
|
|
</DocsP>
|
|
|
|
<DocsH2 id="oauth">OAuth (clients of generated servers, not dashboard)</DocsH2>
|
|
<DocsP>
|
|
<Mono>GET /.well-known/oauth-authorization-server/oauth</Mono> — RFC 8414 metadata.
|
|
</DocsP>
|
|
<DocsP><Mono>GET /oauth/jwks</Mono> — RS256 public key for verifying access tokens.</DocsP>
|
|
<DocsP><Mono>POST /oauth/register</Mono> — RFC 7591 dynamic client registration.</DocsP>
|
|
<DocsP><Mono>GET /oauth/authorize</Mono> — authorization code endpoint, requires session.</DocsP>
|
|
<DocsP><Mono>POST /oauth/token</Mono> — code exchange + refresh.</DocsP>
|
|
|
|
<DocsH2 id="examples">Curl example</DocsH2>
|
|
<DocsCode
|
|
label="full lifecycle"
|
|
code={`# 1. magic link
|
|
curl -X POST http://localhost:4000/v1/auth/magic-link -d '{"email":"me@x.dev"}'
|
|
# (grab token from API console)
|
|
|
|
# 2. verify -> session
|
|
curl -c cookies.txt -X POST http://localhost:4000/v1/auth/verify -d '{"token":"…"}'
|
|
|
|
# 3. preview
|
|
curl -b cookies.txt -X POST http://localhost:4000/v1/servers/preview \\
|
|
-d '{"prompt":"echo server with one tool: echo(message)"}'
|
|
|
|
# 4. build
|
|
curl -b cookies.txt -X POST http://localhost:4000/v1/servers \\
|
|
-d '{"name":"Echo","slug":"echo","prompt":"…","secrets":{},"previewId":"…"}'`}
|
|
/>
|
|
</>
|
|
);
|
|
}
|