Skip to content

Commit 4e4d3ec

Browse files
committed
test
1 parent a82e324 commit 4e4d3ec

File tree

12 files changed

+439
-224
lines changed

12 files changed

+439
-224
lines changed

package-lock.json

Lines changed: 145 additions & 145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"@types/node": "22.13.13",
5151
"@types/react": "19.0.7",
5252
"@types/react-dom": "19.0.4",
53-
"@typescript-eslint/parser": "8.27.0",
54-
"algoliasearch": "5.21.0",
53+
"@typescript-eslint/parser": "8.28.0",
54+
"algoliasearch": "5.23.0",
5555
"astro": "5.5.4",
5656
"astro-breadcrumbs": "3.3.1",
5757
"astro-icon": "1.1.5",
@@ -116,7 +116,7 @@
116116
"ts-blank-space": "0.6.1",
117117
"tsx": "4.19.3",
118118
"typescript": "5.8.2",
119-
"typescript-eslint": "8.27.0",
119+
"typescript-eslint": "8.28.0",
120120
"unified": "11.0.5",
121121
"unist-util-visit": "5.0.0",
122122
"vite-tsconfig-paths": "5.1.4",

src/components/RSSButton.astro

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
---
22
import { z } from "astro:schema";
33
import { Icon } from "@astrojs/starlight/components";
4+
import type { StarlightIcon } from "@astrojs/starlight/types";
45
56
const props = z
67
.object({
7-
changelog: z
8-
.string()
9-
.transform((val) => val.toLowerCase().replaceAll(" ", "-")),
8+
text: z.string().default("Subscribe to RSS"),
9+
icon: z.custom<StarlightIcon>().default("rss"),
1010
})
11-
.or(
12-
z.object({
13-
href: z.string(),
14-
}),
11+
.and(
12+
z
13+
.object({
14+
changelog: z
15+
.string()
16+
.transform((val) => val.toLowerCase().replaceAll(" ", "-")),
17+
})
18+
.or(
19+
z.object({
20+
href: z.string(),
21+
}),
22+
),
1523
);
1624
1725
const input = props.parse(Astro.props);
@@ -22,6 +30,6 @@ const input = props.parse(Astro.props);
2230
class="inline-flex items-center justify-center gap-1 rounded font-semibold no-underline"
2331
target="_blank"
2432
>
25-
Subscribe to RSS
26-
<Icon name="rss" size="1.25rem" />
33+
{input.text}
34+
<Icon name={input.icon} size="1.25rem" />
2735
</a>

src/components/changelog/Header.astro

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { Image } from "astro:assets";
33
import { z } from "astro:schema";
44
import { getEntry, type CollectionEntry } from "astro:content";
55
6-
import { StarlightIcon } from "..";
6+
import { Icon } from "@astrojs/starlight/components";
7+
import RSSButton from "~/components/RSSButton.astro";
8+
79
import HeroImage from "~/assets/images/changelog/hero.svg";
810
911
type Props = z.input<typeof props>;
@@ -35,21 +37,11 @@ const products = await uniqueProducts(notes);
3537
<div class="text-center sm:text-left">
3638
<h1>Changelog</h1>
3739
<p>New updates and improvements at Cloudflare.</p>
38-
<div class="changelog-rss-links">
39-
<a
40-
href="/changelog/rss/index.xml"
41-
class="dark:!hover:text-[#79B1FF] -mx-2 whitespace-nowrap px-2 text-[#056DFF] no-underline hover:rounded-[4px] hover:bg-[#DCEBFF] hover:!text-[#056DFF] dark:text-[#79B1FF] dark:hover:bg-[#002B66] max-sm:block"
42-
>
43-
Subscribe to RSS
44-
<StarlightIcon name="rss" size="18px" class="!inline align-text-top" />
45-
</a>
46-
<a
47-
href="/fundamentals/new-features/available-rss-feeds/"
48-
class="dark:!hover:text-[#79B1FF] -mx-2 whitespace-nowrap px-2 text-[#056DFF] no-underline hover:rounded-[4px] hover:bg-[#DCEBFF] hover:!text-[#056DFF] dark:text-[#79B1FF] dark:hover:bg-[#002B66] max-sm:block"
49-
>
50-
View all RSS feeds &gt;
51-
</a>
52-
</div>
40+
<p>
41+
<RSSButton changelog="index" />
42+
<br />
43+
<RSSButton href="index" text="View all RSS feeds" icon="right-caret" />
44+
</p>
5345
{
5446
products.length > 0 && (
5547
<div>
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
pcx_content_type: concept
3+
title: McpAgent — API Reference
4+
sidebar:
5+
order: 6
6+
---
7+
8+
import { Render, TypeScriptExample } from "~/components";
9+
10+
When you build MCP Servers on Cloudflare, you extend the [`McpAgent` class](https://github.com/cloudflare/agents/blob/5881c5d23a7f4580600029f69307cfc94743e6b8/packages/agents/src/mcp.ts), from the Agents SDK, like this:
11+
12+
<TypeScriptExample>
13+
14+
```ts title="src/index.ts"
15+
import { McpAgent } from "agents/mcp";
16+
import { DurableMCP } from "@cloudflare/model-context-protocol";
17+
18+
export class MyMCP extends McpAgent {
19+
server = new McpServer({ name: "Demo", version: "1.0.0" });
20+
21+
async init() {
22+
this.server.tool(
23+
"add",
24+
{ a: z.number(), b: z.number() },
25+
async ({ a, b }) => ({
26+
content: [{ type: "text", text: String(a + b) }],
27+
}),
28+
);
29+
}
30+
}
31+
```
32+
33+
</TypeScriptExample>
34+
35+
This means that each instance of your MCP server has its own durable state, backed by a [Durable Object](/durable-objects/), with its own [SQL database](/agents/api-reference/store-and-sync-state).
36+
37+
Your MCP server doesn't necessarily have to be an Agent. You can build MCP servers that are stateless, and just add [tools](/agents/model-context-protocol/tools) to your MCP server using the `@modelcontextprotocol/typescript-sdk` package.
38+
39+
But if you want your MCP server to:
40+
41+
- remember previous tool calls, and responses it provided
42+
- provide a game to the MCP client, remembering the state of the game board, previous moves, and the score
43+
- cache the state of a previous external API call, so that subsequent tool calls can reuse it
44+
- do anything that an Agent can do, but allow MCP clients to communicate with it
45+
46+
You can use the following APIs in order to do so.
47+
48+
### State synchronization APIs
49+
50+
The `McpAgent` class makes the following subset of methods from the [Agents SDK](/agents/api-reference/agents-api/) available:
51+
52+
- [`state`](/agents/api-reference/store-and-sync-state/)
53+
- [`initialState`](/agents/api-reference/store-and-sync-state/#set-the-initial-state-for-an-agent)
54+
- [`setState`](/agents/api-reference/store-and-sync-state/)
55+
- [`onStateUpdate`](/agents/api-reference/store-and-sync-state/#synchronizing-state)
56+
- [`sql`](/agents/api-reference/agents-api/#sql-api)
57+
58+
:::note[State resets after the session ends]
59+
Currently, each client session is backed by an instance of the `McpAgent` class. This is handled automatically for you, as shown in the [getting started guide](/agents/guides/remote-mcp-server). This means that when the same client reconnects, they will start a new session, and the state will be reset.
60+
:::
61+
62+
For example, the following code implements an MCP server that remembers a counter value, and updates the counter when the `add` tool is called:
63+
64+
<TypeScriptExample>
65+
66+
```ts title="src/index.ts"
67+
import { McpAgent } from "agents/mcp";
68+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
69+
import { z } from "zod";
70+
71+
type State = { counter: number };
72+
73+
export class MyMCP extends McpAgent<Env, State, {}> {
74+
server = new McpServer({
75+
name: "Demo",
76+
version: "1.0.0",
77+
});
78+
79+
initialState: State = {
80+
counter: 1,
81+
};
82+
83+
async init() {
84+
this.server.resource(`counter`, `mcp://resource/counter`, (uri) => {
85+
return {
86+
contents: [{ uri: uri.href, text: String(this.state.counter) }],
87+
};
88+
});
89+
90+
this.server.tool(
91+
"add",
92+
"Add to the counter, stored in the MCP",
93+
{ a: z.number() },
94+
async ({ a }) => {
95+
this.setState({ ...this.state, counter: this.state.counter + a });
96+
97+
return {
98+
content: [
99+
{
100+
type: "text",
101+
text: String(`Added ${a}, total is now ${this.state.counter}`),
102+
},
103+
],
104+
};
105+
},
106+
);
107+
}
108+
109+
onStateUpdate(state: State) {
110+
console.log({ stateUpdate: state });
111+
}
112+
}
113+
```
114+
115+
</TypeScriptExample>
116+
117+
### Not yet supported APIs
118+
119+
The following APIs from the Agents SDK are not yet available on `McpAgent`:
120+
121+
- [WebSocket APIs](/agents/api-reference/websockets/) (`onMessage`, `onError`, `onClose`, `onConnect`)
122+
- [Scheduling APIs](/agents/api-reference/schedule-tasks/) `this.schedule`

src/content/docs/cloudflare-one/connections/connect-devices/warp/deployment/manual-deployment.mdx

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Details, GlossaryTooltip, Render } from "~/components";
8+
import { Details, GlossaryTooltip, Render, Badge } from "~/components";
99

1010
If you plan to direct your users to manually download and configure the WARP client, users will need to connect the client to your organization's Cloudflare Zero Trust instance.
1111

@@ -15,13 +15,13 @@ If you plan to direct your users to manually download and configure the WARP cli
1515

1616
## Windows, macOS, and Linux
1717

18-
### Enroll via the GUI
18+
### Enroll using the GUI
1919

2020
<Render file="warp/enroll-desktop" />
2121

2222
The device is now protected by your organization's Zero Trust policies.
2323

24-
### Enroll via the CLI
24+
### Enroll using the CLI
2525

2626
To enroll your device using the terminal:
2727

@@ -74,10 +74,75 @@ The device is now protected by your organization's Zero Trust policies. For more
7474

7575
## iOS, Android, and ChromeOS
7676

77+
### Enroll manually
78+
7779
<Render file="warp/enroll-ios-android" />
7880

7981
The device is now protected by your organization's Zero Trust policies.
8082

83+
### Enroll using a URL <Badge text="Beta" variant="caution"/>
84+
85+
<Details header="Feature availability">
86+
87+
| System | Availability | Minimum WARP version |
88+
| -------- | ------------ | -------------------- |
89+
| Windows || |
90+
| macOS || |
91+
| Linux || |
92+
| iOS || 1.10 |
93+
| Android || 2.4 |
94+
| ChromeOS || 2.4 |
95+
96+
</Details>
97+
98+
Administrators can provide users with a custom login URL that automatically fills in your organization's <GlossaryTooltip term="team name">team name</GlossaryTooltip> during device enrollment. Using a URL reduces the potential for error that comes with manual entry of the team name.
99+
100+
The WARP client supports URLs accessed through a direct link or with a URL handler such as a QR code. Direct links are currently only supported in Safari and Firefox. If your default browser is Chrome (or another unsupported browser), we recommend embedding the link in a QR code.
101+
102+
#### Generate a login URL
103+
104+
To generate a URL for device enrollment:
105+
106+
1. Copy the following link, replacing `<your-team-name>` with your Zero Trust <GlossaryTooltip term="team name">team name</GlossaryTooltip>:
107+
```txt
108+
cf1app://oneapp.cloudflare.com/team?name=<your-team-name>
109+
```
110+
2. (Optional) Use any QR code generator to embed the link in a QR code.
111+
3. Distribute the link or QR code to users.
112+
113+
#### Use the login URL
114+
115+
To enroll a device using a login URL:
116+
117+
1. [Download](/cloudflare-one/connections/connect-devices/warp/download-warp/) and install the Cloudflare One Agent app.
118+
2. Go to the [login URL](#generate-a-login-url) provided by your account administrator. To use a QR code, open the QR scanner app on your device and scan the QR code.
119+
120+
The Cloudflare One Agent app will open and start the onboarding flow.
121+
122+
:::note
123+
If the device is already enrolled in the account associated with this URL, Cloudflare One agent will bypass onboarding and show the **Connected** switch.
124+
:::
125+
126+
3. To complete the onboarding flow:
127+
128+
a. Review the privacy policy and select **Accept**.
129+
130+
b. On the **Enter team name** screen, confirm that the pre-populated <GlossaryTooltip term="team name">team name</GlossaryTooltip> matches your organization.
131+
132+
:::note[`Already Authenticated` error]
133+
If Cloudflare One Agent is logged in using another team name, you must first log out of that account. Go to **Settings** > **Account** to log out, and then retry the QR code or login link.
134+
:::
135+
136+
c. Complete the authentication steps required by your organization.
137+
138+
d. After authenticating, select **Install VPN Profile**.
139+
140+
e. In the **Connection request** popup window, select **OK**.
141+
142+
4. If you did not enable [auto-connect](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-settings/#auto-connect), manually turn on the switch to **Connected**.
143+
144+
The device is now protected by your organization's Zero Trust policies.
145+
81146
## Virtual machines
82147

83148
By default, virtual machines (VMs) are subject to the WARP client settings of the host. If you want to deploy a separate instance of WARP in a VM, you must configure the VM to operate in bridged networking mode.

src/content/docs/cloudflare-one/policies/data-loss-prevention/dlp-policies/logging-options.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,25 @@ Data Loss Prevention will now store a portion of the payload for HTTP requests t
4343
3. Select **Decrypt Payload Log**.
4444
4. Enter your private key and select **Decrypt**.
4545

46-
You will see the [ID of the matched DLP Profile](/api/resources/zero_trust/subresources/dlp/subresources/profiles/methods/list/) followed by the decrypted payload. Note that DLP currently logs only the first match.
46+
You will see the [ID of the matched DLP Profile](/api/resources/zero_trust/subresources/dlp/subresources/profiles/methods/list/) followed by the decrypted payload.
4747

4848
:::note
49-
Neither the key nor the decrypted payload will be stored by Cloudflare.
49+
Cloudflare does not store the key or the decrypted payload.
5050
:::
5151

52+
### Report false and true positives to AI context analysis
53+
54+
When you have [AI context analysis](/cloudflare-one/policies/data-loss-prevention/dlp-profiles/advanced-settings/#ai-context-analysis) turned on for a DLP profile, you can train the AI model to adjust its confident threshold by reporting false and true positives.
55+
56+
To report a DLP match payload as a false or true positive:
57+
58+
1. [Find and decrypt](#4-view-payload-logs) the payload log you want to report.
59+
2. In **Log details**, choose a detected context match.
60+
3. In **Context**, select the redacted match data.
61+
4. In **Match details**, choose whether you want to report the match as a false positive or a true positive.
62+
63+
Based on your report, DLP's machine learning will adjust its confidence in future matches for the associated profile.
64+
5265
### Data privacy
5366

5467
- All Cloudflare logs are encrypted at rest. Encrypting the payload content adds a second layer of encryption for the matched values that triggered a DLP rule.

0 commit comments

Comments
 (0)