roast-ai 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/CLAUDE.md +3 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +15 -10
- data/README.md +189 -20
- data/bin/roast +1 -1
- data/examples/bash_prototyping/README.md +53 -0
- data/examples/bash_prototyping/analyze_network/prompt.md +13 -0
- data/examples/bash_prototyping/analyze_system/prompt.md +11 -0
- data/examples/bash_prototyping/api_testing.yml +14 -0
- data/examples/bash_prototyping/check_processes/prompt.md +11 -0
- data/examples/bash_prototyping/generate_report/prompt.md +16 -0
- data/examples/bash_prototyping/process_json_response/prompt.md +24 -0
- data/examples/bash_prototyping/system_analysis.yml +14 -0
- data/examples/bash_prototyping/test_public_api/prompt.md +22 -0
- data/examples/cmd/README.md +99 -0
- data/examples/cmd/analyze_project/prompt.md +57 -0
- data/examples/cmd/basic_demo/prompt.md +48 -0
- data/examples/cmd/basic_workflow.yml +17 -0
- data/examples/cmd/check_repository/prompt.md +57 -0
- data/examples/cmd/create_and_verify/prompt.md +56 -0
- data/examples/cmd/dev_workflow.yml +26 -0
- data/examples/cmd/explore_project/prompt.md +67 -0
- data/examples/cmd/explorer_workflow.yml +21 -0
- data/examples/cmd/smart_tool_selection/prompt.md +99 -0
- data/examples/grading/read_dependencies/prompt.md +4 -2
- data/examples/grading/run_coverage.rb +9 -0
- data/examples/grading/workflow.yml +0 -2
- data/examples/mcp/README.md +223 -0
- data/examples/mcp/analyze_changes/prompt.md +8 -0
- data/examples/mcp/analyze_issues/prompt.md +4 -0
- data/examples/mcp/analyze_schema/prompt.md +4 -0
- data/examples/mcp/check_data_quality/prompt.md +5 -0
- data/examples/mcp/check_documentation/prompt.md +4 -0
- data/examples/mcp/create_recommendations/prompt.md +5 -0
- data/examples/mcp/database_workflow.yml +29 -0
- data/examples/mcp/env_demo/workflow.yml +34 -0
- data/examples/mcp/fetch_pr_context/prompt.md +4 -0
- data/examples/mcp/filesystem_demo/create_test_file/prompt.md +2 -0
- data/examples/mcp/filesystem_demo/list_files/prompt.md +6 -0
- data/examples/mcp/filesystem_demo/read_with_mcp/prompt.md +7 -0
- data/examples/mcp/filesystem_demo/workflow.yml +38 -0
- data/examples/mcp/generate_insights/prompt.md +4 -0
- data/examples/mcp/generate_report/prompt.md +6 -0
- data/examples/mcp/generate_review/prompt.md +16 -0
- data/examples/mcp/github_workflow.yml +32 -0
- data/examples/mcp/multi_mcp_workflow.yml +58 -0
- data/examples/mcp/post_review/prompt.md +3 -0
- data/examples/mcp/save_report/prompt.md +6 -0
- data/examples/mcp/search_issues/prompt.md +2 -0
- data/examples/mcp/summarize/prompt.md +1 -0
- data/examples/mcp/test_filesystem/prompt.md +6 -0
- data/examples/mcp/test_github/prompt.md +8 -0
- data/examples/mcp/test_read/prompt.md +1 -0
- data/examples/mcp/workflow.yml +35 -0
- data/examples/shared_config/README.md +52 -0
- data/examples/shared_config/example_with_shared_config/workflow.yml +6 -0
- data/examples/shared_config/shared.yml +7 -0
- data/examples/step_configuration/README.md +0 -3
- data/examples/step_configuration/workflow.yml +0 -3
- data/examples/tool_config_example/README.md +109 -0
- data/examples/tool_config_example/example_step/prompt.md +42 -0
- data/examples/tool_config_example/workflow.yml +17 -0
- data/examples/workflow_generator/workflow.yml +0 -1
- data/lib/roast/helpers/function_caching_interceptor.rb +0 -4
- data/lib/roast/helpers/prompt_loader.rb +0 -1
- data/lib/roast/tools/bash.rb +62 -0
- data/lib/roast/tools/cmd.rb +121 -34
- data/lib/roast/tools/coding_agent.rb +86 -7
- data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +87 -0
- data/lib/roast/tools/search_file.rb +13 -1
- data/lib/roast/tools.rb +5 -5
- data/lib/roast/version.rb +1 -1
- data/lib/roast/workflow/base_step.rb +29 -21
- data/lib/roast/workflow/base_workflow.rb +8 -10
- data/lib/roast/workflow/configuration.rb +12 -3
- data/lib/roast/workflow/configuration_loader.rb +63 -4
- data/lib/roast/workflow/configuration_parser.rb +0 -3
- data/lib/roast/workflow/error_handler.rb +0 -1
- data/lib/roast/workflow/file_state_repository.rb +0 -1
- data/lib/roast/workflow/iteration_executor.rb +0 -1
- data/lib/roast/workflow/output_manager.rb +0 -1
- data/lib/roast/workflow/step_executor_coordinator.rb +5 -3
- data/lib/roast/workflow/step_executors/hash_step_executor.rb +1 -1
- data/lib/roast/workflow/step_loader.rb +35 -8
- data/lib/roast/workflow/step_orchestrator.rb +4 -2
- data/lib/roast/workflow/workflow_execution_context.rb +0 -2
- data/lib/roast/workflow/workflow_executor.rb +1 -3
- data/lib/roast/workflow/workflow_initializer.rb +66 -2
- data/lib/roast/workflow/workflow_runner.rb +1 -2
- data/lib/roast.rb +8 -0
- data/package-lock.json +6 -0
- data/roast.gemspec +2 -1
- metadata +72 -3
@@ -0,0 +1,223 @@
|
|
1
|
+
# MCP (Model Context Protocol) Tools
|
2
|
+
|
3
|
+
This example demonstrates how to use MCP tools in Roast workflows. MCP is an open standard that enables seamless integration between AI applications and external data sources and tools.
|
4
|
+
|
5
|
+
## What are MCP Tools?
|
6
|
+
|
7
|
+
MCP tools allow your Roast workflows to connect to external services and tools through a standardized protocol. This enables:
|
8
|
+
|
9
|
+
- Access to external APIs and services
|
10
|
+
- Integration with databases and file systems
|
11
|
+
- Connection to specialized tools and platforms
|
12
|
+
- Real-time data access during workflow execution
|
13
|
+
|
14
|
+
## Configuration
|
15
|
+
|
16
|
+
MCP tools are configured in the `tools` section of your workflow YAML file. Roast supports two types of MCP connections:
|
17
|
+
|
18
|
+
### 1. SSE (Server-Sent Events) MCP Tools
|
19
|
+
|
20
|
+
Connect to HTTP endpoints that implement the MCP protocol:
|
21
|
+
|
22
|
+
```yaml
|
23
|
+
tools:
|
24
|
+
- Tool Name:
|
25
|
+
url: https://example.com/mcp-endpoint
|
26
|
+
env:
|
27
|
+
- "Authorization: Bearer {{resource.api_token}}"
|
28
|
+
only:
|
29
|
+
- allowed_function_1
|
30
|
+
- allowed_function_2
|
31
|
+
```
|
32
|
+
|
33
|
+
### 2. Stdio MCP Tools
|
34
|
+
|
35
|
+
Connect to local processes that implement the MCP protocol:
|
36
|
+
|
37
|
+
```yaml
|
38
|
+
tools:
|
39
|
+
- Tool Name:
|
40
|
+
command: docker
|
41
|
+
args:
|
42
|
+
- run
|
43
|
+
- -i
|
44
|
+
- --rm
|
45
|
+
- ghcr.io/example/mcp-server
|
46
|
+
env:
|
47
|
+
API_KEY: "{{env.API_KEY}}"
|
48
|
+
except:
|
49
|
+
- dangerous_function
|
50
|
+
```
|
51
|
+
|
52
|
+
## Parameters
|
53
|
+
|
54
|
+
- **`url`** (SSE only): The HTTP(S) endpoint URL for the MCP server
|
55
|
+
- **`command`** (stdio only): The command to execute
|
56
|
+
- **`args`** (stdio only): Array of command-line arguments
|
57
|
+
- **`env`**: Headers (SSE) or environment variables (stdio)
|
58
|
+
- **`only`**: Whitelist of functions to include
|
59
|
+
- **`except`**: Blacklist of functions to exclude
|
60
|
+
|
61
|
+
## Example Workflow
|
62
|
+
|
63
|
+
The `workflow.yml` in this directory shows a simple example using GitMCP to read documentation:
|
64
|
+
|
65
|
+
```yaml
|
66
|
+
name: MCP Tools Example
|
67
|
+
model: gpt-4o-mini
|
68
|
+
tools:
|
69
|
+
- Roast Docs:
|
70
|
+
url: https://gitmcp.io/Shopify/roast/docs
|
71
|
+
|
72
|
+
steps:
|
73
|
+
- get_doc: Read the Roast docs, and tell me how to use MCP tools.
|
74
|
+
- summarize
|
75
|
+
|
76
|
+
summarize:
|
77
|
+
print_response: true
|
78
|
+
```
|
79
|
+
|
80
|
+
## Running the Examples
|
81
|
+
|
82
|
+
### Simple Example (no authentication required)
|
83
|
+
|
84
|
+
```bash
|
85
|
+
# Run the basic MCP example
|
86
|
+
roast execute examples/mcp/workflow.yml
|
87
|
+
|
88
|
+
# Run the multi-tool example
|
89
|
+
roast execute examples/mcp/multi_mcp_workflow.yml
|
90
|
+
```
|
91
|
+
|
92
|
+
### GitHub Example (requires GitHub token)
|
93
|
+
|
94
|
+
```bash
|
95
|
+
# Set your GitHub token first
|
96
|
+
export GITHUB_TOKEN="your-github-personal-access-token"
|
97
|
+
|
98
|
+
# Run the GitHub workflow
|
99
|
+
roast execute examples/mcp/github_workflow.yml
|
100
|
+
```
|
101
|
+
|
102
|
+
### Filesystem Example
|
103
|
+
|
104
|
+
```bash
|
105
|
+
# This uses the filesystem MCP server to safely browse /tmp
|
106
|
+
roast execute examples/mcp/filesystem_demo/workflow.yml
|
107
|
+
```
|
108
|
+
|
109
|
+
## More Examples
|
110
|
+
|
111
|
+
### GitHub Integration
|
112
|
+
|
113
|
+
```yaml
|
114
|
+
tools:
|
115
|
+
- GitHub:
|
116
|
+
command: npx
|
117
|
+
args: ["-y", "@modelcontextprotocol/server-github"]
|
118
|
+
env:
|
119
|
+
GITHUB_PERSONAL_ACCESS_TOKEN: "{{env.GITHUB_TOKEN}}"
|
120
|
+
only:
|
121
|
+
- search_repositories
|
122
|
+
- get_issue
|
123
|
+
- create_issue
|
124
|
+
```
|
125
|
+
|
126
|
+
### Database Access
|
127
|
+
|
128
|
+
```yaml
|
129
|
+
tools:
|
130
|
+
- Database:
|
131
|
+
command: npx
|
132
|
+
args: ["-y", "@modelcontextprotocol/server-postgres"]
|
133
|
+
env:
|
134
|
+
DATABASE_URL: "{{env.DATABASE_URL}}"
|
135
|
+
only:
|
136
|
+
- query
|
137
|
+
- list_tables
|
138
|
+
```
|
139
|
+
|
140
|
+
### Using Multiple MCP Tools
|
141
|
+
|
142
|
+
You can combine MCP tools with traditional Roast tools:
|
143
|
+
|
144
|
+
```yaml
|
145
|
+
tools:
|
146
|
+
# Traditional Roast tools
|
147
|
+
- Roast::Tools::ReadFile
|
148
|
+
- Roast::Tools::WriteFile
|
149
|
+
|
150
|
+
# MCP tools
|
151
|
+
- External API:
|
152
|
+
url: https://api.example.com/mcp
|
153
|
+
- Local Tool:
|
154
|
+
command: ./my-mcp-server
|
155
|
+
```
|
156
|
+
|
157
|
+
## Installing and Using MCP Servers
|
158
|
+
|
159
|
+
MCP servers can be run in different ways:
|
160
|
+
|
161
|
+
### Using npx (recommended for testing)
|
162
|
+
|
163
|
+
Most official MCP servers can be run directly with npx without installation:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
# These are automatically downloaded and run when used in workflows
|
167
|
+
npx -y @modelcontextprotocol/server-github
|
168
|
+
npx -y @modelcontextprotocol/server-filesystem /path/to/allow
|
169
|
+
npx -y @modelcontextprotocol/server-sqlite /path/to/database.db
|
170
|
+
```
|
171
|
+
|
172
|
+
### Installing globally
|
173
|
+
|
174
|
+
For production use, you might want to install servers globally:
|
175
|
+
|
176
|
+
```bash
|
177
|
+
npm install -g @modelcontextprotocol/server-github
|
178
|
+
npm install -g @modelcontextprotocol/server-filesystem
|
179
|
+
```
|
180
|
+
|
181
|
+
### Available MCP Servers
|
182
|
+
|
183
|
+
Popular MCP servers you can use:
|
184
|
+
|
185
|
+
- **@modelcontextprotocol/server-filesystem**: Safe filesystem access
|
186
|
+
- **@modelcontextprotocol/server-github**: GitHub API integration (requires token)
|
187
|
+
- **@modelcontextprotocol/server-gitlab**: GitLab API integration
|
188
|
+
- **@modelcontextprotocol/server-google-drive**: Google Drive access
|
189
|
+
- **@modelcontextprotocol/server-slack**: Slack integration
|
190
|
+
- **@modelcontextprotocol/server-postgres**: PostgreSQL database access
|
191
|
+
- **@modelcontextprotocol/server-sqlite**: SQLite database access
|
192
|
+
|
193
|
+
For more MCP servers, visit: https://github.com/modelcontextprotocol/servers
|
194
|
+
|
195
|
+
## Troubleshooting
|
196
|
+
|
197
|
+
### Common Issues
|
198
|
+
|
199
|
+
1. **"No such file or directory" error**
|
200
|
+
- Make sure `npx` is installed: `which npx`
|
201
|
+
- For local commands, ensure they're in your PATH
|
202
|
+
|
203
|
+
2. **"Bad credentials" or authentication errors**
|
204
|
+
- Check that your environment variables are set correctly
|
205
|
+
- Use `{{ENV['VAR_NAME']}}` syntax for interpolation
|
206
|
+
- Test with: `echo $GITHUB_TOKEN` to verify it's set
|
207
|
+
|
208
|
+
3. **MCP server doesn't start**
|
209
|
+
- Try running the command manually first: `npx -y @modelcontextprotocol/server-filesystem /tmp`
|
210
|
+
- Check for any npm/node errors
|
211
|
+
|
212
|
+
4. **"Step not found" errors**
|
213
|
+
- Inline prompts in the workflow use the syntax: `step_name: prompt text`
|
214
|
+
- For multi-line prompts use: `step_name: |` followed by indented text
|
215
|
+
- For separate prompt files: create `step_name/prompt.md` in the workflow directory
|
216
|
+
|
217
|
+
## Security Notes
|
218
|
+
|
219
|
+
- Never hardcode credentials - use environment variables
|
220
|
+
- Use `only` to limit function access when possible
|
221
|
+
- Be cautious with stdio tools as they execute local processes
|
222
|
+
- Review MCP server documentation for security best practices
|
223
|
+
- The filesystem server only allows access to specified directories
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# MCP Database Integration Example
|
2
|
+
# This workflow demonstrates using a PostgreSQL MCP server for database operations
|
3
|
+
|
4
|
+
name: Database Analysis Workflow
|
5
|
+
model: gpt-4o-mini
|
6
|
+
|
7
|
+
tools:
|
8
|
+
# PostgreSQL MCP tool
|
9
|
+
- Database:
|
10
|
+
command: npx
|
11
|
+
args:
|
12
|
+
- "-y"
|
13
|
+
- "@modelcontextprotocol/server-postgres"
|
14
|
+
env:
|
15
|
+
DATABASE_URL: "{{env.DATABASE_URL}}"
|
16
|
+
only:
|
17
|
+
- query
|
18
|
+
- list_tables
|
19
|
+
- describe_table
|
20
|
+
- get_schema
|
21
|
+
|
22
|
+
steps:
|
23
|
+
- analyze_schema
|
24
|
+
- check_data_quality
|
25
|
+
- generate_insights
|
26
|
+
- create_recommendations
|
27
|
+
|
28
|
+
create_recommendations:
|
29
|
+
print_response: true
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Environment Variable Interpolation Demo
|
2
|
+
# This shows how ENV variables are interpolated in MCP tool configurations
|
3
|
+
|
4
|
+
name: ENV Interpolation Demo
|
5
|
+
model: o4-mini
|
6
|
+
|
7
|
+
tools:
|
8
|
+
- Roast::Tools::ReadFile
|
9
|
+
|
10
|
+
# Filesystem MCP with interpolated path
|
11
|
+
# The user's home directory will be resolved from ENV['HOME']
|
12
|
+
- UserFiles:
|
13
|
+
command: npx
|
14
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "{{ENV['HOME'] || '/tmp'}}"]
|
15
|
+
only:
|
16
|
+
- list_directory
|
17
|
+
- get_file_info
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- show_env: |
|
21
|
+
First, tell me what user is running this workflow. The current user is: {{ENV['USER'] || 'unknown'}}
|
22
|
+
And their home directory is: {{ENV['HOME'] || 'not set'}}
|
23
|
+
|
24
|
+
- list_home: |
|
25
|
+
Now use the UserFiles MCP tool's list_directory function to list the user's home directory.
|
26
|
+
Just show the first 5-10 items you find.
|
27
|
+
|
28
|
+
|
29
|
+
show_env:
|
30
|
+
print_response: true
|
31
|
+
|
32
|
+
list_home:
|
33
|
+
model: gpt-4o-mini
|
34
|
+
print_response: true
|
@@ -0,0 +1,7 @@
|
|
1
|
+
If you found any .txt, .md, or .log files in /tmp from the previous step, pick one and read it using the
|
2
|
+
FileSystem MCP tool's read_file function.
|
3
|
+
|
4
|
+
The function expects these parameters:
|
5
|
+
- path: (the full path to the file you want to read)
|
6
|
+
|
7
|
+
If no suitable text files were found, just say "No text files found in /tmp to read".
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Filesystem MCP Example
|
2
|
+
# This uses the filesystem MCP server which provides safe file operations
|
3
|
+
|
4
|
+
name: Filesystem MCP Example
|
5
|
+
model: gpt-4o-mini
|
6
|
+
|
7
|
+
tools:
|
8
|
+
# Traditional Roast tools
|
9
|
+
- Roast::Tools::ReadFile
|
10
|
+
|
11
|
+
# Filesystem MCP server
|
12
|
+
- FileSystem:
|
13
|
+
command: npx
|
14
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
|
15
|
+
only:
|
16
|
+
- read_file
|
17
|
+
- list_directory
|
18
|
+
- get_file_info
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- create_test_file
|
22
|
+
- list_files
|
23
|
+
- read_with_mcp
|
24
|
+
|
25
|
+
create_test_file:
|
26
|
+
prompt: |
|
27
|
+
First, use the read_file Roast tool to read this workflow file itself (examples/mcp/filesystem_demo/workflow.yml).
|
28
|
+
This is just to verify traditional tools work.
|
29
|
+
|
30
|
+
list_files:
|
31
|
+
prompt: |
|
32
|
+
Use the FileSystem MCP tool's list_directory function to list the contents of the /tmp directory.
|
33
|
+
The function expects a "path" parameter with value "/tmp".
|
34
|
+
|
35
|
+
read_with_mcp:
|
36
|
+
prompt: |
|
37
|
+
If you see any .txt or .md files in /tmp from the previous step, try reading one with the
|
38
|
+
FileSystem MCP tool's read_file function. Otherwise, just say "No text files found in /tmp".
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Generate a structured code review with:
|
2
|
+
{
|
3
|
+
"summary": "Overall assessment",
|
4
|
+
"approval_status": "approve|request_changes|comment",
|
5
|
+
"issues": [
|
6
|
+
{
|
7
|
+
"severity": "critical|major|minor",
|
8
|
+
"file": "filename",
|
9
|
+
"line": 123,
|
10
|
+
"description": "Issue description",
|
11
|
+
"suggestion": "How to fix"
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"positive_feedback": ["What was done well"],
|
15
|
+
"documentation_updates": ["Required doc changes"]
|
16
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# MCP GitHub Integration Example
|
2
|
+
# This workflow demonstrates using the GitHub MCP server to interact with repositories
|
3
|
+
|
4
|
+
name: GitHub Issue Analyzer
|
5
|
+
model: gpt-4o-mini
|
6
|
+
|
7
|
+
tools:
|
8
|
+
# Traditional Roast tool for writing output
|
9
|
+
- Roast::Tools::WriteFile
|
10
|
+
|
11
|
+
# GitHub MCP tool - using npx to run the server
|
12
|
+
- GitHub:
|
13
|
+
command: npx
|
14
|
+
args:
|
15
|
+
- "-y"
|
16
|
+
- "@modelcontextprotocol/server-github"
|
17
|
+
env:
|
18
|
+
GITHUB_PERSONAL_ACCESS_TOKEN: "{{env.GITHUB_TOKEN}}"
|
19
|
+
only:
|
20
|
+
- search_repositories
|
21
|
+
- get_repository
|
22
|
+
- get_issue
|
23
|
+
- list_issues
|
24
|
+
- create_issue
|
25
|
+
- create_pull_request
|
26
|
+
- search_code
|
27
|
+
|
28
|
+
steps:
|
29
|
+
- search_issues
|
30
|
+
- analyze_issues
|
31
|
+
- generate_report
|
32
|
+
- save_report
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Multi-MCP Integration Example
|
2
|
+
# This workflow combines multiple MCP tools with traditional Roast tools
|
3
|
+
|
4
|
+
name: Code Review Assistant
|
5
|
+
model: gpt-4o-mini
|
6
|
+
target: "README.md" # Use a static file for testing
|
7
|
+
|
8
|
+
tools:
|
9
|
+
# Traditional Roast tools
|
10
|
+
- Roast::Tools::ReadFile
|
11
|
+
- Roast::Tools::Grep
|
12
|
+
- Roast::Tools::WriteFile
|
13
|
+
|
14
|
+
# Multiple MCP tools
|
15
|
+
# - GitDocs:
|
16
|
+
# url: https://gitmcp.io/{{ENV['REPO_OWNER']}}/{{ENV['REPO_NAME']}}/docs
|
17
|
+
# env:
|
18
|
+
# Accept: application/json
|
19
|
+
|
20
|
+
# GitHub MCP (requires GITHUB_TOKEN environment variable)
|
21
|
+
# Uncomment to use:
|
22
|
+
# - GitHub:
|
23
|
+
# command: npx
|
24
|
+
# args: ["-y", "@modelcontextprotocol/server-github"]
|
25
|
+
# env:
|
26
|
+
# GITHUB_PERSONAL_ACCESS_TOKEN: "{{ENV['GITHUB_TOKEN']}}"
|
27
|
+
# only:
|
28
|
+
# - get_pull_request
|
29
|
+
# - create_pull_request_comment
|
30
|
+
# - get_file_content
|
31
|
+
|
32
|
+
# Filesystem MCP (no auth required)
|
33
|
+
- FileSystem:
|
34
|
+
command: npx
|
35
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
|
36
|
+
only:
|
37
|
+
- read_file
|
38
|
+
- list_directory
|
39
|
+
|
40
|
+
# - Linter:
|
41
|
+
# command: ./custom-linter-mcp
|
42
|
+
# env:
|
43
|
+
# CONFIG_PATH: "{{ENV['LINTER_CONFIG']}}"
|
44
|
+
# only:
|
45
|
+
# - analyze_code
|
46
|
+
# - suggest_fixes
|
47
|
+
|
48
|
+
steps:
|
49
|
+
- test_read
|
50
|
+
- test_filesystem
|
51
|
+
|
52
|
+
test_read:
|
53
|
+
prompt: Use the ReadFile tool to read the README.md file
|
54
|
+
|
55
|
+
test_filesystem:
|
56
|
+
prompt: |
|
57
|
+
Use the FileSystem MCP tool's list_directory function to list the current directory.
|
58
|
+
Then pick an interesting file and read it with the read_file function.
|
@@ -0,0 +1 @@
|
|
1
|
+
Generate a brief summary, with one code example, in Markdown format.
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Use the FileSystem MCP tool to explore the current directory:
|
2
|
+
|
3
|
+
1. First, use the list_directory function with path "." to see what files are here
|
4
|
+
2. Then pick one interesting file (like a .yml or .md file) and read it using the read_file function
|
5
|
+
|
6
|
+
This demonstrates using MCP tools for filesystem access.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Use the GitHub MCP tool's get_file_content function to fetch the README.md from the Shopify/roast repository.
|
2
|
+
|
3
|
+
The function should be called with these parameters:
|
4
|
+
- owner: "Shopify"
|
5
|
+
- repo: "roast"
|
6
|
+
- path: "README.md"
|
7
|
+
|
8
|
+
Then summarize what the README contains.
|
@@ -0,0 +1 @@
|
|
1
|
+
Use the read_file function to read the README.md file in the current directory and summarize what it contains.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# usage: roast execute examples/mcp/workflow.yml -o output.md
|
2
|
+
|
3
|
+
name: MCP Tools Example
|
4
|
+
model: gpt-4o-mini
|
5
|
+
tools:
|
6
|
+
# SSE MCP:
|
7
|
+
- Roast Docs:
|
8
|
+
url: https://gitmcp.io/Shopify/roast/docs
|
9
|
+
# Can pass headers for authentication
|
10
|
+
# env:
|
11
|
+
# - "Authorization: Bearer {{resource.api_token}}"
|
12
|
+
# stdio MCPs are also supported
|
13
|
+
# - GitHub:
|
14
|
+
# command: "docker",
|
15
|
+
# args:
|
16
|
+
# - "run"
|
17
|
+
# - "-i"
|
18
|
+
# - "--rm"
|
19
|
+
# - "-e"
|
20
|
+
# - "GITHUB_PERSONAL_ACCESS_TOKEN"
|
21
|
+
# - "ghcr.io/github/github-mcp-server"
|
22
|
+
# env:
|
23
|
+
# GITHUB_PERSONAL_ACCESS_TOKEN: "<YOUR_TOKEN>"
|
24
|
+
# only:
|
25
|
+
# - get_issue
|
26
|
+
# - get_issue_comments
|
27
|
+
# except:
|
28
|
+
# - create_issue
|
29
|
+
|
30
|
+
steps:
|
31
|
+
- get_doc: Read the Roast docs, and tell me how to use MCP tools.
|
32
|
+
- summarize
|
33
|
+
|
34
|
+
summarize:
|
35
|
+
print_response: true
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Shared Configuration Example
|
2
|
+
|
3
|
+
This example demonstrates how to use `shared.yml` to define common configuration anchors that can be referenced across multiple workflow files.
|
4
|
+
|
5
|
+
## Structure
|
6
|
+
|
7
|
+
```
|
8
|
+
├── shared.yml # Common configuration anchors
|
9
|
+
└── example_with_shared_config/
|
10
|
+
└── workflow.yml # Workflow using shared anchors
|
11
|
+
```
|
12
|
+
|
13
|
+
## How it works
|
14
|
+
|
15
|
+
1. When loading a workflow file, Roast checks if `shared.yml` exists one level above the workflow directory
|
16
|
+
2. If found, it loads `shared.yml` first, then the workflow file
|
17
|
+
3. This allows YAML anchors defined in `shared.yml` to be referenced in workflow files
|
18
|
+
|
19
|
+
## Example Usage
|
20
|
+
|
21
|
+
In `shared.yml`:
|
22
|
+
```yaml
|
23
|
+
standard_tools: &standard_tools
|
24
|
+
- Roast::Tools::Grep
|
25
|
+
- Roast::Tools::ReadFile
|
26
|
+
- Roast::Tools::WriteFile
|
27
|
+
- Roast::Tools::SearchFile
|
28
|
+
|
29
|
+
mirage: &mirage '$(echo "Oh my god. Its a mirage")'
|
30
|
+
```
|
31
|
+
|
32
|
+
In your workflow:
|
33
|
+
```yaml
|
34
|
+
name: Example with shared config
|
35
|
+
tools: *standard_tools # Reference the standard tools from shared.yml
|
36
|
+
|
37
|
+
steps:
|
38
|
+
- *mirage # Reference a shared step definition
|
39
|
+
- sabotage: '$(echo "Im tellin yall, its sabotage")'
|
40
|
+
```
|
41
|
+
|
42
|
+
## Running the Example
|
43
|
+
|
44
|
+
```bash
|
45
|
+
# Run the workflow that uses shared configuration
|
46
|
+
roast execute examples/shared_config/example_with_shared_config/workflow.yml
|
47
|
+
```
|
48
|
+
|
49
|
+
The workflow will:
|
50
|
+
1. Load the shared configuration from `shared.yml`
|
51
|
+
2. Apply the referenced tools and steps
|
52
|
+
3. Execute the workflow with the merged configuration
|