AgentSkillsCN

mcp-tools

MCP(模型上下文协议)工具,可用于代码智能、重构、浏览器自动化,以及外部集成。使用cclsp进行重构、查找引用、重命名符号;使用Playwright进行UI测试;使用GitHub MCP进行PR操作。

SKILL.md
--- frontmatter
name: mcp-tools
description: MCP (Model Context Protocol) tools for code intelligence, refactoring, browser automation, and external integrations. Use cclsp for refactoring, find references, rename symbols. Use Playwright for UI testing. Use GitHub MCP for PR operations.

MCP Tools Reference

This skill documents the MCP servers available for enhanced code intelligence, automation, and integrations.

CCLSP (Code Intelligence) - Refactoring Powerhouse

The cclsp MCP provides Language Server Protocol capabilities for intelligent code operations. Use these tools for any refactoring task - they're significantly more reliable than text-based find/replace.

Available Tools

ToolPurposeWhen to Use
mcp__cclsp__find_definitionFind where a symbol is definedUnderstanding code, navigating to implementations
mcp__cclsp__find_referencesFind all usages of a symbolImpact analysis before refactoring
mcp__cclsp__rename_symbolRename across entire codebaseRefactoring variable/function/class names
mcp__cclsp__rename_symbol_strictRename at specific positionWhen rename_symbol finds multiple candidates
mcp__cclsp__get_diagnosticsGet TypeScript/lint errorsChecking code health before/after changes
mcp__cclsp__get_hoverGet type info/docs at positionUnderstanding types, checking signatures
mcp__cclsp__find_workspace_symbolsSearch symbols by nameFinding classes/functions across codebase
mcp__cclsp__find_implementationFind interface implementationsUnderstanding polymorphism, finding concrete classes
mcp__cclsp__prepare_call_hierarchyPrepare for call analysisRequired before get_incoming_calls/get_outgoing_calls
mcp__cclsp__get_incoming_callsFind callers of a functionImpact analysis - who calls this?
mcp__cclsp__get_outgoing_callsFind callees of a functionDependency analysis - what does this call?
mcp__cclsp__restart_serverRestart LSP serverIf results seem stale or incorrect

Common Patterns

Safe Rename Refactoring

code
1. Find all references first (impact analysis):
   mcp__cclsp__find_references
     file_path: "backend/src/services/user.service.ts"
     symbol_name: "getUserById"

2. Review the references to ensure you want to rename all of them

3. Perform the rename (dry_run first):
   mcp__cclsp__rename_symbol
     file_path: "backend/src/services/user.service.ts"
     symbol_name: "getUserById"
     new_name: "fetchUserById"
     dry_run: true

4. If dry_run looks good, execute the rename:
   mcp__cclsp__rename_symbol
     file_path: "backend/src/services/user.service.ts"
     symbol_name: "getUserById"
     new_name: "fetchUserById"
     dry_run: false

Understanding Call Flow

code
1. Prepare call hierarchy:
   mcp__cclsp__prepare_call_hierarchy
     file_path: "backend/src/services/enrichment.service.ts"
     line: 45
     character: 10

2. Find what calls this function:
   mcp__cclsp__get_incoming_calls
     file_path: "backend/src/services/enrichment.service.ts"
     line: 45
     character: 10

3. Find what this function calls:
   mcp__cclsp__get_outgoing_calls
     file_path: "backend/src/services/enrichment.service.ts"
     line: 45
     character: 10

Finding Interface Implementations

code
mcp__cclsp__find_implementation
  file_path: "backend/src/types/services.ts"
  line: 15  # Line where interface method is defined
  character: 5

Checking Code Health

code
mcp__cclsp__get_diagnostics
  file_path: "backend/src/services/new-feature.service.ts"

# Returns TypeScript errors, warnings, and hints

Best Practices

  1. Always use dry_run first for rename operations
  2. Check references before renaming to understand impact
  3. Use find_workspace_symbols when you don't know the file location
  4. Restart server if results seem incorrect after file changes
  5. Prefer cclsp over grep/sed for any symbol-aware operations

BetterStack (Production Logs)

See the betterstack-logs skill for comprehensive documentation.

Quick Reference

ToolPurpose
mcp__betterstack__telemetry_create_cloud_connection_toolCreate connection credentials (1hr expiry)
mcp__betterstack__telemetry_queryExecute ClickHouse SQL queries
mcp__betterstack__telemetry_build_explore_query_toolGenerate query from natural language
mcp__betterstack__telemetry_get_source_fields_toolList available log fields
mcp__betterstack__uptime_list_incidents_toolList uptime incidents

Quick Log Query

code
1. Create connection:
   mcp__betterstack__telemetry_create_cloud_connection_tool
     team_id: <your-team-id>
     source_id: <your-source-id>

2. Query errors:
   mcp__betterstack__telemetry_query
     table: "<your-table>.render_production_5"
     query: "SELECT dt, JSONExtract(raw, 'message', 'Nullable(String)') AS message
             FROM remote(<your-table>_render_production_5_logs)
             WHERE JSONExtract(raw, 'level', 'Nullable(String)') = 'error'
             ORDER BY dt DESC LIMIT 20"
     host: [from connection]
     username: [from connection]
     password: [from connection]

GitHub MCP

For pull request and issue management.

Available Tools

ToolPurpose
mcp__github__create_pull_requestCreate a new PR
mcp__github__pull_request_readGet PR details, diff, status, files, comments
mcp__github__merge_pull_requestMerge a PR
mcp__github__list_pull_requestsList PRs with filters
mcp__github__search_pull_requestsSearch PRs
mcp__github__issue_readRead issue details
mcp__github__issue_writeCreate/update issues
mcp__github__search_codeSearch code in repos
mcp__github__get_file_contentsGet file from repo

Common Patterns

Review a PR

code
mcp__github__pull_request_read
  owner: "<your-org>"
  repo: "<your-repo>"
  pullNumber: 123
  method: "get_diff"

Get PR Review Comments

code
mcp__github__pull_request_read
  owner: "<your-org>"
  repo: "<your-repo>"
  pullNumber: 123
  method: "get_review_comments"

Playwright MCP (Browser Automation)

For UI testing and browser automation.

Available Tools

ToolPurpose
mcp__playwright__browser_navigateNavigate to URL
mcp__playwright__browser_snapshotGet page accessibility snapshot
mcp__playwright__browser_take_screenshotCapture screenshot
mcp__playwright__browser_clickClick element
mcp__playwright__browser_fill_formFill form fields
mcp__playwright__browser_typeType text
mcp__playwright__browser_run_codeRun custom Playwright code
mcp__playwright__browser_console_messagesGet console output
mcp__playwright__browser_network_requestsMonitor network

Common Patterns

Navigate and Screenshot

code
1. Navigate:
   mcp__playwright__browser_navigate
     url: "http://localhost:3100/portal/dashboard"

2. Screenshot:
   mcp__playwright__browser_take_screenshot

Fill and Submit Form

code
mcp__playwright__browser_fill_form
  fields: [
    {"selector": "#email", "value": "test@example.com"},
    {"selector": "#password", "value": "password123"}
  ]

mcp__playwright__browser_click
  selector: "button[type='submit']"

Email MCP

For email operations.

Available Tools

ToolPurpose
mcp__email__list_available_accountsList configured email accounts
mcp__email__list_emails_metadataList emails with filters
mcp__email__get_emails_contentGet full email content
mcp__email__send_emailSend an email
mcp__email__delete_emailsDelete emails
mcp__email__download_attachmentDownload attachment

When to Use Each MCP

TaskMCPTool
Rename a function/variablecclsprename_symbol
Find all usages of a symbolcclspfind_references
Understand call hierarchycclspget_incoming_calls, get_outgoing_calls
Check TypeScript errorscclspget_diagnostics
Query production logsbetterstacktelemetry_query
Investigate production errorsbetterstacktelemetry_query with error filter
Review a pull requestgithubpull_request_read
Create a PR programmaticallygithubcreate_pull_request
Test UI flowsplaywrightVarious browser_* tools
Check email deliveryemaillist_emails_metadata

Related Skills

  • betterstack-logs - Comprehensive BetterStack log querying
  • render-infrastructure - Production SSH access