Agent skill
add_mcp_feature
Instructions for adding new features (tools, prompts, etc.) to the dart_mcp_server package.
Install this agent skill to your Project
npx add-skill https://github.com/dart-lang/ai/tree/main/.agents/skills/add_mcp_feature
SKILL.md
Adding Features to dart_mcp_server
Follow these instructions when adding new tools, prompts, or other capabilities
to the dart_mcp_server.
1. Locate or Create a Mixin
All server features are implemented as mixins on the DartMCPServer at
pkgs/dart_mcp_server/lib/src/server.dart.
- Check existing mixins: Look under
pkgs/dart_mcp_server/lib/src/mixins/to see if your feature fits into an existing category (e.g.,analyzer.dart,pub.dart). - Create a new mixin: If your feature is distinct, create a new file in that directory, following the patterns in existing mixins. Make sure to include a copyright header at the top of the file, with the current year.
2. Implementation Details
- Registration: Tools, prompts, etc should be registered in the
initializemethod of the mixin, which is an override and must callsuper.initialize(). - Parameter Names: When adding new arguments to tools or prompts, always
add a constant to the
ParameterNamesextension inpkgs/dart_mcp_server/lib/src/utils/names.dartand use that constant instead of hardcoding string literals in your tool parsing and schema.
3. Testing
Always add tests for any new features.
- Test Harness: Use the
TestHarnessclass located inpkgs/dart_mcp_server/test/test_harness.dart. - Existing Tests: Look at
pkgs/dart_mcp_server/test/tools/for examples of how to test specific tools. - Enhance Harness: If the current
TestHarnesslacks functionality needed for your test, feel free to add it.
4. Verification
- Run tests
- Run analysis
- Format the code
5. Documentation
- Run the
pkgs/dart_mcp_server/tool/update_readme.dartscript to update theREADME.mdfile with any new features, it must be ran from thepkgs/dart_mcp_serverdirectory. - Apply any other manual edits to the
README.mdfile as needed. - Update the
CHANGELOG.mdfile to include any user facing updates.
6. Update this skill
- Update this
SKILL.mdfile if that would be helpful for future features.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
Update dart_mcp_server README.md file
Instructions for updating the README.md file in the `dart_mcp_server` package.
Update MCP Spec Version
Instructions for updating the supported Model Context Protocol (MCP) specification version in the `dart_mcp` package.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
Didn't find tool you were looking for?