# Project Agent Instructions

## Exa MCP web search

This repository includes a Zed MCP configuration for Exa in `.zed/settings.json`.
It enables these tools:

- `web_search_exa` — real-time web search
- `web_fetch_exa` — fetch/read full webpage content as markdown
- `web_search_advanced_exa` — advanced search with filters, date ranges, summaries, highlights, and subpage crawling options

Canonical Exa MCP documentation:

- https://docs.exa.ai/reference/exa-mcp

## Zed MCP configuration

The committed project config uses Exa's remote MCP endpoint:

```json
{
  "context_servers": {
    "exa": {
      "url": "https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa"
    }
  }
}
```

After changing MCP configuration, fully restart Zed and open a new agent session so the tools are detected.

## Local MCP/API key location on this PC

On this Windows PC, the Exa API key is stored as a user-level environment variable:

- Variable name: `EXA_API_KEY`
- Scope: Windows user environment variable
- Set with: `setx EXA_API_KEY "<secret>"`

Agents should read the key from `EXA_API_KEY` when they need to configure local-only tooling. Do not copy the key value into committed repository files.

The local Zed user settings file is:

- `C:\Users\remote\AppData\Roaming\Zed\settings.json`

That file is outside the repository and may contain local/private MCP credentials. It is intentionally not committed.

## Google Docs report access

The working Google Docs report for this project is:

- URL: `https://docs.google.com/document/d/1pMGQKWarc07-JaVlkYcgF9FZb2hgXPZi02kIX4k5It4/edit`
- Document ID: `1pMGQKWarc07-JaVlkYcgF9FZb2hgXPZi02kIX4k5It4`

To read or edit this document via API, use the Google Docs API with the service account credential stored locally at:

- `dokumen/pythonyoubeupload-b126b8249484.json`

The Google Doc must be shared as Editor to the service account email in that credential file. Use these scopes as needed:

- Read/write Docs: `https://www.googleapis.com/auth/documents`
- Read-only Docs: `https://www.googleapis.com/auth/documents.readonly`
- Export through Drive: `https://www.googleapis.com/auth/drive.readonly`

Do not commit the service account JSON. It is ignored by `.gitignore`.

## Image generation API

If image generation is needed, use the configured image API through local secrets only:

- Base URL / endpoint: `https://member.wakdondin.my.id/api/v1`
- Model: `gpt-image-2`
- API key environment variable: `WAK_IMAGE_API_KEY`
- Set locally on Windows with: `setx WAK_IMAGE_API_KEY "<secret>"`

Do not write the image API key into committed repository files. Read it from `WAK_IMAGE_API_KEY` or a local-only user settings file.

## Authentication and secrets

Do not commit Exa API keys, Google service account keys, image API keys, or any other secrets to this repository.

Exa MCP can work with OAuth/free-plan access. If a personal API key is needed for rate limits or production use, configure it only through the local `EXA_API_KEY` environment variable or a local/user-level Zed settings file, not in committed project files:

```json
{
  "context_servers": {
    "exa": {
      "url": "https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa",
      "headers": {
        "x-api-key": "YOUR_EXA_API_KEY"
      }
    }
  }
}
```

If an API key was pasted into chat, logs, or a committed file, treat it as compromised and rotate/revoke it in the provider dashboard.

## Tool naming notes

Older Exa MCP tool names may appear in outdated guides. Prefer the current tools:

- Use `web_fetch_exa` instead of deprecated `crawling_exa`.
- Use `web_search_exa` for general web/code search.
- Use `web_search_advanced_exa` for domain filters, dates, summaries, highlights, and crawling-style advanced options.
