-
Notifications
You must be signed in to change notification settings - Fork 2
Add update-vmcp-yaml-example skill #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| --- | ||
| name: update-vmcp-yaml-example | ||
| description: Updates vMCP YAML examples in documentation, verifies against toolhive source, and creates e2e tests | ||
| --- | ||
|
|
||
| # Update vMCP YAML Examples | ||
|
|
||
| This skill guides you through updating VirtualMCPServer YAML examples in the documentation, ensuring they match the canonical examples in the ToolHive repository and are verified through tests. | ||
|
|
||
| ## Overview | ||
|
|
||
| When updating vMCP documentation examples, you must: | ||
jerm-dro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 1. Make the described changes to the relevant code examples in docs-website | ||
| 2. Ensure changes match the documentation in the ToolHive repo (the source of truth) | ||
| 3. Verify the documentation by creating a Ginkgo test OR running a manual test (depending on the feature) | ||
| 4. Run a manual test verifying the documented API using the `deploying-vmcp-locally` skill | ||
|
|
||
| ## Instructions | ||
|
|
||
| ### Step 1: Sync ToolHive to latest | ||
|
|
||
| Ensure ToolHive has the latest changes from main: | ||
|
|
||
| ```bash | ||
| cd ../toolhive | ||
| git checkout main | ||
| git pull | ||
| ``` | ||
|
|
||
| ### Step 2: Identify affected files | ||
|
|
||
| Find all files containing vMCP YAML examples: | ||
|
|
||
| **In docs-website:** | ||
|
|
||
| - `docs/toolhive/guides-vmcp/*.mdx` - vMCP how-to guides | ||
| - `docs/toolhive/tutorials/quickstart-vmcp.mdx` - vMCP tutorial | ||
| - `docs/toolhive/concepts/vmcp.mdx` - vMCP concepts | ||
|
|
||
| **In ToolHive (source of truth):** | ||
|
|
||
| - `examples/operator/virtual-mcps/` - Canonical YAML examples | ||
| - `examples/vmcp-config.yaml` - CLI configuration example | ||
|
|
||
| Reference the following ToolHive example files: | ||
|
|
||
| | Documentation Topic | ToolHive Example | | ||
| | -------------------------- | --------------------------------------- | | ||
| | Basic vMCP setup | `vmcp_simple_discovered.yaml` | | ||
| | Conflict resolution | `vmcp_conflict_resolution.yaml` | | ||
| | Authentication | `vmcp_inline_incoming_auth.yaml` | | ||
| | Production config | `vmcp_production_full.yaml` | | ||
| | Simple composite tools | `composite_tool_simple.yaml` | | ||
| | Complex composite tools | `composite_tool_complex.yaml` | | ||
| | Composite with elicitation | `composite_tool_with_elicitations.yaml` | | ||
|
|
||
| ### Step 3: Update documentation examples | ||
|
|
||
| Make the requested changes to the YAML examples in the documentation to match ToolHive. | ||
|
|
||
| **Important guidelines:** | ||
|
|
||
| - Documentation examples should be simplified versions focused on the specific feature being documented | ||
| - Always include comments explaining key configuration options | ||
| - Use realistic but simple values (e.g., `my-group`, `my-vmcp`) | ||
| - Follow the existing documentation style (see `/CLAUDE.md` for style guide) | ||
|
|
||
| ### Step 4: Verify the changes | ||
|
|
||
| Choose the appropriate verification method based on the feature type: | ||
|
|
||
| #### Option A: Ginkgo e2e test (for features that can be automated) | ||
|
|
||
| Use this for features like tool aggregation, conflict resolution, composite tools, etc. | ||
|
|
||
| Create a Ginkgo test in `../toolhive/test/e2e/thv-operator/virtualmcp/` that verifies the documented configuration works as expected. | ||
|
|
||
| **Test structure pattern:** | ||
|
|
||
| ```go | ||
| var _ = Describe("VirtualMCPServer <Feature Name>", Ordered, func() { | ||
| var ( | ||
| testNamespace = "default" | ||
| mcpGroupName = "test-<feature>-group" | ||
| vmcpServerName = "test-vmcp-<feature>" | ||
| timeout = 3 * time.Minute | ||
| pollingInterval = 1 * time.Second | ||
| ) | ||
|
|
||
| BeforeAll(func() { | ||
| By("Creating MCPGroup") | ||
| CreateMCPGroupAndWait(ctx, k8sClient, mcpGroupName, testNamespace, | ||
| "Test MCP Group for <feature> E2E tests", timeout, pollingInterval) | ||
|
|
||
| By("Creating backend MCPServer") | ||
| // Create backend servers... | ||
|
|
||
| By("Creating VirtualMCPServer with <feature> configuration") | ||
| // Create VirtualMCPServer matching the documented configuration... | ||
| }) | ||
|
|
||
| It("should <expected behavior>", func() { | ||
| // Verify the feature works as documented | ||
| }) | ||
|
|
||
| AfterAll(func() { | ||
| // Cleanup resources | ||
| }) | ||
| }) | ||
| ``` | ||
|
|
||
| Use helper functions from `helpers.go`: | ||
|
|
||
| - `CreateMCPGroupAndWait()` - Create and wait for MCPGroup | ||
| - `WaitForVMCPReady()` - Wait for VirtualMCPServer to be ready | ||
| - `GetVMCPNodePort()` - Get the NodePort for testing | ||
|
|
||
| **Run only the new test:** | ||
|
|
||
| ```bash | ||
| cd ../toolhive | ||
| KUBECONFIG="kconfig.yaml" ginkgo -v --focus="<Feature Name>" ./test/e2e/thv-operator/virtualmcp/ | ||
| ``` | ||
|
|
||
| #### Option B: Manual testing only (for features that cannot be automated) | ||
|
|
||
| Use this for features like telemetry/OTEL exports, external integrations (Zipkin, Jaeger), or UI-dependent verification. | ||
|
|
||
| Use the `deploying-vmcp-locally` skill from the ToolHive repository: | ||
|
|
||
| ```bash | ||
| cd ../toolhive | ||
| # Follow the deploying-vmcp-locally skill instructions | ||
| ``` | ||
|
|
||
| Manual verification steps: | ||
|
|
||
| 1. Deploy the configuration to a local Kind cluster | ||
| 2. Verify the VirtualMCPServer reaches Ready state | ||
| 3. Test the specific feature manually (e.g., check Zipkin UI for traces) | ||
| 4. Document the manual verification steps performed | ||
|
|
||
| ### Step 5: Validate documentation builds | ||
|
|
||
| Ensure the documentation builds without errors: | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| ### Step 6: Create commits | ||
|
|
||
| Create separate commits for: | ||
|
|
||
| 1. Documentation changes (in docs-website) | ||
| 2. E2E test additions (in ToolHive, if applicable) | ||
|
|
||
| ## Checklist | ||
|
|
||
| Before completing this skill, verify: | ||
|
|
||
| - [ ] ToolHive main is checked out and up to date | ||
| - [ ] Documentation YAML examples are syntactically correct | ||
| - [ ] Examples match the structure in `toolhive/examples/operator/virtual-mcps/` | ||
jerm-dro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - [ ] Verification completed (Ginkgo test OR manual testing, as appropriate) | ||
| - [ ] Documentation builds successfully (`npm run build`) | ||
| - [ ] Code formatting is correct (`npm run prettier:fix && npm run eslint:fix`) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.