Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Improve code-mode docs formatting; add docs formatting guideline

Jeremiah Lowin0afd990ee6b3
diff --git a/docs/servers/transforms/code-mode.mdx b/docs/servers/transforms/code-mode.mdx
index df4e094ba..f1caecc2d 100644
--- a/docs/servers/transforms/code-mode.mdx
+++ b/docs/servers/transforms/code-mode.mdx
@@ -145,11 +145,11 @@ The default `MontySandboxProvider` can enforce execution limits on sandboxed cod
```python
from fastmcp.experimental.transforms import CodeMode, MontySandboxProvider
-mcp.add_transform(CodeMode(
- sandbox_provider=MontySandboxProvider(
- limits={"max_duration_secs": 10, "max_memory": 50_000_000},
- ),
-))
+sandbox = MontySandboxProvider(
+ limits={"max_duration_secs": 10, "max_memory": 50_000_000},
+)
+
+mcp = FastMCP("Server", transforms=[CodeMode(sandbox_provider=sandbox)])
```
All keys are optional β€” omit any to leave that dimension uncapped: