Skip to content

Commit 0a8fa08

Browse files
chughtapanTapan Chughclaude
authored
Reorganize documentation and add wags run command (#10)
Restructures documentation to provide clearer user journey from connecting to existing servers, to creating new servers, to adding middleware. Documentation changes: - Split quickstart into two guides: - quickstart.md: connecting to existing wags servers (new) - onboarding.md: creating wags proxy servers (renamed from quickstart.md) - Rename benchmarks.md → evals.md with simplified content - Update index.md with 4 quick link cards (quickstart, onboarding, middleware, evals) - Update middleware/todo.md to merge example workflow into "how it works" - Remove prerequisites section from middleware/overview.md - Update mkdocs.yml navigation structure CLI enhancements: - Rename `wags run` → `wags start-server` (starts MCP server with middleware) - Add new `wags run` command (connects to servers using fast-agent) - Create servers/fastagent.config.yaml (shared server configuration) - Create src/wags/utils/agent_instructions.txt (default agent instructions) - Update tests to reflect renamed command User flow is now: install → connect (quickstart) → create (onboarding) → enhance (middleware) → evaluate (evals) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Tapan Chugh <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent b920aa7 commit 0a8fa08

File tree

10 files changed

+224
-117
lines changed

10 files changed

+224
-117
lines changed
Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Running Benchmarks
1+
# Running Evals
22

3-
<em class="wags-brand">wags</em> includes evaluation support for the [Berkeley Function Call Leaderboard (BFCL)](https://gorilla.cs.berkeley.edu/leaderboard.html), enabling systematic testing of LLM function calling capabilities across multi-turn conversations.
3+
Here's how to run BFCL multi-turn evaluations with <span class="wags-brand">wags</span>.
44

55
## Setup
66

@@ -33,7 +33,7 @@ git submodule update --remote
3333
# Run specific test
3434
.venv/bin/pytest 'tests/benchmarks/bfcl/test_bfcl.py::test_bfcl[multi_turn_base_121]'
3535

36-
# Run test category
36+
# Run test category (multi_turn_base, multi_turn_miss_func, multi_turn_miss_param, multi_turn_long_context)
3737
.venv/bin/pytest tests/benchmarks/bfcl/test_bfcl.py -k "multi_turn_miss_func"
3838
```
3939

@@ -69,27 +69,7 @@ Validate existing logs without running new tests:
6969
.venv/bin/pytest tests/benchmarks/bfcl/test_bfcl.py --validate-only --log-dir outputs/experiment1/raw
7070
```
7171

72-
## Test Categories
73-
74-
- **multi_turn_base**: Standard multi-turn function calling (800 tests)
75-
- **multi_turn_miss_func**: Tests handling of missing function scenarios
76-
- **multi_turn_miss_param**: Tests handling of missing parameters
77-
- **multi_turn_long_context**: Context window stress tests with overwhelming information
78-
- **Memory tests**: Tests with key-value, vector, or recursive summarization backends
79-
80-
81-
## Developer Guide
82-
83-
1. **Discovery**: pytest collects tests from `loader.find_all_test_ids()`
84-
2. **Setup**: Creates MCP servers wrapping BFCL API classes using `uv run python`
85-
3. **Execution**: Runs multi-turn conversations with FastAgent
86-
4. **Serialization**: Saves complete message history to `complete.json`
87-
5. **Extraction**: Extracts tool calls from JSON (preserves what FastAgent drops)
88-
6. **Validation**: Uses BFCL validators to check correctness
89-
7. **Result**: Pass/fail based on `validation["valid"]`
90-
9172
## Further Reading
9273

93-
- **Test organization and patterns**: See [tests/README.md](../tests/README.md)
9474
- **BFCL leaderboard**: Visit [gorilla.cs.berkeley.edu](https://gorilla.cs.berkeley.edu/leaderboard.html)
9575
- **Official BFCL repository**: [github.com/ShishirPatil/gorilla](https://github.com/ShishirPatil/gorilla)

docs/index.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ The <span class="wags-brand">wags</span> toolkit is based on state-of-the-art re
1010

1111
<div class="grid cards" markdown>
1212

13-
- **[Getting Started](quickstart.md)**
13+
- **[Quick Start](quickstart.md)**
1414

15-
Install <span class="wags-brand">wags</span> and create your first <span class="wags-brand">wags</span> enhanced server in minutes. See [`servers/github/`](https://github.com/chughtapan/wags/tree/main/servers/github) for a complete example.
15+
Connect to existing <span class="wags-brand">wags</span> servers and start using enhanced MCP features immediately.
16+
17+
- **[Onboarding New Servers](onboarding.md)**
18+
19+
Create your first <span class="wags-brand">wags</span> enhanced server with middleware. See [`servers/github/`](https://github.com/chughtapan/wags/tree/main/servers/github) for a complete example.
1620

1721
- **[Middleware](middleware/overview.md)**
1822

19-
Learn about available middleware and how to use them
23+
Learn about available middleware and how to use them.
24+
25+
- **[Running Evals](evals.md)**
26+
27+
Execute BFCL benchmarks to evaluate agent performance with <span class="wags-brand">wags</span> servers.
2028

2129
</div>

docs/middleware/todo.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,29 @@
1111
proxy = create_proxy(server, enable_todos=True)
1212
```
1313

14-
## Example Workflow
14+
## How it works?
1515

16-
```python
17-
# Agent receives task: "Build project and fix errors"
18-
19-
# 1. Agent calls TodoWrite
20-
TodoWrite(todos=[
21-
{"content": "Build project", "status": "pending"},
22-
{"content": "Fix errors", "status": "pending"}
23-
])
24-
25-
# 2. Agent starts first task
26-
TodoWrite(todos=[
27-
{"content": "Build project", "status": "in_progress"},
28-
{"content": "Fix errors", "status": "pending"}
29-
])
30-
31-
# 3. Agent runs build tool, finds 3 errors
32-
33-
# 4. Agent updates todos
34-
TodoWrite(todos=[
35-
{"content": "Build project", "status": "completed"},
36-
{"content": "Fix error in utils.py", "status": "in_progress"},
37-
{"content": "Fix error in api.py", "status": "pending"},
38-
{"content": "Fix error in models.py", "status": "pending"}
39-
])
40-
41-
# 5. Agent fixes each error, updating status after each one
42-
# ... continues until all completed
43-
```
16+
When todo integration is enabled, the target MCP server is provided TodoWrite tools which help track the detailed tasks to be done and the current progress. Additionally, detailed instructions are provided to break down task into actionable steps, update status before and after each task, maintain exactly one task as `in_progress`, mark completed immediately after finishing, etc.
4417

45-
## How it works?
18+
For example, when an agent receives the task "Build project and fix errors":
19+
20+
1. Agent calls `TodoWrite` to create initial todos:
21+
- "Build project" (pending)
22+
- "Fix errors" (pending)
23+
24+
2. Agent starts first task by updating status to `in_progress`
25+
26+
3. Agent runs build tool, finds 3 errors
27+
28+
4. Agent updates todos to reflect discovered errors:
29+
- "Build project" (completed)
30+
- "Fix error in utils.py" (in_progress)
31+
- "Fix error in api.py" (pending)
32+
- "Fix error in models.py" (pending)
33+
34+
5. Agent fixes each error, updating status after each one until all completed
4635

47-
When todo integration is enabled, the target MCP server is provided TodoWrite tools which help track the detailed tasks to be done and the current progress. Additionally, detailed instructions are provided to break down task into actionable steps, update status before and after each task, maintain exactly one task as `in_progress`, mark completed immediately after finishing, etc. See `src/wags/middleware/todo.py` for the full instruction text.
36+
See `src/wags/middleware/todo.py` for the full instruction text.
4837

4938
**Note:** Instructions from proxy server must be included in the agent prompt. For `fast-agent` the `{{serverInstructions}}` macro enables this feature.
5039

docs/onboarding.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Onboarding New Servers
2+
3+
Learn how to create a <span class="wags-brand">wags</span> proxy server that wraps existing MCP servers with middleware.
4+
5+
## Prerequisites
6+
7+
- <span class="wags-brand">wags</span> installed (see [Quick Start](quickstart.md) for installation)
8+
- Basic understanding of [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro)
9+
- An existing MCP server to work with
10+
11+
## Creating a <span class="wags-brand">wags</span> Proxy Server
12+
13+
<span class="wags-brand">wags</span> provides the `quickstart` command to generate proxy servers that wrap existing MCP servers with middleware.
14+
15+
!!! tip "Complete Example Available"
16+
The complete implementation for the [GitHub MCP Server](https://github.com/github/github-mcp-server) is in `servers/github/`.
17+
18+
### Step 1: Prepare Your MCP Server Configuration
19+
20+
Create a configuration file that describes your MCP server. Save it as `config.json`:
21+
22+
```json title="config.json"
23+
--8<-- "snippets/quickstart/config.json"
24+
```
25+
26+
### Step 2: Generate the Proxy Server
27+
28+
Use the `quickstart` command to generate middleware handlers and main file:
29+
30+
```bash
31+
# Generate both handlers and main files
32+
wags quickstart config.json
33+
34+
# Or with custom file names
35+
wags quickstart config.json \
36+
--handlers-file github_handlers.py \
37+
--main-file github_proxy.py
38+
```
39+
40+
### Step 3: Add Middleware Decorators
41+
42+
Edit the generated handlers file to add middleware decorators:
43+
44+
```python linenums="1" title="handlers.py"
45+
--8<-- "snippets/quickstart/handlers.py"
46+
```
47+
48+
### Step 4: Attach Middleware to your MCP Server
49+
50+
The automatically generated main.py includes (commented) code to attach <span class="wags-brand">wags</span> middleware to your MCP server. You should edit the file to uncomment the middleware you need:
51+
52+
```python linenums="1" title="main.py"
53+
--8<-- "snippets/quickstart/main.py"
54+
```
55+
56+
### Step 5: Run Your Proxy Server
57+
58+
```bash
59+
# Run directly
60+
python main.py
61+
62+
# Or use wags start-server
63+
wags start-server servers/your-server
64+
```
65+
66+
Your proxy server is now running!
67+
68+
### Step 6 (Optional): Add to Shared Configuration
69+
70+
To use your server with `wags run`, add it to `servers/fastagent.config.yaml`:
71+
72+
```yaml
73+
mcp:
74+
servers:
75+
your-server:
76+
transport: stdio
77+
command: wags
78+
args:
79+
- start-server
80+
- servers/your-server
81+
env:
82+
API_KEY: ${YOUR_API_KEY}
83+
roots:
84+
- uri: https://example.com/allowed
85+
name: "Allowed Resources"
86+
```
87+
88+
Now you can connect to your server with:
89+
90+
```bash
91+
wags run --servers your-server
92+
```
93+
94+
## Learn More
95+
96+
- **[Middleware Overview](middleware/overview.md)** - Understand how middleware works
97+
- **[Roots](middleware/roots.md)** - Access control with URI templates
98+
- **[Elicitation](middleware/elicitation.md)** - Parameter review and collection

docs/quickstart.md

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Quick Start Guide
22

3-
Get up and running with <span class="wags-brand">wags</span> in just a few minutes. This guide will walk you through installation and creating a proxy server with middleware for existing MCP servers.
3+
Get started with <span class="wags-brand">wags</span> by connecting to existing wags servers.
44

55
## Prerequisites
66

77
- Python 3.13.5 or higher
8-
- [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/) (recommended) or `pip`
9-
- Basic understanding of [MCP (Model Context Protocol)](https://modelcontextprotocol.io/docs/getting-started/intro)
10-
- An existing MCP server to work with
8+
- [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/)
119

1210
## Installation
1311

14-
> ⚠️ **Warning**: <span class="wags-brand">wags</span> is based on ongoing research and is under active development. Features and APIs may change.
12+
> ⚠️ **Warning**: <span class="wags-brand">wags</span> is based on ongoing research and is under active development. Features and APIs may change. Some experimental MCP features are only supported in our fork of [fast-agent](https://github.com/chughtapan/fast-agent) included with <span class="wags-brand">wags</span>.
1513
1614
```bash
1715
# Clone the repository
@@ -38,61 +36,24 @@ WAGS version 0.1.0
3836
FastMCP version x.x.x
3937
```
4038

41-
## Creating a <span class="wags-brand">wags</span> Proxy Server
39+
## Getting Started
4240

43-
<span class="wags-brand">wags</span> provides the `quickstart` command to generate proxy servers that wrap existing MCP servers with middleware.
44-
45-
!!! tip "Complete Example Available"
46-
The complete implementation for the [GitHub MCP Server](https://github.com/github/github-mcp-server) is in `servers/github/`.
47-
48-
### Step 1: Prepare Your MCP Server Configuration
49-
50-
Create a configuration file that describes your MCP server. Save it as `config.json`:
51-
52-
```json title="config.json"
53-
--8<-- "snippets/quickstart/config.json"
54-
```
55-
56-
### Step 2: Generate the Proxy Server
57-
58-
Use the `quickstart` command to generate middleware handlers and main file:
41+
The easiest way to connect to wags servers is using the `wags run` command:
5942

6043
```bash
61-
# Generate both handlers and main files
62-
wags quickstart config.json
63-
64-
# Or with custom file names
65-
wags quickstart config.json \
66-
--handlers-file github_handlers.py \
67-
--main-file github_proxy.py
68-
```
44+
# Connect to all configured servers
45+
wags run
6946

70-
### Step 3: Add Middleware Decorators
47+
# Connect to specific servers only
48+
wags run --servers github
7149

72-
Edit the generated handlers file to add middleware decorators:
73-
74-
```python linenums="1" title="handlers.py"
75-
--8<-- "snippets/quickstart/handlers.py"
76-
```
77-
78-
### Step 4: Attach Middleware to your MCP Server
79-
80-
The automatically generated main.py includes (commented) code to attach <span class="wags-brand">wags</span> middleware to your MCP server. You should edit the file to uncomment the middleware you need:
81-
82-
```python linenums="1" title="main.py"
83-
--8<-- "snippets/quickstart/main.py"
84-
```
85-
86-
### Step 5: Run Your Proxy Server
87-
88-
```bash
89-
python main.py
50+
# Use a different model
51+
wags run --model claude-3-5-sonnet-20241022
9052
```
9153

92-
Your proxy server is now running!
54+
`wags run` invokes fast-agent with a configuration file ([`servers/fastagent.config.yaml`](https://github.com/chughtapan/wags/blob/main/servers/fastagent.config.yaml)) and basic instructions ([`src/wags/utils/agent_instructions.txt`](https://github.com/chughtapan/wags/blob/main/src/wags/utils/agent_instructions.txt)), and connects to all servers by default. You can configure which servers to connect to using the `--servers` flag or create your own configuration and instruction files - see the [fast-agent documentation](https://github.com/chughtapan/fast-agent) for more details.
9355

94-
## Learn More
56+
## Next Steps
9557

96-
- **[Middleware Overview](middleware/overview.md)** - Understand how middleware works
97-
- **[Roots](middleware/roots.md)** - Access control with URI templates
98-
- **[Elicitation](middleware/elicitation.md)** - Parameter review and collection
58+
- **[Onboarding New Servers](onboarding.md)** - Create your own wags server with middleware
59+
- **[Middleware Overview](middleware/overview.md)** - Understand available middleware features

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ theme:
3838
nav:
3939
- Home: index.md
4040
- Quick Start: quickstart.md
41+
- Onboarding Servers: onboarding.md
4142
- Middleware:
4243
- Overview: middleware/overview.md
4344
- TodoList: middleware/todo.md
4445
- Roots: middleware/roots.md
4546
- Elicitation: middleware/elicitation.md
46-
- Benchmarks: benchmarks.md
47+
- Running Evals: evals.md
4748

4849
plugins:
4950
- search

servers/fastagent.config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
mcp:
2+
servers:
3+
github:
4+
transport: stdio
5+
command: wags
6+
args:
7+
- start-server
8+
- servers/github
9+
env:
10+
GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_PERSONAL_ACCESS_TOKEN}
11+
roots:
12+
- uri: https://github.com/anthropics/courses
13+
name: "Anthropics Courses"
14+
- uri: https://github.com/modelcontextprotocol/
15+
name: "MCP Organization"

0 commit comments

Comments
 (0)