Flutter Deprecations MCP Server

by jger

405 downloads
Not rated
GitHub

Description

# Flutter Deprecations MCP Server This MCP server tracks Flutter API deprecations and provides tools to check code for deprecated APIs and suggest replacements. ## Project Structure ``` flutter-deprecations-server/ ├── cmd/ │ └── server/ # Main application entry point │ └──…

About

# Flutter Deprecations MCP Server This MCP server tracks Flutter API deprecations and provides tools to check code for deprecated APIs and suggest replacements. ## Project Structure ``` flutter-deprecations-server/ ├── cmd/ │ └── server/ # Main application entry point │ └── main.go ├── internal/ # Private application…

Details

Author
jger
Downloads
405
Categories
Other

- Source-based deprecation tracking from Flutter’s GitHub repository
- Local cache with a 24-hour update interval
- Code analysis for deprecated APIs with replacement suggestions
- Comprehensive scanning of major Flutter directories
- Multi-tier Flutter version detection (CLI, official API, GitHub fallback)
- Multi-platform support including FVM and Docker availability checks

Install via the provided Makefile (make deps, make build, make run) or build manually with Go. Configure your MCP host (e.g., mcp.json) with the binary path. The server exposes three tools: check_flutter_deprecations, list_flutter_deprecations, and check_flutter_version_info. Command-line flags manage the deprecation cache: --update, --clear-cache, --show-cache, and -vvv for verbose logging.

Flutter Deprecations MCP Server

This MCP server tracks Flutter API deprecations and provides tools to check code for deprecated APIs and suggest replacements.

Project Structure

flutter-deprecations-server/
├── cmd/
│   └── server/          # Main application entry point
│       └── main.go
├── internal/            # Private application code
│   ├── handlers/        # MCP tool handlers
│   │   ├── mcp_handlers.go
│   │   ├── mcp_handlers_test.go
│   │   └── testdata/
│   ├── models/          # Data structures
│   │   └── flutter.go
│   └── services/        # Business logic
│       ├── cache.go
│       ├── cache_test.go
│       ├── deprecations.go
│       ├── deprecations_test.go
│       ├── flutter_api.go
│       ├── flutter_api_test.go
│       ├── flutter_version.go
│       ├── interfaces.go
│       ├── version_info.go
│       ├── version_info_test.go
│       └── testdata/
├── pkg/                 # Public libraries
│   └── config/          # Configuration constants
│       └── config.go
├── bin/                 # Compiled binaries
├── Makefile            # Build automation
├── go.mod              # Go module definition
├── go.sum              # Dependency checksums
└── README.md

Features

- Source-based deprecation tracking: Directly scans Flutter's GitHub source code for @Deprecated annotations
- Local caching: Stores deprecations locally with 24-hour cache duration
- Code analysis: Analyzes Flutter code snippets for deprecated APIs
- Replacement suggestions: Provides modern alternatives for deprecated APIs
- Comprehensive scanning: Scans key Flutter directories (widgets, material, cupertino, services, etc.)
- Version checking: Gets latest Flutter version using Flutter CLI (most reliable) with GitHub API fallback
- Multi-platform support: Checks FVM and Docker image availability
- Command-line cache management: Manual cache updates and clearing with progress reporting
- Short command options: Support for both long and short command flags
- Rate limit handling: Graceful handling of GitHub API rate limits with helpful error messages
- Verbose logging: Detailed logging with -vvv flag for troubleshooting

MCP Tools

1. check_flutter_deprecations

Analyzes provided Flutter code for deprecated APIs and suggests replacements.

Parameters:
- code (string): Flutter code snippet to analyze

Example:

Color.red.withOpacity(0.5)  // Will suggest Color.red.withValues(alpha: 0.5)

2. list_flutter_deprecations

Lists all known Flutter deprecations from the cache.

Parameters: None

Returns: Complete list of deprecations with replacements and version information.

3. check_flutter_version_info

Gets the latest stable Flutter version and checks availability across different tools and platforms.

Parameters: None

Returns:
- Latest stable Flutter version (using Flutter CLI when available, GitHub API fallback)
- Flutter CLI installation status and channel information
- FVM installation status and version availability
- Docker image availability for instrumentisto/flutter and ghcr.io/cirruslabs/flutter
- Usage examples and installation commands

Known Deprecations

The server includes built-in patterns for common deprecations:

- Color.withOpacity()Color.withValues(alpha:)
- RaisedButtonElevatedButton
- FlatButtonTextButton
- OutlineButtonOutlinedButton
- Scaffold.of(context).showSnackBarScaffoldMessenger.of(context).showSnackBar

Installation

Using Makefile (Recommended)

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.