Skip to content

Commit d76d1d2

Browse files
committed
feat: @vurb/yaml declarative MCP server engine + CLI plugin (3.17.0)
1 parent e97730c commit d76d1d2

48 files changed

Lines changed: 4105 additions & 59 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-npm.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,15 @@ jobs:
113113
env:
114114
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
115115
continue-on-error: true
116+
117+
- name: Publish swarm package
118+
run: npm publish -w packages/swarm --provenance --access public
119+
env:
120+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
121+
continue-on-error: true
122+
123+
- name: Publish yaml package
124+
run: npm publish -w packages/yaml --provenance --access public
125+
env:
126+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
127+
continue-on-error: true

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,58 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.17.0] - 2026-04-21
9+
10+
### Added
11+
12+
#### `@vurb/yaml` — Declarative MCP Server Engine (new package)
13+
14+
A new first-class package that lets developers define complete MCP servers in a single `vurb.yaml` file — zero TypeScript required. Connections, tools, resources, prompts, and secrets are declared as YAML, compiled at startup, and served as a fully compliant MCP server.
15+
16+
- **YAML Parser & Schema Validator** — Parses `vurb.yaml` manifests and validates against a strict Zod schema. Detects missing fields, invalid types, and unsupported versions with structured `VurbYamlError` containing `.details[]` arrays for actionable multi-line error messages.
17+
- **Cross-Reference Validator** — Ensures referential integrity: tools referencing nonexistent connections, `${SECRETS.X}` tokens referencing undeclared secrets, and resources referencing missing connections are all caught at parse time with specific error messages naming the offending tool/connection/secret.
18+
- **Connection Resolver** — Resolves named YAML connections into fetch-ready HTTP configurations with interpolated base URLs and auth headers. Supports `bearer`, `basic`, `custom_header`, and `none` auth types with secret interpolation.
19+
- **Tool Compiler** — Compiles declarative tool definitions into `CompiledTool` objects with JSON Schema input, HTTP execution config (method, path, query, body templates), and the full tool trichotomy (`description`, `instruction`, `rules`). Supports MCP tool annotations (`readOnlyHint`, `openWorldHint`, etc.).
20+
- **Resource Compiler** — Compiles resources with three execution strategies: `static` (inline content), `fetch` (arbitrary URL), and `connection` (named connection + path). Supports URI templates and response transforms.
21+
- **Prompt Compiler** — Compiles prompts with typed arguments and `{{param}}` template hydration for `prompts/get` responses.
22+
- **Response Transformer** — JMESPath-inspired dot-path extraction (`data.items[].{id, name}`) and multi-field projection for filtering verbose API responses down to LLM-relevant data.
23+
- **Secret Interpolator** — Resolves `${SECRETS.KEY}` tokens from `process.env` (open-source) or the Vinkius encrypted vault (enterprise). Missing required secrets throw actionable errors; optional secrets emit `` warnings.
24+
- **Parameter Compiler** — Converts YAML parameter definitions to MCP-compliant JSON Schema (`type`, `required`, `enum`, `description`).
25+
- **Basic Tool Executor** — Executes compiled tools via plain `fetch()` with `{{param}}` interpolation for path, query, and body templates. Built-in variables: `__NOW_ISO__`, `__NOW_EPOCH__`, `__REQUEST_ID__`. Returns MCP-compliant `ToolCallResult` with `isError` flag.
26+
- **YAML MCP Server**`createYamlMcpServer()` creates a real MCP SDK `Server` and registers all compiled tools, resources, and prompts as live MCP handlers. Supports dual transport: **stdio** (default, for Cursor/Claude Desktop) and **Streamable HTTP** (for browser-based dev tools). HTTP transport includes CORS, session management, and graceful shutdown.
27+
- **DX-First Error Handling** — Every pipeline step (`parse → secrets → connections → tools → resources → prompts`) is wrapped with context-rich `try/catch` blocks producing `VurbYamlError` with structured `.details[]` arrays. Runtime MCP handlers (`resources/read`, `prompts/get`) return actionable error messages listing available resources/prompts and required arguments instead of crashing the server.
28+
29+
#### `@vurb/core` — YAML CLI Plugin Architecture
30+
31+
- **`vurb yaml` command group** — The core CLI now dynamically imports `@vurb/yaml` at runtime when the `yaml` subcommand is used. If the package is not installed, a helpful error message with `npm install @vurb/yaml` is shown.
32+
- **`vurb yaml validate [file]`** — Validates a `vurb.yaml` manifest and displays server metadata, tool count, resource count, and tool list on success. On failure, displays structured error details.
33+
- **`vurb yaml dev [file]`** — Starts a local MCP dev server from a YAML manifest. Supports `--transport stdio|http` and `--port` options.
34+
- **Command parser guard** — Fixed `parseArgs` to only accept the first command token, preventing `vurb yaml validate` from being incorrectly parsed as `validate`.
35+
36+
#### Documentation
37+
38+
- **`packages/yaml/README.md`** — Production-grade documentation covering the full YAML spec, CLI usage (`vurb yaml validate` / `vurb yaml dev`), programmatic API, architecture overview, and the open-core strategy.
39+
40+
### Changed
41+
42+
- **All `@vurb/*` cross-dependencies updated to `^3.17.0`** — All 14 satellite packages now reference `@vurb/core: ^3.17.0` in their dependencies, ensuring consistent resolution across the monorepo.
43+
44+
### Test Suite
45+
46+
- **54 new tests** in `packages/yaml/test/yaml-engine.test.ts` covering:
47+
- Parser: valid/invalid YAML, empty input, garbage input, field preservation (8 tests)
48+
- Schema Validator: well-formed, missing fields, unknown version, missing description (4 tests)
49+
- Cross-Reference Validator: valid refs, missing connection, undeclared secret (3 tests)
50+
- Secret Interpolator: single/multiple secrets, missing secrets, deep interpolation, env resolution (5 tests)
51+
- Parameter Compiler: required/optional, enums, empty params (3 tests)
52+
- Connection Resolver: bearer auth, basic auth, custom headers (3 tests)
53+
- Tool Compiler: trichotomy, JSON Schema parameters (2 tests)
54+
- Resource Compiler: static, connection, URI templates (3 tests)
55+
- Prompt Compiler: arguments, hydration (2 tests)
56+
- Response Transformer: dot-path, nested, missing, null, array projection, transforms (8 tests)
57+
- Basic Tool Executor: interpolation, deep interpolation, GET execution, error responses, fetch errors, query params (7 tests)
58+
- Full Pipeline Integration: complete fixture, minimal fixture, invalid rejection (3 tests)
59+
860
## [3.16.0] - 2026-04-21
961

1062
### Added

package-lock.json

Lines changed: 52 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
"url": "git+https://github.com/vinkius-labs/vurb.ts.git"
4242
},
4343
"license": "Apache-2.0",
44-
"version": "3.16.0"
44+
"version": "3.17.0"
4545
}

packages/api-key/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vurb/api-key",
3-
"version": "3.16.0",
3+
"version": "3.17.0",
44
"description": "API key validation middleware for MCP servers built with vurb. Timing-safe comparison, SHA-256 hashing, async validators, and self-healing error responses.",
55
"type": "module",
66
"main": "dist/index.js",
@@ -46,7 +46,7 @@
4646
"access": "public"
4747
},
4848
"dependencies": {
49-
"@vurb/core": "^3.8.0"
49+
"@vurb/core": "^3.17.0"
5050
},
5151
"devDependencies": {},
5252
"license": "Apache-2.0"

packages/aws/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vurb/aws",
3-
"version": "3.16.0",
3+
"version": "3.17.0",
44
"description": "AWS Lambda & Step Functions connector for Vurb. Auto-discovers tagged resources and produces GroupedToolBuilders — so AI agents can invoke your cloud functions natively.",
55
"type": "module",
66
"main": "dist/index.js",
@@ -48,7 +48,7 @@
4848
"access": "public"
4949
},
5050
"dependencies": {
51-
"@vurb/core": "^3.8.0"
51+
"@vurb/core": "^3.17.0"
5252
},
5353
"peerDependencies": {
5454
"@aws-sdk/client-lambda": "^3.0.0",

packages/cloudflare/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vurb/cloudflare",
3-
"version": "3.16.0",
3+
"version": "3.17.0",
44
"description": "Cloudflare Workers adapter for Vurb. Deploys your MCP server to the edge with zero config — stateless JSON-RPC, cold-start caching, and native env injection.",
55
"type": "module",
66
"main": "dist/index.js",
@@ -48,7 +48,7 @@
4848
"access": "public"
4949
},
5050
"dependencies": {
51-
"@vurb/core": "^3.8.0"
51+
"@vurb/core": "^3.17.0"
5252
},
5353
"peerDependencies": {
5454
"@modelcontextprotocol/sdk": "^1.12.0"

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,5 @@
149149
"fast-redact": "^3.5.0",
150150
"rimraf": "^6.0.0"
151151
},
152-
"version": "3.16.0"
152+
"version": "3.17.0"
153153
}

packages/core/src/cli/args.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ export function parseArgs(argv: string[]): CliArgs {
9393
case 'version':
9494
case 'validate':
9595
case 'doctor':
96-
result.command = arg;
97-
seenCommand = true;
96+
case 'yaml':
97+
if (!seenCommand) {
98+
result.command = arg;
99+
seenCommand = true;
100+
}
98101
break;
99102
case '-v':
100103
case '--version':

0 commit comments

Comments
 (0)