> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anysite.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 theme={null}
{
  "apiKey": "your-hdw-api-key",
  "baseUrl": "https://api.anysite.io",
  "defaultTimeout": 30000,
  "retryAttempts": 3,
  "enableLogging": true,
  "logLevel": "info"
}
```

### Configuration Options

<ParamField path="apiKey" type="string" required>
  Your Anysite API access token. Get this from your [dashboard](https://anysite.io).
</ParamField>

<ParamField path="baseUrl" type="string" default="https://api.anysite.io">
  The base URL for the Anysite API. Usually you don't need to change this.
</ParamField>

<ParamField path="defaultTimeout" type="number" default="30000">
  Default timeout in milliseconds for API requests.
</ParamField>

<ParamField path="retryAttempts" type="number" default="3">
  Number of retry attempts for failed API requests.
</ParamField>

<ParamField path="enableLogging" type="boolean" default="true">
  Enable or disable logging output.
</ParamField>

<ParamField path="logLevel" type="string" default="info">
  Log level: `debug`, `info`, `warn`, `error`.
</ParamField>

## Environment Variables

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

```bash theme={null}
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"
```

<Note>
  Environment variables take precedence over configuration file settings.
</Note>

## Tool-Specific Configuration

### LinkedIn Tools Configuration

Configure LinkedIn-specific settings:

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

### Instagram Tools Configuration

Configure Instagram-specific settings:

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

### Rate Limiting Configuration

Configure rate limiting to stay within API limits:

```json theme={null}
{
  "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 theme={null}
{
  "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 theme={null}
{
  "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 theme={null}
{
  "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 theme={null}
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

<AccordionGroup>
  <Accordion title="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
  </Accordion>

  <Accordion title="Connection Timeout">
    * Check your internet connection
    * Verify the base URL is correct
    * Try increasing the timeout value
  </Accordion>

  <Accordion title="Rate Limit Errors">
    * Enable rate limiting in configuration
    * Reduce requests per minute
    * Check your API plan limits
  </Accordion>
</AccordionGroup>

### Debug Mode

Enable debug logging for troubleshooting:

```json theme={null}
{
  "logLevel": "debug",
  "enableLogging": true
}
```

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

## Next Steps

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