Skip to content

Commit 952a87c

Browse files
committed
[agent-setup] Fully static PlatformAccessSection, drive MCP list from mcps-manifest
- Switch cloudflare-mcp-server-card collection to cloudflare-mcps-manifest, backed by v1/cloudflare-mcps/mcps-manifest.json — names and descriptions now come from the manifest with no local hardcoding - Pin Code Mode server first in McpServerList with a 'code mode' chip - Add MCP server URLs to the list UI - PlatformAccessSection is now a zero-prop, zero-slot static component; all per-agent wrangler/docs/skills slot content removed - All six agent pages reduced to <PlatformAccess /> - Clarify Code Mode vs domain-specific servers in MCP section copy - Remove agentName interpolations throughout
1 parent 1793a21 commit 952a87c

11 files changed

Lines changed: 131 additions & 512 deletions

File tree

src/components/agent-setup/McpServerList.astro

Lines changed: 26 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { getEntry } from "astro:content";
2+
import { getCollection } from "astro:content";
33
44
interface Props {
55
/** Whether to show the "bundled" chip. Only relevant for plugin-based agents (Claude Code, Cursor). */
@@ -8,83 +8,41 @@ interface Props {
88
99
const { showBundled = false } = Astro.props;
1010
11-
const card = await getEntry("cloudflare-mcp-server-card", "cloudflare-mcp");
11+
const CODE_MODE_URL = "https://mcp.cloudflare.com/mcp";
1212
13-
/**
14-
* Descriptions are not available in the server-card spec, so they are
15-
* maintained here and keyed by the server name derived from the remote URL.
16-
*
17-
* Name derivation: the subdomain of *.mcp.cloudflare.com becomes the suffix
18-
* after "cloudflare-", except for the root mcp.cloudflare.com which maps to
19-
* "cloudflare-api" (the Code Mode server).
20-
*/
21-
const DESCRIPTIONS: Record<string, string> = {
22-
"cloudflare-api":
23-
"Entire Cloudflare API (2,500+ endpoints) in ~1,000 tokens via Code Mode.",
24-
"cloudflare-docs": "Up-to-date Cloudflare documentation and reference.",
25-
"cloudflare-bindings":
26-
"Build Workers applications with storage, AI, and compute primitives.",
27-
"cloudflare-builds": "Manage and get insights into Workers builds.",
28-
"cloudflare-observability":
29-
"Debug and analyze application logs and analytics.",
30-
"cloudflare-radar":
31-
"Global Internet traffic insights, trends, URL scans, and utilities.",
32-
"cloudflare-containers": "Spin up a sandbox development environment.",
33-
"cloudflare-browser":
34-
"Fetch web pages, convert them to markdown, and take screenshots.",
35-
"cloudflare-logs": "Quick summaries for Logpush job health.",
36-
"cloudflare-ai-gateway":
37-
"Search AI Gateway logs and inspect prompts, responses, and token usage.",
38-
"cloudflare-auditlogs":
39-
"Query audit logs and generate reports for review.",
40-
"cloudflare-dns-analytics":
41-
"Optimize DNS performance and debug issues based on current setup.",
42-
"cloudflare-dex":
43-
"Digital Experience Monitoring — insights on critical applications.",
44-
"cloudflare-casb":
45-
"Cloudflare One CASB — identify SaaS security misconfigurations.",
46-
"cloudflare-graphql":
47-
"Query analytics data through Cloudflare's GraphQL API.",
48-
};
13+
const allServers = await getCollection("cloudflare-mcps-manifest");
14+
15+
// Code Mode first, then the rest in manifest order
16+
const servers = [
17+
...allServers.filter((s) => s.data.url === CODE_MODE_URL),
18+
...allServers.filter((s) => s.data.url !== CODE_MODE_URL),
19+
];
4920
5021
/**
51-
* Servers included in the cloudflare/skills plugin bundle (Claude Code, Cursor).
22+
* URLs of servers included in the cloudflare/skills plugin bundle
23+
* (Claude Code, Cursor).
5224
*/
5325
const BUNDLED = new Set([
54-
"cloudflare-api",
55-
"cloudflare-docs",
56-
"cloudflare-bindings",
57-
"cloudflare-builds",
58-
"cloudflare-observability",
26+
"https://mcp.cloudflare.com/mcp",
27+
"https://docs.mcp.cloudflare.com/mcp",
28+
"https://bindings.mcp.cloudflare.com/mcp",
29+
"https://builds.mcp.cloudflare.com/mcp",
30+
"https://observability.mcp.cloudflare.com/mcp",
5931
]);
60-
61-
/**
62-
* Derive a stable server name from a remote URL.
63-
*
64-
* https://mcp.cloudflare.com/mcp → cloudflare-api
65-
* https://docs.mcp.cloudflare.com/mcp → cloudflare-docs
66-
* https://ai-gateway.mcp.cloudflare.com → cloudflare-ai-gateway
67-
*/
68-
function nameFromUrl(url: string): string {
69-
const { hostname } = new URL(url);
70-
// hostname: "mcp.cloudflare.com" or "{sub}.mcp.cloudflare.com"
71-
const sub = hostname.replace(/\.mcp\.cloudflare\.com$/, "");
72-
return sub === "mcp" ? "cloudflare-api" : `cloudflare-${sub}`;
73-
}
74-
75-
// Use only the streamable-http remotes to get one entry per logical server.
76-
const servers = (card?.data.remotes ?? [])
77-
.filter((r) => r.type === "streamable-http")
78-
.map((r) => nameFromUrl(r.url));
7932
---
8033

8134
<ul class="agent-simple-list">
8235
{
83-
servers.map((name) => (
36+
servers.map((s) => (
8437
<li class="agent-simple-item">
8538
<span class="agent-simple-name">
86-
{name}
87-
{showBundled && BUNDLED.has(name) && (
39+
{s.data.name}
40+
{s.data.url === CODE_MODE_URL && (
41+
<span class="agent-simple-tag agent-simple-tag--codemode">
42+
code mode
43+
</span>
44+
)}
45+
{showBundled && BUNDLED.has(s.data.url) && (
8846
<span
8947
class="agent-simple-tag"
9048
title="Included in the cloudflare/skills plugin"
@@ -93,9 +51,8 @@ const servers = (card?.data.remotes ?? [])
9351
</span>
9452
)}
9553
</span>
96-
<span class="agent-simple-desc">
97-
{DESCRIPTIONS[name] ?? ""}
98-
</span>
54+
<span class="agent-simple-desc">{s.data.description}</span>
55+
<span class="agent-simple-url">{s.data.url}</span>
9956
</li>
10057
))
10158
}
Lines changed: 73 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,77 @@
11
---
2-
// Shared "Cloudflare platform access" content for every agent detail page.
3-
//
4-
// Renders the four <PlatformAccessDetails> cards in a consistent order:
5-
// 1. Cloudflare Skills — what they are + links to GitHub and agent Skills docs
6-
// 2. MCP servers — description + <McpServerList> + links to GitHub / catalog
7-
// 3. Wrangler CLI — agent-specific body via `wrangler` slot (fallback copy is generic)
8-
// 4. Agent-friendly docs — agent-specific body via `docs` slot (fallback copy is generic)
9-
//
10-
// Install commands are intentionally NOT repeated here — they already appear in
11-
// each agent's Quick start.
12-
//
13-
// Uses a bespoke <PlatformAccessDetails> component rather than the site-wide
14-
// <Details>. This lets us use higher-specificity selectors to beat Starlight's
15-
// default `.sl-markdown-content details` prose styling WITHOUT needing a
16-
// `.not-content` wrapper — so inline <code>, hyperlinks, and other prose
17-
// elements inside the body keep their normal Starlight theming.
182
import PlatformAccessDetails from "./PlatformAccessDetails.astro";
193
import McpServerList from "./McpServerList.astro";
204
import SkillsList from "./SkillsList.astro";
21-
22-
interface Props {
23-
agentName: string;
24-
/**
25-
* If the agent doesn't yet support Agent Skills, set to false to hide the
26-
* Skills card entirely.
27-
*/
28-
skillsSupported?: boolean;
29-
/** Optional extra paragraph shown above the Skills list. */
30-
skillsExtraHtml?: string;
31-
/** Optional extra paragraph shown above the MCP server list. */
32-
mcpExtraHtml?: string;
33-
}
34-
35-
const {
36-
agentName,
37-
skillsSupported = true,
38-
skillsExtraHtml,
39-
mcpExtraHtml,
40-
} = Astro.props;
415
---
426

437
<div class="agent-setup-platform-access">
448
<p class="agent-platform-lede">
45-
The ways {agentName} reaches Cloudflare. Expand any section to learn more.
9+
Expand any section to learn more.
4610
</p>
4711

48-
{
49-
skillsSupported && (
50-
<PlatformAccessDetails header="Cloudflare Skills">
51-
<p class="agent-platform-hint">
52-
Persistent platform context that teaches {agentName} how Cloudflare
53-
works.
54-
</p>
55-
<p>
56-
Skills are instructions the agent loads on demand. The{" "}
57-
<a
58-
href="https://github.com/cloudflare/skills"
59-
target="_blank"
60-
rel="noopener noreferrer"
61-
>
62-
cloudflare/skills
63-
</a>{" "}
64-
bundle ships eight Skills covering every layer of the platform &mdash;
65-
so the agent knows your conventions without you re-explaining them.
66-
</p>
67-
{skillsExtraHtml && <p set:html={skillsExtraHtml} />}
68-
<SkillsList />
69-
</PlatformAccessDetails>
70-
)
71-
}
12+
<PlatformAccessDetails header="Cloudflare Skills">
13+
<p class="agent-platform-hint">
14+
Persistent platform context that teaches the agent how Cloudflare works.
15+
</p>
16+
<p>
17+
Skills are instructions the agent loads on demand. The{" "}
18+
<a
19+
href="https://github.com/cloudflare/skills"
20+
target="_blank"
21+
rel="noopener noreferrer"
22+
>
23+
cloudflare/skills
24+
</a>{" "}
25+
bundle covers every layer of the platform &mdash; so the agent knows your
26+
conventions without you re-explaining them.
27+
</p>
28+
<SkillsList />
29+
</PlatformAccessDetails>
7230

7331
<PlatformAccessDetails header="MCP servers">
7432
<p class="agent-platform-hint">
75-
Live access to the Cloudflare API, docs, and observability from inside {
76-
agentName
77-
}.
33+
Live access to the Cloudflare API, docs, and observability.
7834
</p>
7935
<p>
80-
MCP servers give {agentName} typed tools to call into Cloudflare at runtime.
81-
The{" "}
36+
MCP servers provide typed tools to call into Cloudflare at runtime. There
37+
are two options: <a href="/agents/api-reference/codemode/">Code Mode</a> —
38+
a single server that covers the entire Cloudflare API (2,500+ endpoints in
39+
~1,000 tokens) — or a set of focused, domain-specific servers hosted in
40+
the{" "}
8241
<a
8342
href="https://github.com/cloudflare/mcp-server-cloudflare"
8443
target="_blank"
8544
rel="noopener noreferrer"
8645
>
8746
cloudflare/mcp-server-cloudflare
8847
</a>{" "}
89-
repo hosts all of them; the full catalog is also in the{" "}
48+
repo. The full catalog is also in the{" "}
9049
<a href="/agents/model-context-protocol/mcp-servers-for-cloudflare/">
9150
MCP servers for Cloudflare
9251
</a>{" "}
93-
docs. The API server alone exposes 2,500+ endpoints in ~1,000 tokens via <a
94-
href="/agents/api-reference/codemode/">Code Mode</a
95-
>.
52+
docs.
9653
</p>
97-
{mcpExtraHtml && <p set:html={mcpExtraHtml} />}
98-
<McpServerList showBundled={agentName === "Claude Code" || agentName === "Cursor"} />
54+
<McpServerList />
9955
</PlatformAccessDetails>
10056

10157
<PlatformAccessDetails header="Wrangler CLI">
102-
<slot name="wrangler">
103-
<p class="agent-platform-hint">
104-
Local dev, deploys, and Workers-specific commands.
105-
</p>
106-
<p>
107-
{agentName} runs <a href="/workers/wrangler/">Wrangler</a> for local development,
108-
deploys, and product-specific commands like <code
109-
>wrangler d1 migrations apply</code
110-
> or <code>wrangler tail</code>. The bundled <strong>wrangler</strong> Skill
111-
teaches the agent when to reach for it.
112-
</p>
113-
</slot>
58+
<p class="agent-platform-hint">
59+
Local dev, deploys, and Workers-specific commands.
60+
</p>
61+
<p>
62+
Use <a href="/workers/wrangler/">Wrangler</a> for local development,
63+
deploys, and product-specific commands like{" "}
64+
<code>wrangler d1 migrations apply</code> or <code>wrangler tail</code>.
65+
The bundled <strong>wrangler</strong> Skill teaches the agent when to reach
66+
for it.
67+
</p>
11468
<aside class="agent-platform-note">
11569
<p class="agent-platform-note-title">What&rsquo;s next</p>
11670
<p>
117-
The unified <code>cf</code> CLI is in technical preview &mdash; a next-generation
118-
CLI that covers every Cloudflare product with consistent verbs and ergonomic
119-
output for agents. Try it with <code>npx cf</code>. <a
71+
The unified <code>cf</code> CLI is in technical preview &mdash; a
72+
next-generation CLI that covers every Cloudflare product with consistent
73+
verbs and ergonomic output for agents. Try it with <code>npx cf</code>.{" "}
74+
<a
12075
href="https://blog.cloudflare.com/cf-cli-local-explorer/"
12176
target="_blank"
12277
rel="noopener noreferrer">Read the announcement &rarr;</a
@@ -126,43 +81,36 @@ const {
12681
</PlatformAccessDetails>
12782

12883
<PlatformAccessDetails header="Agent-friendly docs">
129-
<slot name="docs">
130-
<p class="agent-platform-hint">
131-
Token-efficient references you can point {agentName} at.
132-
</p>
133-
<p>
134-
Append <code>/index.md</code> to any Cloudflare docs URL for a clean markdown
135-
version. Every top-level product section also has its own <code
136-
>llms.txt</code
137-
> — a page index sized for a single context window. A few useful ones:
138-
</p>
139-
<ul class="agent-platform-resources">
140-
<li>
141-
<a href="/llms.txt">developers.cloudflare.com/llms.txt</a> &mdash; directory
142-
of every Cloudflare product.
143-
</li>
144-
<li>
145-
<a href="/workers/llms.txt"
146-
>developers.cloudflare.com/workers/llms.txt</a
147-
>
148-
</li>
149-
<li>
150-
<a href="/agents/llms.txt"
151-
>developers.cloudflare.com/agents/llms.txt</a
152-
>
153-
</li>
154-
<li>
155-
<a href="/r2/llms.txt">developers.cloudflare.com/r2/llms.txt</a>
156-
</li>
157-
<li>
158-
<a href="/d1/llms.txt">developers.cloudflare.com/d1/llms.txt</a>
159-
</li>
160-
</ul>
161-
<p>
162-
For a full overview of how these docs are structured for agents, refer
163-
to the{" "}
164-
<a href="/style-guide/ai-tooling/">AI tooling guide</a>.
165-
</p>
166-
</slot>
84+
<p class="agent-platform-hint">
85+
Token-efficient references optimized for agents.
86+
</p>
87+
<p>
88+
Append <code>/index.md</code> to any Cloudflare docs URL for a clean
89+
markdown version. Every top-level product section also has its own{" "}
90+
<code>llms.txt</code> — a page index sized for a single context window. A
91+
few useful ones:
92+
</p>
93+
<ul class="agent-platform-resources">
94+
<li>
95+
<a href="/llms.txt">developers.cloudflare.com/llms.txt</a> &mdash;
96+
directory of every Cloudflare product.
97+
</li>
98+
<li>
99+
<a href="/workers/llms.txt">developers.cloudflare.com/workers/llms.txt</a>
100+
</li>
101+
<li>
102+
<a href="/agents/llms.txt">developers.cloudflare.com/agents/llms.txt</a>
103+
</li>
104+
<li>
105+
<a href="/r2/llms.txt">developers.cloudflare.com/r2/llms.txt</a>
106+
</li>
107+
<li>
108+
<a href="/d1/llms.txt">developers.cloudflare.com/d1/llms.txt</a>
109+
</li>
110+
</ul>
111+
<p>
112+
For a full overview of how these docs are structured for agents, refer to
113+
the <a href="/style-guide/ai-tooling/">AI tooling guide</a>.
114+
</p>
167115
</PlatformAccessDetails>
168116
</div>

src/content.config.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
partialsSchema,
3131
streamSchema,
3232
cloudflareSkillSchema,
33-
mcpServerCardSchema,
33+
mcpServerSchema,
3434
} from "~/schemas";
3535

3636
function contentLoader(name: string) {
@@ -147,12 +147,15 @@ export const collections = {
147147
}),
148148
schema: cloudflareSkillSchema,
149149
}),
150-
"cloudflare-mcp-server-card": defineCollection({
151-
loader: middlecacheLoader("v1/cloudflare-mcps/server-card.json", {
150+
"cloudflare-mcps-manifest": defineCollection({
151+
loader: middlecacheLoader("v1/cloudflare-mcps/mcps-manifest.json", {
152152
parser: (fileContent: string) => {
153-
return { "cloudflare-mcp": JSON.parse(fileContent) };
153+
const data = JSON.parse(fileContent) as {
154+
servers: Array<{ name: string; description: string; url: string }>;
155+
};
156+
return Object.fromEntries(data.servers.map((s) => [s.url, s]));
154157
},
155158
}),
156-
schema: mcpServerCardSchema,
159+
schema: mcpServerSchema,
157160
}),
158161
};

0 commit comments

Comments
 (0)