Skip to content

Commit 08b1cae

Browse files
committed
update sgconfig.yml and readme
1 parent d002de2 commit 08b1cae

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ You can also build from source, see below and note that `ast-grep` is an extnern
2727
- **Easy Integration**: Designed to work seamlessly with AI coding agents through the MCP server.
2828
- **Extensible**: Future-proofed with a plan to integrate semantic analysis for more powerful and accurate linting.
2929

30+
## Example Usage
31+
32+
This repository includes a sample file with a rule violation to demonstrate how the MCP server works. The `test-violation.go` file contains a call to `fmt.Println`, which is disallowed by a rule in the `rules` directory.
33+
34+
You can use an AI agent to scan this file and see the violation.
35+
36+
1. **Start the Context Sherpa server**:
37+
```bash
38+
./context-sherpa
39+
```
40+
41+
2. **Instruct your AI agent to scan the file**:
42+
> "Scan the code in the `test-violation.go` file."
43+
44+
3. **The agent will use the `scan_code` tool and report the violation**:
45+
The agent will read the file and call the `scan_code` tool with the content of `test-violation.go`. The server will then return the violation found, and the agent will report it back to you.
46+
3047
## Tools
3148

3249
The MCP server exposes the following tools to the AI agent:

sgconfig.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
id: main-config
22
language: go
33
ruleDirs:
4-
- rules
5-
rule:
6-
pattern: test
4+
- rules

0 commit comments

Comments
 (0)