Skip to content

Conversation

@shelldandy
Copy link

bump version

shelldandy added 14 commits July 1, 2025 22:39
* initial AI commit

* initial plan

* tweaks in plan

* feat: Complete Phase 1 - Transform shadcn/ui to Grafana UI MCP server

- Update package metadata and branding for Grafana UI
- Migrate GitHub API integration from shadcn-ui/ui to grafana/grafana repository
- Create new parser utilities for Grafana UI multi-file component structure:
  - component-parser.ts: TypeScript analysis and props extraction
  - story-parser.ts: Storybook story analysis with interactive features detection
  - mdx-parser.ts: Documentation parsing with accessibility analysis
- Enhance caching layer with TTL-based invalidation and Grafana-specific utilities
- Update CLI interface with Grafana UI branding
- Remove shadcn-specific tools (blocks) not applicable to Grafana UI
- Update all existing tools to work with Grafana repository structure
- Verify build system and project compilation

Phase 1 implementation complete - ready for Phase 2 tool enhancements.

* update claude commands

* feat: Complete Phase 2 - Implement 6 new Grafana-specific MCP tools

## Phase 2 Implementation Summary

This commit completes Phase 2 of the Grafana UI MCP server transformation,
adding 6 powerful new tools that provide comprehensive access to Grafana's
component ecosystem.

### ✅ New Tools Implemented (6)

1. **get_component_documentation** - Rich MDX documentation parsing
   - Section extraction with examples and metadata
   - Accessibility guidelines detection
   - Usage pattern identification

2. **get_component_stories** - Storybook story analysis
   - Interactive features detection
   - Story argument extraction
   - Example code parsing

3. **get_component_tests** - Test file analysis
   - Usage pattern extraction from test cases
   - Test description parsing
   - Edge case documentation

4. **search_components** - Advanced component search
   - Fuzzy matching by component name
   - Optional documentation content search
   - Relevance scoring and ranking

5. **get_theme_tokens** - Design system integration
   - Complete theme token extraction
   - Category filtering (colors, typography, spacing, etc.)
   - Multi-theme support (light/dark)

6. **get_component_dependencies** - Dependency analysis
   - Shallow and deep dependency trees
   - External vs internal dependency categorization
   - Circular dependency detection

### 🔧 Infrastructure Enhancements

- **theme-extractor.ts** (NEW): 774-line comprehensive utility for parsing
  Grafana design system tokens with support for colors, typography, spacing,
  shadows, border radius, z-index, and breakpoints

- **Enhanced axios.ts**: Added 4 new GitHub API methods with proper error
  handling and caching integration

- **Updated tools.ts**: Added all 6 new tools with MCP server integration,
  maintaining backward compatibility

- **Enhanced handler.ts**: Added Zod validation schemas for all new tools
  with comprehensive input validation

### 📊 Results

- **Total Tools**: 11 (5 existing + 6 new)
- **Build Status**: ✅ All TypeScript compilation successful
- **Server Status**: ✅ All tools registered and working
- **Error Handling**: ✅ Comprehensive McpError integration
- **Validation**: ✅ Zod schemas for all tool parameters

### 🚀 Ready for Phase 3

Phase 2 provides complete access to the Grafana UI component ecosystem with:
- Rich documentation parsing
- Interactive example extraction
- Advanced search capabilities
- Complete design system integration
- Comprehensive dependency analysis

The foundation is now ready for Phase 3 (Documentation and Testing).

* tweak cli tools

* phase-3 plans

* another test check

* update docs

* shelldandy

* prettier

* removing cheerio

* prettier

* update prompts

* feat: complete Phase 4 - Prompts Migration to Grafana UI

- Replace all 5 shadcn/ui prompts with Grafana UI specific prompts
- Add comprehensive Grafana UI focused prompt handlers
- Implement 4 new helper functions for Grafana-specific instructions
- Update all tool references to use available Grafana UI MCP tools
- Add observability and monitoring focus throughout all prompts
- Enhance optimization instructions with Grafana theming support

Phase 4 Summary:
- build-grafana-dashboard: monitoring/observability dashboards
- create-grafana-form: authentication, settings, configuration forms
- optimize-grafana-component: performance/accessibility optimizations
- create-data-visualization: tables, charts, visualizations
- build-admin-interface: admin interfaces with Grafana patterns

All prompts now leverage the full suite of 11 Grafana UI MCP tools
and provide comprehensive guidance for AI-assisted Grafana UI development.

* feat: complete Phase 5 - Resources Migration to Grafana UI

- **Complete Resource Templates Migration** (src/resource-templates.ts):
  - Replaced shadcn/ui CLI commands with Grafana UI setup scripts
  - Added get_grafana_ui_setup_script with React + @grafana/ui integration
  - Added get_component_usage_example with TypeScript support
  - Created comprehensive setup instructions with ThemeProvider config

- **Complete Resources Migration** (src/resources.ts):
  - Removed hardcoded list of 40+ shadcn/ui components
  - Added dynamic GitHub API integration with axios.getAvailableComponents()
  - Added get_grafana_components for real-time component discovery
  - Added get_grafana_ui_info with comprehensive library information
  - Enhanced error handling with fallback component lists

- **Updated Project Specification** (specs/01-grafana-ui.md):
  - Documented Phase 5 completion with full implementation details
  - Added final architecture summary: 11 tools, 2 resources, 2 templates, 5 prompts
  - Marked project as COMPLETE TRANSFORMATION from shadcn/ui to Grafana UI

**Final Architecture:**
- 11 fully functional MCP tools
- 2 dynamic resources with GitHub API integration
- 2 Grafana UI focused resource templates
- 5 comprehensive Grafana UI development prompts
- 100% migration from shadcn/ui to Grafana UI ecosystem

All components now provide comprehensive access to Grafana's component
library optimized for observability and monitoring UI development.

* prettier

* remove unused files

* rename plan

* point to my npm

* update author name

* pre-release version

* update: migrate test and examples scripts to Grafana UI

- Update test-package.sh to test grafana-ui-mcp-server
- Update examples.sh with Grafana UI branding and tool descriptions
- Remove block-related tools as they don't apply to Grafana UI
- Update MCP server names and package references

* remove: V4_MIGRATION_SUMMARY.md as it's no longer relevant

* ready for publishing
* feat: add support for GITHUB_TOKEN environment variable

Add GITHUB_TOKEN as an alternative to GITHUB_PERSONAL_ACCESS_TOKEN for better compatibility with common GitHub workflows and CI/CD environments.

- Add GITHUB_TOKEN support in src/index.ts and src/utils/axios.ts
- Update documentation across README.md, ASSISTANTS.md, examples.sh, and PUBLISHING.md
- Maintain backward compatibility with existing GITHUB_PERSONAL_ACCESS_TOKEN

Priority order: --github-api-key flag > GITHUB_PERSONAL_ACCESS_TOKEN > GITHUB_TOKEN

* 1.1.0

* badge bump
Add comprehensive Cursor configuration instructions including:
- Platform-specific access instructions for settings
- Two configuration methods (CLI args and env vars)
- Clear JSON examples following existing documentation style
- Post-configuration setup instructions
* plan

* feat: consolidate 11 tools into unified grafana_ui tool

- Replace 11 individual MCP tools with single configurable tool
- Add action parameter to determine operation (get_component, get_demo, etc.)
- Implement comprehensive parameter validation based on action type
- Maintain all existing functionality through action-based routing
- Simplify MCP client configuration from 11 tools to 1
- Reduce cognitive overhead for AI agents
- Add specification document for tool consolidation

BREAKING CHANGE: Individual tool names replaced with single grafana_ui tool
All functionality preserved through action parameter

* docs: update README to reflect unified tool interface

- Document new grafana_ui tool with action-based routing
- Update all usage examples to use unified tool syntax
- Add migration guide for breaking changes from v1.x
- Highlight benefits of unified tool approach
- Update troubleshooting section with new tool name
- Maintain all existing functionality documentation

* style: apply linter formatting fixes

* refactor: update prompts and CLI help to use unified tool interface

- Update all prompt instructions to use 'grafana_ui' tool with action parameters
- Replace old tool names (get_component, list_components, etc.) with unified syntax
- Update CLI help text to reflect new unified tool interface
- Add usage examples showing action-based routing
- Maintain all existing functionality through new interface

* prettier
* add the plan

* feat: add local Grafana repository support

Add --grafana-repo-path option to enable direct filesystem access to local Grafana repositories, providing faster development workflows and offline support.

Key Features:
• CLI option: --grafana-repo-path / -l for local repository path
• Environment variable: GRAFANA_REPO_PATH support
• Precedence: Local repo → GitHub API key → Unauthenticated GitHub
• Graceful fallback to GitHub API when local files missing
• All 11 MCP tools support both local and remote sources
• Source indication in responses (local vs github)

Benefits:
• ⚡ Faster access via direct filesystem reads
• 🚫 No rate limits for unlimited component access
• 🔄 Real-time updates for local changes
• 📡 Offline support without internet dependency
• 🧪 Development workflow for uncommitted changes

Files:
• src/index.ts - CLI argument parsing and configuration
• src/utils/axios.ts - Filesystem support for all functions
• README.md - Local development documentation

Maintains full backward compatibility while enabling powerful local development capabilities.
@shelldandy shelldandy closed this Jul 17, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pr,it's now under review

@shelldandy shelldandy deleted the chore/version-bump branch July 17, 2025 15:01
@shelldandy
Copy link
Author

My bad! I need to detach my fork to prevent this from happening again

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.

1 participant