

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567# MCP Tool Implementation Pattern89Every MCP tool should follow this structure:1011```python12from typing import Optional, Literal13from pydantic import BaseModel, Field14from fastmcp import FastMCP1516mcp = FastMCP("UniFi MCP Server")1718@mcp.tool()19async def tool_name(20 # Required parameters first21 site_id: str,22 resource_id: str,2324 # Optional parameters with defaults25 optional_param: Optional[str] = None,2627 # Safety parameters for mutating operations28 confirm: bool = False,29 dry_run: bool = False30) -> dict:31 """32 Clear, concise description of what the tool does.3334 Args:35 site_id: Always include site_id for multi-site support36 resource_id: Specific resource identifier37 optional_param: Description of optional parameter38 confirm: REQUIRED True for mutating operations (safety)39 dry_run: Preview changes without applying them4041 Returns:42 Dictionary with operation results. Specify structure.4344 Raises:45 MCPError: For all MCP-specific errors46 ValueError: For invalid inputs47 UniFiConnectionError: For API connection issues48 """49 # 1. Input validation50 if not site_id:51 raise ValueError("site_id is required")5253 # 2. Safety checks for mutating operations54 if not confirm and not dry_run:55 raise MCPError("This operation requires confirm=True")5657 # 3. Audit logging58 logger.info(59 f"tool_name: site={site_id}, id={resource_id}, dry_run={dry_run}",60 extra={"operation": "tool_name", "site_id": site_id}61 )6263 # 4. Dry-run mode64 if dry_run:65 preview = await generate_preview(site_id, resource_id)66 return {"status": "preview", "changes": preview}6768 # 5. Execute operation69 try:70 result = await execute_operation(site_id, resource_id)71 except UniFiAPIError as e:72 logger.error(f"Operation failed: {e}")73 raise MCPError(f"Failed to execute operation: {str(e)}")7475 # 6. Cache invalidation (if applicable)76 if result.get("success"):77 await cache.invalidate(f"resource:{site_id}")7879 # 7. Return structured result80 return {81 "status": "success",82 "resource_id": resource_id,83 "data": result84 }85```8687## MCP-Specific Guidelines8889- Use `@mcp.tool()` decorator for tool definitions90- Use `@mcp.resource()` decorator for resource endpoints91- Always include `site_id` for multi-site support92- Implement proper error handling with custom exceptions93- Return structured dictionaries for consistency94
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| enuno/unifi-mcp-server.claude/skills/fastmcp/CLAUDE.md · 226 | CLAUDE.md | no sections | 25/100 | today | |
| enuno/unifi-mcp-server.clinerules · 226 | Cline rules | setuptestlint-formatstyle+10 | 96/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/common-mistakes.mdc · 226 | Cursor rules | testlint-formatgitdo-not | 93/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/core-principles.mdc · 226 | Cursor rules | teststyletypestesting-strategy+3 | 59/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/environment-setup.mdc · 226 | Cursor rules | setupgitsecurityapi+2 | 57/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/project-context.mdc · 226 | Cursor rules | testlint-formatstylearch+2 | 73/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/unifi-api.mdc · 226 | Cursor rules | setupsecurityapiui+1 | 62/100 | today | |
| enuno/unifi-mcp-server.cursor/rules/workflow.mdc · 226 | Cursor rules | testlint-formatgitagent-behaviour | 86/100 | today | |
| enuno/unifi-mcp-server.cursorrules · 226 | .cursorrules | setuptestlint-formatstyle+7 | 93/100 | today | |
| enuno/unifi-mcp-serverAGENTS.md · 226 | AGENTS.md | setuptestlint-formatstyle+10 | 84/100 | today | |
| enuno/unifi-mcp-serverCLAUDE.md · 226 | CLAUDE.md | testlint-formatarchtesting-strategy+4 | 90/100 | today | |
| enuno/unifi-mcp-serverGEMINI.md · 226 | GEMINI.md | setuptestlint-formatstyle+8 | 89/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 14 days ago | |
| pr-pm/prpm.cursor/rules/github-actions-testing.mdc · 121 | Cursor rules | setupbuildstylearch+4 | 93/100 | 14 days ago | |
| enuno/unifi-mcp-server.cursor/rules/common-mistakes.mdc · 226 | Cursor rules | testlint-formatgitdo-not | 93/100 | today | |
| iloveitaly/llm-ide-rules.cursor/rules/general.mdc · 13 | Cursor rules | teststyledo-notagent-behaviour+1 | 92/100 | 14 days ago | |
| pr-pm/prpm.cursor/rules/creating-agents-md.mdc · 121 | Cursor rules | testlint-formatstylearch+7 | 92/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/enuno-unifi-mcp-server-cursor-rules-mcp-tools)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.