← Back to context

Comment by jameshiew

7 months ago

I've barely tried Claude Code but looking to experiment with it as well after hearing a lot of good things about it. I've had good experiences with the GitHub Copilot agent in VS Code for working with Rust, specifically with Sonnet 4.

Refactoring duplicate code into a helper function should be achievable with current agents. To replace existing code with an external crate , you could try giving the agent access to a browser (e.g. playwright-mcp), and instructing it to browse the crate docs. For anything that involves using APIs that may be past the knowledge cutoff for the agent's model, it's definitely worthwhile to have some MCP tools on hand that'll let it browse for up-to-date info - the brave-search and context7 MCPs are good.

Could you share your mcp configuration? I am having trouble getting GitHub copilot to work with mcp.

  • This is my `mcp.json` in VS Code (requires `uvx` and `npx` to be available):

      {
       "servers": {
        "context7": {
         "command": "npx",
         "args": [
          "-y",
          "@upstash/context7-mcp"
         ],
         "type": "stdio"
        },
        "fetch": {
         "command": "uvx",
         "args": [
          "mcp-server-fetch"
         ],
         "type": "stdio"
        },
        "git": {
         "command": "uvx",
         "args": [
          "mcp-server-git"
         ],
         "type": "stdio"
        },
        "playwright": {
         "command": "npx",
         "args": [
          "@playwright/mcp@latest"
         ],
         "type": "stdio"
        },
        "brave-search": {
         "command": "npx",
         "args": [
          "-y",
          "@modelcontextprotocol/server-brave-search"
         ],
         "env": {
          "BRAVE_API_KEY": "${input:brave-api-key}"
         },
         "type": "stdio"
        }
       },
       "inputs": [
        {
         "type": "promptString",
         "id": "brave-api-key",
         "description": "Brave Data for AI API Key",
         "password": true
        }
       ]
      }
    

    The Sonnet 4 agent usually defaults to using `fetch` for getting webpages, but I've seen it sometimes try playwright on it's own. It seems the brave-search MCP server is deprecated now, so actually it's probably not the best option as a search MCP (you also need to sign up for an API key), right now it works well though!