> ## Agent Instructions
>
> Base URL: https://api.anysite.io
> Authentication: send the `access-token` header. Do NOT use `Authorization: Bearer`.
> Full endpoint catalog: https://app.anysite.io/docs
# MCP Server Configuration

Configure the Anysite MCP Server for optimal performance

## Overview

The Anysite MCP Server requires proper configuration to connect with your API credentials and customize tool behavior. This guide covers all configuration options available.

## Configuration File

The MCP server uses a JSON configuration file that should be placed in your project directory or specified via environment variables.

### Basic Configuration

Create a `hdw-config.json` file with the following structure:

```json
{
  "apiKey": "your-hdw-api-key",
  "baseUrl": "https://api.anysite.io",
  "defaultTimeout": 30000,
  "retryAttempts": 3,
  "enableLogging": true,
  "logLevel": "info"
}
```

### Configuration Options

  Your Anysite API access token. Get this from your [dashboard](https://app.anysite.io/register).

  The base URL for the Anysite API. Usually you don't need to change this.

  Default timeout in milliseconds for API requests.

  Number of retry attempts for failed API requests.

  Enable or disable logging output.

  Log level: `debug`, `info`, `warn`, `error`.

## Environment Variables

Alternatively, you can configure the MCP server using environment variables:

```bash
export HDW_API_KEY="your-hdw-api-key"
export HDW_BASE_URL="https://api.anysite.io"
export HDW_TIMEOUT="30000"
export HDW_RETRY_ATTEMPTS="3"
export HDW_LOG_LEVEL="info"
```

> 
Environment variables take precedence over configuration file settings.

## Tool-Specific Configuration

### LinkedIn Tools Configuration

Configure LinkedIn-specific settings:

```json
{
  "tools": {
    "linkedin": {
      "maxResults": 50,
      "includePrivateProfiles": false,
      "searchDepth": "standard"
    }
  }
}
```

### Instagram Tools Configuration

Configure Instagram-specific settings:

```json
{
  "tools": {
    "instagram": {
      "maxPosts": 100,
      "includeStories": false,
      "mediaQuality": "standard"
    }
  }
}
```

### Rate Limiting Configuration

Configure rate limiting to stay within API limits:

```json
{
  "rateLimiting": {
    "enabled": true,
    "requestsPerMinute": 60,
    "burstLimit": 10
  }
}
```

## Claude Desktop Integration

To use the MCP server with Claude Desktop, add this configuration to your Claude config file:

### macOS
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "hdw": {
      "command": "node",
      "args": ["/path/to/hdw-mcp-server/dist/index.js"],
      "env": {
        "HDW_API_KEY": "your-hdw-api-key"
      }
    }
  }
}
```

### Windows
Edit `%APPDATA%\Claude\claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "hdw": {
      "command": "node",
      "args": ["C:\\path\\to\\hdw-mcp-server\\dist\\index.js"],
      "env": {
        "HDW_API_KEY": "your-hdw-api-key"
      }
    }
  }
}
```

## Cursor Integration

For Cursor IDE integration, add the MCP server to your workspace settings:

```json
{
  "mcp.servers": {
    "hdw": {
      "command": "node",
      "args": ["./node_modules/@horizondatawave/mcp-server/dist/index.js"],
      "env": {
        "HDW_API_KEY": "your-hdw-api-key"
      }
    }
  }
}
```

## Validation

Test your configuration by running the MCP server in debug mode:

```bash
node dist/index.js --debug --config ./hdw-config.json
```

You should see output similar to:

```
[INFO] Anysite MCP Server starting...
[INFO] Configuration loaded successfully
[INFO] API connection verified
[INFO] 20+ tools registered
[INFO] MCP Server ready on stdio
```

## Troubleshooting

### Common Issues

#### Invalid API Key Error

  - Verify your API key is correct and active
  - Check that the key has proper permissions
  - Ensure the key isn't expired

#### Connection Timeout

  - Check your internet connection
  - Verify the base URL is correct
  - Try increasing the timeout value

#### Rate Limit Errors

  - Enable rate limiting in configuration
  - Reduce requests per minute
  - Check your API plan limits

### Debug Mode

Enable debug logging for troubleshooting:

```json
{
  "logLevel": "debug",
  "enableLogging": true
}
```

This will provide detailed information about API requests, responses, and internal operations.

## Next Steps

- [Explore Available Tools](/docs/mcp-server/tools) - Learn about all 20+ available tools
- [View Examples](/docs/mcp-server/local-server/examples) - See practical usage examples
- [Integration Guide](/docs/mcp-server/local-server/installation) - Complete installation guide
