Conversation
This adds a Model Context Protocol (MCP) server to silver-platter, allowing AI assistants and other MCP clients to interact with svp functionality. The MCP server is enabled with the "mcp" feature flag and adds: - A new "svp mcp" command that runs the MCP server on stdin/stdout - Three initial tools exposed via MCP: - list_forges: List all configured forges - list_proposals: List merge proposals by the current user - repo_info: Get information about a specific repository The implementation uses the official Rust MCP SDK (rmcp) and follows the MCP specification for tool discovery and invocation.
This adds a new tool 'run_recipe' to the MCP server that allows running silver-platter recipes. The tool accepts: - recipe: Recipe definition as inline JSON object with fields: - name: Recipe name - command: Command as string or array of arguments - mode: Optional mode (push, propose, attempt-push) - merge-request: Optional merge request configuration - url: URL of the repository to apply the recipe to The current implementation parses and validates the recipe definition, returning basic information about the recipe. This provides a foundation for full recipe execution in the MCP environment without requiring separate recipe files.
This adds the apply_changes tool which allows applying a script to make changes in an existing local checkout. The tool supports: - directory: Directory containing the repository - command: Command as string or array of arguments - diff: Optional flag to show diff of changes - commit_pending: Whether to commit pending changes (yes/no/auto) The tool opens a working tree, checks that it's clean, runs the specified script, and returns the results. This mirrors the 'svp apply' command functionality.
This adds the batch_generate tool which creates a batch of changes to apply to multiple repositories. The tool supports: - directory: Directory to create the batch in - candidates: Path to candidates file - command: Command as string or array of arguments (alternative to recipe) - recipe: Path to recipe file (alternative to command) The tool loads candidates from a file, creates a recipe from either the provided recipe file or command, and generates a batch using the Batch::from_recipe method. This mirrors the 'svp batch generate' command functionality.
This adds the batch_publish tool which publishes a batch of changes or a specific entry from a batch. The tool supports: - directory: Directory containing the batch - name: Specific entry to publish (optional) - overwrite: Whether to overwrite existing branches - refresh: Refresh changes if branch already exists Currently provides a simulation of the batch publish functionality. In a full implementation, this would need to be refactored to expose the actual batch_publish function from the binary as a library function.
- Add batch_status tool with real implementation using load_batch_metadata - Add batch_diff tool for showing entry diffs - Add batch_refresh tool for refreshing batch changes - Add login tool for forge authentication All tools include proper JSON schema definitions and error handling. The batch_status tool provides actual functionality while others have placeholder implementations that would require library refactoring for full functionality.
- Add test_server_info to verify server metadata and capabilities - Add test_server_creation to test basic server initialization - Add test_data_structures to verify JSON serialization/deserialization for ProposalInfo, RepoInfo, and RunRecipeResult structs - Add test_json_schema_creation to verify JSON schema functionality - Add test_tool_definitions to verify tool capability configuration The tests focus on core functionality that can be tested without complex async setup, ensuring all data structures work correctly and the server can be properly initialized and configured.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.