Skip to content

Conversation

poltorak
Copy link
Collaborator

Make DS Configuration Parameters Optional

Overview

This PR addresses issue #6 by making ds.storybookDocsRoot and ds.deprecatedCssClassesPath optional in the MCP server configuration. The server can now start and operate partially even when these parameters are not provided, with clear error messages when tools requiring them are used.

Changes Made

🔧 Configuration Schema Updates

  • Made ds.storybookDocsRoot and ds.deprecatedCssClassesPath optional in AngularMcpServerOptionsSchema
  • Updated validation to only check file existence for provided optional parameters

🛠️ Server Behavior Updates

  • Server now starts successfully with partial configuration
  • Added runtime checks to skip operations requiring missing optional parameters
  • Improved error handling with clear messages when required parameters are missing

📚 Tool Behavior Changes

  • Tools that work without optional params: get-project-dependencies, build-component-usage-graph, contract tools
  • Tools requiring deprecatedCssClassesPath: get-deprecated-css-classes, report-deprecated-css, report-violations, report-all-violations - fail fast with clear error messages
  • Tools using storybookDocsRoot: get-ds-component-data - works but returns empty documentation section when parameter is missing

📖 Documentation Updates

  • Added comprehensive documentation about optional parameters in README.md
  • Updated configuration examples and parameter descriptions
  • Added clear guidance on tool behavior with missing parameters

🔄 Flow Updates

  • Updated Cursor flows to reflect the new optional parameter behavior

Benefits

  • ✅ Faster setup - server starts with minimal configuration
  • ✅ Graceful degradation - tools work where possible
  • ✅ Clear error messages when optional parameters are needed
  • ✅ Backward compatibility - existing full configurations continue to work

Testing

  • Server starts successfully with minimal config
  • Tools requiring optional parameters fail with clear error messages
  • Full configuration continues to work as before

@poltorak poltorak force-pushed the feat/issue-6-mcp-refactoring branch from adf72f0 to ebcb397 Compare September 10, 2025 11:24
@poltorak poltorak merged commit 29ec8df into main Sep 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants