mcpgraph 0.1.19 → 0.1.21

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.
Files changed (52) hide show
  1. package/README.md +69 -48
  2. package/dist/api.d.ts +8 -4
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +13 -4
  5. package/dist/api.js.map +1 -1
  6. package/dist/config/expression-validator.d.ts.map +1 -1
  7. package/dist/config/expression-validator.js +12 -10
  8. package/dist/config/expression-validator.js.map +1 -1
  9. package/dist/config/loader.d.ts +8 -2
  10. package/dist/config/loader.d.ts.map +1 -1
  11. package/dist/config/loader.js +16 -2
  12. package/dist/config/loader.js.map +1 -1
  13. package/dist/config/mcp-loader.d.ts +13 -0
  14. package/dist/config/mcp-loader.d.ts.map +1 -0
  15. package/dist/config/mcp-loader.js +47 -0
  16. package/dist/config/mcp-loader.js.map +1 -0
  17. package/dist/config/schema.d.ts +292 -186
  18. package/dist/config/schema.d.ts.map +1 -1
  19. package/dist/config/schema.js +5 -6
  20. package/dist/config/schema.js.map +1 -1
  21. package/dist/errors/mcp-tool-error.d.ts +46 -0
  22. package/dist/errors/mcp-tool-error.d.ts.map +1 -0
  23. package/dist/errors/mcp-tool-error.js +63 -0
  24. package/dist/errors/mcp-tool-error.js.map +1 -0
  25. package/dist/execution/executor.d.ts +2 -2
  26. package/dist/execution/executor.d.ts.map +1 -1
  27. package/dist/execution/executor.js +11 -9
  28. package/dist/execution/executor.js.map +1 -1
  29. package/dist/execution/nodes/mcp-tool-executor.d.ts.map +1 -1
  30. package/dist/execution/nodes/mcp-tool-executor.js +49 -15
  31. package/dist/execution/nodes/mcp-tool-executor.js.map +1 -1
  32. package/dist/graph/validator.d.ts.map +1 -1
  33. package/dist/graph/validator.js +52 -69
  34. package/dist/graph/validator.js.map +1 -1
  35. package/dist/main.js +23 -5
  36. package/dist/main.js.map +1 -1
  37. package/dist/mcp/client-manager.d.ts +12 -0
  38. package/dist/mcp/client-manager.d.ts.map +1 -1
  39. package/dist/mcp/client-manager.js +38 -4
  40. package/dist/mcp/client-manager.js.map +1 -1
  41. package/dist/types/config.d.ts +4 -5
  42. package/dist/types/config.d.ts.map +1 -1
  43. package/docs/building.md +76 -0
  44. package/docs/design.md +55 -43
  45. package/docs/github-pages-setup.md +492 -0
  46. package/docs/introspection-debugging.md +1 -1
  47. package/examples/api-usage.ts +3 -3
  48. package/examples/count_files.yaml +47 -52
  49. package/examples/loop_example.yaml +55 -58
  50. package/examples/switch_example.yaml +48 -55
  51. package/examples/test_minimal.yaml +23 -0
  52. package/package.json +2 -2
@@ -0,0 +1,492 @@
1
+ # GitHub Pages Setup for Skills Distribution
2
+
3
+ This document describes how to set up GitHub Pages to host mcpGraph documentation and distribute the skills package as a downloadable zip file.
4
+
5
+ ## Overview
6
+
7
+ We'll use GitHub Pages to create a static site that:
8
+ 1. Hosts mcpGraph configuration documentation
9
+ 2. Provides a download link for the Agent Skills zip file
10
+ 3. Automatically updates when the skills directory changes
11
+
12
+ **Note:** The `/skills` directory follows the [Agent Skills specification](https://agentskills.io/), containing skill subdirectories with `SKILL.md` files that have YAML frontmatter and markdown content.
13
+
14
+ ## Repository Structure
15
+
16
+ ```
17
+ mcpGraph/
18
+ ├── skills/ # Agent Skills directory (https://agentskills.io/)
19
+ │ └── build-mcpgraph/ # Skill subdirectory
20
+ │ └── SKILL.md # Skill file with YAML frontmatter + markdown content
21
+ ├── docs/ # Existing documentation source (markdown files)
22
+ │ ├── design.md
23
+ │ ├── implementation.md
24
+ │ ├── introspection-debugging.md
25
+ │ └── github-pages-setup.md
26
+ ├── site/ # Jekyll site source (all site files isolated here)
27
+ │ ├── _config.yml # Jekyll configuration
28
+ │ ├── _layouts/ # Layout templates
29
+ │ ├── _includes/ # Partial templates
30
+ │ ├── _sass/ # Stylesheets
31
+ │ ├── assets/ # CSS, images, JS
32
+ │ ├── pages/ # Documentation pages (copied from /docs or written here)
33
+ │ ├── index.html # Landing page
34
+ │ └── downloads/ # Agent Skills zip placed here by workflow
35
+ │ └── skills.zip # Contains skills/ directory structure
36
+ ├── .github/
37
+ │ └── workflows/
38
+ │ └── build-pages.yml # GHA to build and deploy
39
+ └── package.json
40
+
41
+ # Generated output (not in repo):
42
+ # - Jekyll builds to site/_site/ (default, gitignored)
43
+ # - GitHub Actions copies _site/ contents to gh-pages branch
44
+ # - GitHub Pages serves from gh-pages branch
45
+ ```
46
+
47
+ **Key Points:**
48
+ - `/docs` stays as source markdown (no generated files)
49
+ - `/site` contains all Jekyll source files (isolated)
50
+ - Jekyll builds to `site/_site/` (default output, gitignored)
51
+ - GitHub Actions copies `_site/` to `gh-pages` branch
52
+ - GitHub Pages serves from `gh-pages` branch (not `/docs`)
53
+
54
+ ## GitHub Pages Configuration
55
+
56
+ We'll use the `gh-pages` branch for deployment:
57
+ - GitHub Pages serves from `gh-pages` branch
58
+ - Keeps source directories clean (no generated files in `/docs` or `/site`)
59
+ - Generated site is completely separate from source
60
+ - GitHub Actions builds and pushes to `gh-pages` branch automatically
61
+
62
+ ## Build and Deploy Process
63
+
64
+ ### Jekyll Build Process
65
+
66
+ **Local Development:**
67
+ ```bash
68
+ cd site
69
+ bundle exec jekyll build # Builds to site/_site/
70
+ bundle exec jekyll serve # Serves locally at http://localhost:4000
71
+ ```
72
+
73
+ **Production Build (via GitHub Actions):**
74
+ 1. Jekyll builds from `/site` directory
75
+ 2. Outputs to `site/_site/` (Jekyll default, gitignored)
76
+ 3. Skills zip is created and placed in `site/downloads/`
77
+ 4. Contents of `site/_site/` are copied to `gh-pages` branch
78
+ 5. GitHub Pages automatically serves from `gh-pages` branch
79
+
80
+ ### GitHub Actions Workflow: `build-pages.yml`
81
+
82
+ **Triggers:**
83
+ - Push to `main` branch when `/skills` directory changes
84
+ - Push to `main` branch when `/site` directory changes
85
+ - Manual workflow dispatch
86
+ - Scheduled (optional: daily check)
87
+
88
+ **Workflow Steps:**
89
+ 1. **Checkout repository**
90
+ 2. **Set up Ruby and Jekyll:**
91
+ - Install Ruby
92
+ - Install Bundler
93
+ - Install Jekyll and dependencies
94
+ 3. **Create skills zip:**
95
+ - Zip entire `/skills` directory (preserving subdirectory structure)
96
+ - Name it `skills.zip`
97
+ - Place in `site/downloads/` (so it's included in Jekyll build)
98
+ 4. **Build Jekyll site:**
99
+ - Change to `/site` directory
100
+ - Run `bundle exec jekyll build`
101
+ - Output goes to `site/_site/` (includes skills.zip in downloads/)
102
+ 5. **Deploy to gh-pages branch:**
103
+ - Checkout or create `gh-pages` branch
104
+ - Copy all contents from `site/_site/` to `gh-pages` branch root
105
+ - Commit and push to `gh-pages` branch
106
+ - GitHub Pages automatically deploys from `gh-pages` branch
107
+
108
+ **Note:** GitHub Pages will automatically rebuild and serve the site when `gh-pages` branch is updated.
109
+
110
+ ### Workflow Details
111
+
112
+ **Path filtering for skills changes:**
113
+ ```yaml
114
+ on:
115
+ push:
116
+ branches: [main]
117
+ paths:
118
+ - 'skills/**' # Trigger on any changes to skills directory
119
+ - '.github/workflows/build-pages.yml'
120
+ ```
121
+
122
+ **Note:** This will trigger when any skill subdirectory or `SKILL.md` file changes.
123
+
124
+ **Zip creation:**
125
+ - Use `zip` command or Node.js script
126
+ - Include all files in `/skills` directory
127
+ - Preserve directory structure
128
+
129
+
130
+ ## GitHub Pages Setup Steps
131
+
132
+ 1. **Enable GitHub Pages:**
133
+ - Go to repository Settings → Pages
134
+ - Source: Deploy from a branch
135
+ - Branch: `gh-pages` / folder: `/` (root)
136
+ - GitHub Actions will create and maintain `gh-pages` branch
137
+
138
+ 2. **Create initial Jekyll site structure:**
139
+ - Set up `/site` directory with Jekyll
140
+ - Create landing page with download link
141
+
142
+ 3. **Set up workflow:**
143
+ - Create `.github/workflows/build-pages.yml`
144
+ - Configure to build and deploy on skills changes
145
+
146
+ 4. **Test:**
147
+ - Make a change to `/skills` directory
148
+ - Push to trigger workflow
149
+ - Verify site updates at `https://[username].github.io/mcpGraph/`
150
+
151
+ ## Building the Jekyll Site
152
+
153
+ We'll build a proper website with Jekyll that includes:
154
+ - Navigation menu
155
+ - Styling and graphics
156
+ - Responsive design
157
+ - Professional appearance
158
+
159
+ ### Jekyll Setup
160
+
161
+ **Why Jekyll:**
162
+ - Native GitHub Pages support
163
+ - Markdown to HTML conversion built-in
164
+ - Theme support (can use GitHub Pages themes or custom)
165
+ - Liquid templating for navigation, menus, etc.
166
+ - All site files isolated in `/site` directory
167
+
168
+ **Structure - Isolated in `/site` directory:**
169
+ ```
170
+ mcpGraph/
171
+ ├── site/ # All Jekyll files isolated here
172
+ │ ├── _config.yml # Jekyll configuration
173
+ │ ├── _layouts/
174
+ │ │ ├── default.html # Base layout template
175
+ │ │ └── page.html # Page layout
176
+ │ ├── _includes/
177
+ │ │ ├── header.html # Site header/navigation
178
+ │ │ ├── footer.html # Site footer
179
+ │ │ └── sidebar.html # Optional sidebar
180
+ │ ├── _sass/ # SCSS stylesheets
181
+ │ │ └── main.scss
182
+ │ ├── assets/
183
+ │ │ ├── css/
184
+ │ │ │ └── style.css # Compiled CSS
185
+ │ │ ├── images/ # Graphics, logos, etc.
186
+ │ │ └── js/ # JavaScript if needed
187
+ │ ├── index.html # Landing page (front matter for Jekyll)
188
+ │ ├── pages/ # Documentation source
189
+ │ │ ├── configuration-guide.md
190
+ │ │ ├── design.md
191
+ │ │ └── ...
192
+ │ └── downloads/ # Skills zip will be placed here
193
+ │ └── skills.zip
194
+ ├── skills/ # Agent Skills directory (Agent Skills spec)
195
+ │ └── build-mcpgraph/ # Skill subdirectory
196
+ │ └── SKILL.md # YAML frontmatter + markdown
197
+ └── ... # Rest of repo (clean, no Jekyll clutter)
198
+ ```
199
+
200
+ **Key Configuration:**
201
+ - All Jekyll source files in `/site` directory
202
+ - Build output goes to `site/_site/` (Jekyll default, gitignored)
203
+ - GitHub Actions copies `_site/` to `gh-pages` branch
204
+ - Repository root stays clean
205
+ - Skills directory follows [Agent Skills specification](https://agentskills.io/)
206
+
207
+ **Jekyll Configuration (`site/_config.yml`):**
208
+ ```yaml
209
+ title: mcpGraph
210
+ description: MCP server for executing directed graphs
211
+ theme: minima # Or use custom theme
212
+ plugins:
213
+ - jekyll-feed
214
+ - jekyll-sitemap
215
+
216
+ # Source (relative to site/ directory)
217
+ source: .
218
+
219
+ # Destination (Jekyll default is _site/, which is fine)
220
+ # No need to specify - uses default _site/ output directory
221
+
222
+ # Base URL for GitHub Pages
223
+ baseurl: "" # Or "/mcpGraph" if using project pages
224
+ url: "https://[username].github.io"
225
+
226
+ # Navigation
227
+ navigation:
228
+ - title: Home
229
+ url: /
230
+ - title: Configuration Guide
231
+ url: /pages/configuration-guide
232
+ - title: Design
233
+ url: /pages/design
234
+ - title: Download Skills
235
+ url: /downloads/skills.zip
236
+ ```
237
+
238
+ **Build Process:**
239
+ 1. Jekyll builds from `/site` directory
240
+ 2. Output goes to `site/_site/` (Jekyll default, gitignored)
241
+ 3. GitHub Actions workflow:
242
+ - Builds Jekyll site
243
+ - Creates skills zip
244
+ - Copies `_site/` contents to `gh-pages` branch
245
+ 4. GitHub Pages serves from `gh-pages` branch
246
+ 5. Source directories (`/docs`, `/site`) remain clean - no generated files
247
+
248
+ **Benefits:**
249
+ - Repository root stays clean (no Jekyll clutter)
250
+ - All site files isolated in `/site`
251
+ - Markdown files become HTML pages automatically
252
+ - Easy to add navigation, menus, search
253
+ - Can use existing Jekyll themes or build custom
254
+ - Clear separation between site and project files
255
+
256
+
257
+ ## Site Features to Include
258
+
259
+ ### Navigation Menu
260
+ - Home
261
+ - Documentation sections
262
+ - Download Skills link
263
+ - GitHub repository link
264
+ - Search (if using Jekyll with search plugin)
265
+
266
+ ### Landing Page
267
+ - Hero section with mcpGraph description
268
+ - Quick start guide
269
+ - Download section (prominent skills.zip link)
270
+ - Documentation overview
271
+ - Examples/use cases
272
+
273
+ ### Documentation Pages
274
+ - Sidebar navigation
275
+ - Table of contents
276
+ - Code syntax highlighting
277
+ - Responsive design
278
+ - Print-friendly styles
279
+
280
+ ### Styling
281
+ - Professional color scheme
282
+ - mcpGraph branding/logo
283
+ - Consistent typography
284
+ - Mobile-responsive
285
+ - Accessible design
286
+
287
+ ## Assets to Include
288
+
289
+ - **Logo/Icon** - mcpGraph logo
290
+ - **Graphics** - Diagrams, flowcharts, architecture diagrams
291
+ - **Screenshots** - Example configurations, visualizations
292
+ - **Favicon** - Site favicon
293
+ - **CSS** - Custom stylesheets
294
+ - **Fonts** - Web fonts if desired
295
+
296
+ ## Complete GitHub Actions Workflow Example
297
+
298
+ Here's a complete workflow file for building and deploying the Jekyll site:
299
+
300
+ **File: `.github/workflows/build-pages.yml`**
301
+ ```yaml
302
+ name: Build and Deploy Site
303
+
304
+ on:
305
+ push:
306
+ branches: [main]
307
+ paths:
308
+ - 'skills/**'
309
+ - 'site/**'
310
+ - '.github/workflows/build-pages.yml'
311
+ workflow_dispatch: # Allow manual triggering
312
+
313
+ jobs:
314
+ build-and-deploy:
315
+ runs-on: ubuntu-latest
316
+ permissions:
317
+ contents: write # Required to push to gh-pages branch
318
+
319
+ steps:
320
+ - name: Checkout repository
321
+ uses: actions/checkout@v4
322
+
323
+ - name: Set up Ruby
324
+ uses: ruby/setup-ruby@v1
325
+ with:
326
+ ruby-version: '3.1'
327
+ bundler-cache: true
328
+ working-directory: ./site
329
+
330
+ - name: Install Jekyll dependencies
331
+ working-directory: ./site
332
+ run: bundle install
333
+
334
+ - name: Create skills zip
335
+ run: |
336
+ cd skills
337
+ zip -r ../site/downloads/skills.zip .
338
+ # Creates: site/downloads/skills.zip
339
+ # This will be included in Jekyll build output
340
+
341
+ - name: Build Jekyll site
342
+ working-directory: ./site
343
+ run: bundle exec jekyll build
344
+ # Outputs to: site/_site/
345
+
346
+ - name: Deploy to gh-pages
347
+ uses: peaceiris/actions-gh-pages@v3
348
+ with:
349
+ github_token: ${{ secrets.GITHUB_TOKEN }}
350
+ publish_dir: ./site/_site
351
+ # Copies everything from _site/ to gh-pages branch root
352
+ # GitHub Pages automatically serves from gh-pages branch
353
+ ```
354
+
355
+ **What this workflow does:**
356
+ 1. Triggers on changes to `/skills` or `/site` directories
357
+ 2. Sets up Ruby and Jekyll environment
358
+ 3. Creates skills zip and places it in `site/downloads/`
359
+ 4. Builds Jekyll site (outputs to `site/_site/`)
360
+ 5. Deploys `_site/` contents to `gh-pages` branch
361
+ 6. GitHub Pages automatically serves the updated site
362
+
363
+ ## Site Content
364
+
365
+ ### Landing Page
366
+ - Hero section with title and description
367
+ - Feature highlights
368
+ - Quick start section
369
+ - Download call-to-action
370
+ - Documentation preview
371
+
372
+ ### Agent Skills Zip Contents
373
+
374
+ The zip file contains the `/skills` directory structure following the [Agent Skills specification](https://agentskills.io/):
375
+
376
+ ```
377
+ skills/
378
+ build-mcpgraph/
379
+ SKILL.md # YAML frontmatter (name, description) + markdown content
380
+ ```
381
+
382
+ Each `SKILL.md` file contains:
383
+ - YAML frontmatter with skill metadata (name, description, etc.)
384
+ - Markdown content with instructions for agents on how to create mcpGraph configurations
385
+
386
+ ## Implementation Checklist
387
+
388
+ ### Phase 1: Basic Setup
389
+ - [ ] Create `/skills` directory structure
390
+ - [ ] Create skill subdirectory (e.g., `build-mcpgraph/`) in `/skills`
391
+ - [ ] Create `SKILL.md` file with YAML frontmatter and markdown content
392
+ - [ ] Set up site structure (Jekyll config, layouts, etc.)
393
+ - [ ] Set up GitHub Pages (enable in settings)
394
+
395
+ ### Phase 2: Site Development
396
+ - [ ] Create base layout with navigation
397
+ - [ ] Design and implement styling (CSS/theme)
398
+ - [ ] Create landing page (`index.html` or `index.md`)
399
+ - [ ] Convert existing docs to site format
400
+ - [ ] Add graphics/assets (logo, images, etc.)
401
+ - [ ] Set up navigation menu
402
+ - [ ] Test site locally (`bundle exec jekyll serve`)
403
+
404
+ ### Phase 3: Automation
405
+ - [ ] Create GitHub Actions workflow for skills zip
406
+ - [ ] Configure workflow to integrate zip into site
407
+ - [ ] Test workflow with a skills directory change
408
+ - [ ] Verify site builds and deploys correctly
409
+ - [ ] Verify site is accessible at GitHub Pages URL
410
+
411
+ ### Phase 4: Polish
412
+ - [ ] Add search functionality (if desired)
413
+ - [ ] Optimize images and assets
414
+ - [ ] Add analytics (optional)
415
+ - [ ] Test responsive design
416
+ - [ ] Review and refine content
417
+
418
+ ## Notes
419
+
420
+ - GitHub Pages is free for public repositories
421
+ - Site will be available at: `https://[username].github.io/mcpGraph/`
422
+ - Custom domain can be configured if needed
423
+ - Workflow runs automatically on pushes (no manual steps)
424
+ - Skills zip will always be up-to-date with latest changes
425
+ - Jekyll sites can be tested locally with `bundle exec jekyll serve`
426
+ - **Source directories stay clean** - `/docs` and `/site` contain only source files
427
+ - Generated output goes to `site/_site/` (gitignored) and then to `gh-pages` branch
428
+ - `gh-pages` branch contains only the generated static site (not in main branch)
429
+
430
+ ## Quick Start: Jekyll Setup (Isolated in `/site`)
431
+
432
+ 1. **Create site directory:**
433
+ ```bash
434
+ mkdir site
435
+ cd site
436
+ ```
437
+
438
+ 2. **Initialize Jekyll in site directory:**
439
+ ```bash
440
+ gem install bundler jekyll
441
+ jekyll new . --force # Creates Jekyll structure in site/
442
+ ```
443
+
444
+ 3. **Configure `site/_config.yml`:**
445
+ ```yaml
446
+ title: mcpGraph
447
+ description: MCP server for executing directed graphs
448
+ theme: minima # Or use custom theme
449
+ baseurl: "" # Or "/mcpGraph" if using project pages
450
+ url: "https://[username].github.io"
451
+ ```
452
+ - Set site title, description
453
+ - Configure theme or custom styling
454
+ - Set up navigation
455
+ - Note: Uses default `_site/` output directory (no need to specify)
456
+
457
+ 4. **Create layouts:**
458
+ - Base layout with header/footer in `site/_layouts/`
459
+ - Page layout for docs
460
+ - Include navigation partial in `site/_includes/`
461
+
462
+ 5. **Add content:**
463
+ - Create `site/pages/` directory for documentation
464
+ - Convert markdown docs to Jekyll format
465
+ - Add front matter (YAML header) to each page
466
+ - Copy existing docs to `site/pages/` or create new ones
467
+
468
+ 6. **Style:**
469
+ - Use existing theme or create custom CSS
470
+ - Add assets (images, fonts, etc.) to `site/assets/`
471
+
472
+ 7. **Test locally:**
473
+ ```bash
474
+ cd site
475
+ bundle exec jekyll build # Builds to _site/ (default)
476
+ bundle exec jekyll serve # Serves from _site/
477
+ # Visit http://localhost:4000
478
+ ```
479
+
480
+ 8. **Set up GitHub Actions:**
481
+ - Create workflow to:
482
+ - Build Jekyll from `/site` (outputs to `site/_site/`)
483
+ - Create skills zip and place in `site/downloads/`
484
+ - Copy `site/_site/*` contents to `gh-pages` branch
485
+ - Commit and push `gh-pages` branch
486
+
487
+ 9. **Deploy:**
488
+ - Push to repository
489
+ - GitHub Actions builds and pushes to `gh-pages`
490
+ - GitHub Pages automatically serves from `gh-pages` branch
491
+ - Source directories (`/docs`, `/site`) remain clean
492
+
@@ -24,7 +24,7 @@ const api = new McpGraphApi('config.yaml');
24
24
 
25
25
  // Execute with debugging enabled - controller is available immediately
26
26
  const { promise, controller } = api.executeTool('count_files', {
27
- directory: './tests/files'
27
+ directory: './tests/counting'
28
28
  }, {
29
29
  hooks: {
30
30
  onNodeStart: async (executionIndex, nodeId, node) => {
@@ -28,7 +28,7 @@ async function example() {
28
28
 
29
29
  // Execute a tool
30
30
  const { promise } = api.executeTool('count_files', {
31
- directory: './tests/files',
31
+ directory: './tests/counting',
32
32
  });
33
33
  const result = await promise;
34
34
 
@@ -45,7 +45,7 @@ async function introspectionExample() {
45
45
 
46
46
  // Execute with hooks and telemetry
47
47
  const { promise, controller } = api.executeTool('count_files', {
48
- directory: './tests/files',
48
+ directory: './tests/counting',
49
49
  }, {
50
50
  hooks: {
51
51
  onNodeStart: async (nodeId, node) => {
@@ -95,7 +95,7 @@ async function timeTravelDebuggingExample() {
95
95
  let executionIndexToInspect: number | null = null;
96
96
 
97
97
  const { promise, controller } = api.executeTool('count_files', {
98
- directory: './tests/files',
98
+ directory: './tests/counting',
99
99
  }, {
100
100
  hooks: {
101
101
  onNodeComplete: async (nodeId, node, input, output, duration) => {
@@ -2,9 +2,28 @@ version: "1.0"
2
2
 
3
3
  # MCP Server Metadata
4
4
  server:
5
- name: "fileUtils"
6
- version: "1.0.0"
7
- description: "File utilities"
5
+ name: "fileUtils" # Required: unique identifier
6
+ version: "1.0.0" # Required: server version
7
+ title: "File utilities" # Optional: display name (defaults to name if not provided)
8
+ instructions: "This server provides file utility tools for counting files in directories." # Optional
9
+
10
+ # MCP Servers used by the graph
11
+ mcpServers:
12
+ # Stdio server (type is optional, defaults to stdio)
13
+ filesystem:
14
+ command: "npx"
15
+ args:
16
+ - "-y"
17
+ - "@modelcontextprotocol/server-filesystem"
18
+ - "./tests/counting"
19
+
20
+ # Example: Streamable HTTP server (preferred for HTTP/SSE)
21
+ # httpServer:
22
+ # type: "streamableHttp"
23
+ # url: "https://api.example.com/mcp"
24
+ # headers:
25
+ # Authorization: "Bearer token"
26
+ # X-Custom-Header: "value"
8
27
 
9
28
  # Tool Definitions
10
29
  tools:
@@ -24,52 +43,28 @@ tools:
24
43
  count:
25
44
  type: "number"
26
45
  description: "The number of files in the directory"
27
-
28
- # MCP Servers used by the graph
29
- servers:
30
- # Stdio server (type is optional, defaults to stdio)
31
- filesystem:
32
- command: "npx"
33
- args:
34
- - "-y"
35
- - "@modelcontextprotocol/server-filesystem"
36
- - "/Users/bob/Documents/GitHub/mcpGraph/tests/files"
37
-
38
- # Example: Streamable HTTP server (preferred for HTTP/SSE)
39
- # httpServer:
40
- # type: "streamableHttp"
41
- # url: "https://api.example.com/mcp"
42
- # headers:
43
- # Authorization: "Bearer token"
44
- # X-Custom-Header: "value"
45
-
46
- # Graph Nodes
47
- nodes:
48
- # Entry node: Receives tool arguments
49
- - id: "entry_count_files"
50
- type: "entry"
51
- tool: "count_files"
52
- next: "list_directory_node"
53
-
54
- # List directory contents
55
- - id: "list_directory_node"
56
- type: "mcp"
57
- server: "filesystem"
58
- tool: "list_directory"
59
- args:
60
- path: "$.entry_count_files.directory"
61
- next: "count_files_node"
62
-
63
- # Transform and count files
64
- - id: "count_files_node"
65
- type: "transform"
66
- transform:
67
- expr: |
68
- { "count": $count($split($.list_directory_node, "\n")) }
69
- next: "exit_count_files"
70
-
71
- # Exit node: Returns the count
72
- - id: "exit_count_files"
73
- type: "exit"
74
- tool: "count_files"
75
-
46
+ nodes:
47
+ # Entry node: Receives tool arguments
48
+ - id: "entry"
49
+ type: "entry"
50
+ next: "list_directory_node"
51
+
52
+ # List directory contents
53
+ - id: "list_directory_node"
54
+ type: "mcp"
55
+ server: "filesystem"
56
+ tool: "list_directory"
57
+ args:
58
+ path: "$.entry.directory"
59
+ next: "count_files_node"
60
+
61
+ # Transform and count files
62
+ - id: "count_files_node"
63
+ type: "transform"
64
+ transform:
65
+ expr: '{ "count": $count($split($.list_directory_node.content, "\n")) }'
66
+ next: "exit"
67
+
68
+ # Exit node: Returns the count
69
+ - id: "exit"
70
+ type: "exit"