Skip to content

Commit d2aa6cd

Browse files
committed
add quick example to mcp guardrails
1 parent f45df45 commit d2aa6cd

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docs/mcp-scan/guardrails.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,28 @@ The `mcp-scan proxy` command supports dynamic guardrailing for MCP servers, lett
1414

1515
This guide covers how to structure guardrail configs, write custom rules, and apply enforcement at the client, server, and tool levels.
1616

17-
<img src="../assets/proxy.svg" alt="proxying-overview-diagram" class="textwidth" style="max-width: 420pt; margin: 40pt auto; display: block;" />
18-
1917
!!! note
2018
By default, the configuration file is located at `~/.mcp-scan/guardrails-config.yml`.
2119

20+
!!! info "Get Started Directly"
21+
Just looking to get started quickly? The following example provides a quick way to get started with writing your very own config file. Just copy
22+
it into your config file and replace the client and server names.
23+
```yaml
24+
<client-name>: # Replace with a client name (e.g., cursor)
25+
<server-name>: # Replace with a server name (e.g., whatsapp)
26+
guardrails:
27+
secrets: block
28+
29+
custom_guardrails:
30+
- name: "Filter Errors Guardrail"
31+
id: "error_filter_guardrail"
32+
action: block
33+
content: |
34+
raise "An error was found." if:
35+
(msg: Message)
36+
"error" in msg.content
37+
```
38+
2239
## File structure
2340

2441
The configuration file defines guardrailing behavior hierarchically, scoped by **client**, **server**, and **tool**. Below is a structured overview of the YAML format:

0 commit comments

Comments
 (0)