Skip to content

Instantly share code, notes, and snippets.

@zsmatrix62
Forked from thirdlf03/AGENTS.md
Created September 3, 2025 06:09
Show Gist options
  • Save zsmatrix62/bccc4e65ee7cad5b4b312bcae5485c74 to your computer and use it in GitHub Desktop.
Save zsmatrix62/bccc4e65ee7cad5b4b312bcae5485c74 to your computer and use it in GitHub Desktop.

About Serena MCP Tools

Serena MCP is a semantic coding tool that enables efficient analysis and editing of codebases. It understands project structure and provides precise symbol‑level operations (classes, functions, variables, etc.).

Main Features

1. Project Management

  • mcp__serena__activate_project - Activate a project
  • mcp__serena__onboarding - Initial project analysis and information gathering
  • mcp__serena__check_onboarding_performed - Check onboarding status
  • mcp__serena__remove_project - Delete a project
  • mcp__serena__get_current_config - Get the current configuration

2. File and Directory Operations

  • mcp__serena__list_dir - List directory contents
  • mcp__serena__find_file - Search for files (supports wildcards)
  • mcp__serena__search_for_pattern - Search code using regular‑expression patterns
  • mcp__serena__read_file - Read file contents (not recommended; prefer symbol operations)
  • mcp__serena__create_text_file - Create a text file

3. Symbol Operations (Most Powerful)

  • mcp__serena__get_symbols_overview - List top‑level symbols in a file
  • mcp__serena__find_symbol - Search symbols by name path (classes, methods, functions, etc.)
  • mcp__serena__find_referencing_symbols - Find references to a symbol
  • mcp__serena__replace_symbol_body - Replace an entire symbol
  • mcp__serena__insert_before_symbol - Insert content before a symbol
  • mcp__serena__insert_after_symbol - Insert content after a symbol

4. Text Editing

  • mcp__serena__replace_regex - Replace using regular expressions
  • mcp__serena__insert_at_line - Insert at a specific line
  • mcp__serena__delete_lines - Delete lines
  • mcp__serena__replace_lines - Replace lines

5. Memory System

  • mcp__serena__write_memory - Save project information
  • mcp__serena__read_memory - Read saved information
  • mcp__serena__list_memories - List available memories
  • mcp__serena__delete_memory - Delete a memory

6. Thinking Support Tools

  • mcp__serena__think_about_collected_information - Analyze collected information
  • mcp__serena__think_about_task_adherence - Check task adherence
  • mcp__serena__think_about_whether_you_are_done - Confirm completion status

7. Other Utilities

  • mcp__serena__execute_shell_command - Execute shell commands
  • mcp__serena__switch_modes - Switch operation modes
  • mcp__serena__summarize_changes - Summarize changes
  • mcp__serena__restart_language_server - Restart the language server
  • mcp__serena__prepare_for_new_conversation - Prepare for a new conversation

About Context7 MCP Tools

Context7 MCP provides fast, structured access to open‑source library documentation and examples via a stable Library ID. Use it to resolve an exact library identifier and fetch focused docs (e.g., by topic) with relevant code snippets and Q&A.

Main Features

1. Documentation Retrieval

  • context7__get-library-docs — Retrieve documentation for a specific library.
    • Parameters: context7CompatibleLibraryID (e.g., /vercel/next.js or /vercel/next.js/v14.3.0-canary.87), optional tokens limit, optional topic (e.g., routing, hooks).
    • Returns: Curated code snippets and Q&A extracted from the library's canonical sources.

2. Library Resolution

  • context7__resolve-library-id — Find the best matching Context7‑compatible Library ID.
    • Input: Free‑form library name (e.g., next.js).
    • Output: Ranked candidates with ID, description, snippet counts, and trust score. Pick the most authoritative match, typically the official repo.

Recommended Workflow

  1. Resolve: Call context7__resolve-library-id with the library name and select the top official ID.
  2. Fetch: Call context7__get-library-docs with the chosen ID; pass a focused topic to narrow results and a tokens cap if needed.
  3. Use: Incorporate returned snippets and Q&A into your work; cite upstream docs when appropriate.

Example (Next.js)

  • Resolved ID: /vercel/next.js (official Next.js repository).
  • Targeted fetch: context7__get-library-docs with topic: "routing" returns practical snippets (e.g., Route Handlers, dynamic segments, next/link prefetch behavior) and concise Q&A.

Tips

  • Prefer exact IDs if the user supplies one; otherwise resolve first for accuracy.
  • Use topic to reduce noise and speed up retrieval.
  • Increase tokens only when you need broader coverage; start small for targeted queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment