# MCP Vision Relay - Overview
This document complements the top-level README with additional notes that are useful when extending the project.
## Architecture at a Glance
- **Entry point**: `src/index.ts` loads environment variables and starts the MCP server.
- **Server layer**: `src/server/server.ts` wires MCP types to the tool registry.
- **Provider layer**: `src/providers/` isolates provider-specific logic (Gemini, Qwen). Each provider exposes a single function that receives normalized options and returns stdout/metadata.
- **Tool layer**: `src/tools/` deals with Zod schemas, argument validation, and conversion to MCP responses. Each tool uses a provider plus shared utilities.
- **Utilities**: `src/utils/` implements image preparation, CLI execution, prompt helpers, etc.
## Adding a New Provider
1. Implement a file under `src/providers/yourProvider.ts` that accepts the normalized call shape and invokes the CLI/API.
2. Reuse `prepareImage` if the provider consumes local files/URLs.
3. Register a new tool in `src/tools/` that references your provider and defines a Zod schema.
4. Export the tool from `src/tools/index.ts` so the registry can pick it up.
## Testing
The `scripts/dev` directory holds simple TS scripts that call `runTool` directly. They are intentionally light-weight and should remain free of additional dependencies.
## Naming Conventions
- Files and directories use `kebabCase` when generated by build tools; TypeScript modules prefer `camelCase` exports.
- Temporary files are written to the directory configured by `appConfig.tempDir`, defaulting to `mcp-vision-relay-cache` under the OS temp path.