fujidaiti/dart-fix-hints
3.2
If you are the rightful owner of dart-fix-hints and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
dart_fix_hints is a minimal Dart MCP server designed to describe diagnostics by their IDs, facilitating integration with AI agents or MCP-compliant clients.
Tools
1
Resources
0
Prompts
0
dart_fix_hints (WIP)
Overview
dart_fix_hints is a minimal Dart MCP server that exposes a tool to describe diagnostics by id(s). It communicates over stdio and is intended to be hosted by an AI agent or any MCP-compliant client.
Current tool
- name:
describe_diagnostic - input: Either
{ "id": string }or{ "ids": string[] } - output:
- Single id: one TextContent with the description (error if unknown)
- Multiple ids: an array of TextContent entries, each
"id: description"(unknown as"id: <unknown>")
Install
dart pub get
Run
Start the server over stdio:
dart run bin/dart_fix_hints.dart
CLI flags:
--helpprints usage--versionprints the server version
Using the tool
From an MCP client, call describe_diagnostic with arguments like:
{"id":"discarded_result"}
Or multiple ids:
{"ids":["discarded_result","unused_import"]}
The server returns TextContent entries as described above.
Project structure
bin/dart_fix_hints.dart: CLI entrypoint and MCP server wiring. DefinesMCPDiagnosticsServer, registers tools, and binds stdio.lib/diagnostics.dart: Diagnostic registry defined asconst Map<String,String> kDiagnosticDescriptionswith alookupDescription(String)helper.pubspec.yaml: Declares a local path dependency on the MCP library.ai/pkgs/dart_mcp/: Local MCP library providing protocol types and stdio channel utilities (examples included inexample/).tool/debug_client.dart: Interactive client for manual debugging; spawns the server, pretty-prints raw responses, and accepts space-separated ids.
Design notes
- Separation of concerns: Tool behavior (server) is isolated from data (diagnostics registry).
- Transport: Uses
stdioChannelto ensure line-delimited JSON over stdio. The server avoids printing to stdout except for explicit CLI output (help/version). - MCP integration: Implements an MCP server via
ToolsSupport, registers tools with schemas, and returnsCallToolResultcontent entries. - Data source: Diagnostics are embedded in-code as a
constmap for compatibility with compiled executables. - Extensibility: Add/modify diagnostics in
lib/diagnostics.dart; add new tools by defining aTooland registering it inMCPDiagnosticsServer.
Extend
- Add a diagnostic: update
kDiagnosticDescriptionsinlib/diagnostics.dart. - Add a tool: define a new
Tool, implement a handler, and register it in the server constructor.
See also
- How do I break a string in YAML over multiple lines?: A great free content on the internet that explains the YAML's mystrerious syntax of writing multiline strings.