Skip to Content
AffFast
AI tools

VS Code

Add the MCP server to VS Code with an install link or .vscode/mcp.json.

VS Code reads MCP servers from .vscode/mcp.json. The key goes in a header. VS Code can ask you for the key one time and store it. The file then does not hold the key.

Install with a file

  1. Make a test key in the dashboard. A test key starts with sk_test_.

  2. Make the file .vscode/mcp.json:

    {
      "inputs": [
        {
          "type": "promptString",
          "id": "ans-api-key",
          "description": "AffFast API key",
          "password": true
        }
      ],
      "servers": {
        "afffast": {
          "type": "http",
          "url": "https://api.afffast.com/mcp",
          "headers": { "Authorization": "Bearer ${input:ans-api-key}" }
        }
      }
    }
  3. Start the server. Open the Command Palette and run MCP: List Servers. Select afffast, then Start Server.

  4. VS Code asks for the key. Paste the test key into this prompt. VS Code stores it. Do not paste it in a chat.

You can also run MCP: Add Server, choose HTTP, and enter https://api.afffast.com/mcp. Then add the headers field to the new entry.

This link opens VS Code and shows the server for review: Install in VS Code.

The link does not carry a key. After the install, add the headers field from the file above.

Check that it works

  • Run MCP: List Servers. The server must be running.
  • Open the Chat view in agent mode. Select the tools icon. The tools of the server must be in the list.

Example prompts

  • "Use the afffast tools to show the revenue by network this year."
  • "List the conversions that have the status pending and are older than 30 days."
  • "Show the clicks by country for the link link_...."

Troubleshooting

  • The server does not start. Run MCP: List Servers, select the server and look at the output. A 401 error means that the key is wrong. Make a new key, and start the server again.
  • The tools are missing. The key decides the tools. A read-only key has no write tools.
  • The link does not work. Use the file method.
  • A 429 error. Wait for the time in Retry-After.

Security

  • Never paste a key into a chat. Use the promptString input.
  • Start with a test key. A test key reads and writes test data only.
  • Use a read-only key if the tool must only read.
  • Never write the key in .vscode/mcp.json. The file is often committed.

On this page