---
title: "Setup Instructions"
description: "Environment-specific configurations for MCP setup"
author: "Onli Platform"
date: "2024-01-01"
tags: ["mcp", "setup", "configuration", "environment"]
---

# MCP Setup Instructions

This guide provides detailed setup instructions for configuring MCP (Model Context Protocol) in different environments.

## Prerequisites

Before setting up MCP, ensure you have:

- **Valid Onli Platform Account**: Active account with appropriate permissions
- **API Credentials**: Master User ID and App Key from your Onli dashboard
- **Network Access**: Ability to reach Onli platform endpoints
- **Development Environment**: Node.js 18+ or compatible runtime

## Basic MCP Configuration

### Configuration Format

MCP configurations follow a standardized JSON format. Here's the basic structure:

```json
{
  "onli-mcp": {
    "url": "https://stg.onli.app",
    "headers": {
      "User-Id": "<master-user-id>",
      "App-Key": "<master-app-key>",
      "App-Symbol": "ENGMA"
    }
  }
}
```

### Configuration Parameters

| Parameter | Description | Required | Example |
|-----------|-------------|----------|---------|
| `url` | Onli platform endpoint URL | Yes | `https://stg.onli.app` |
| `User-Id` | Your master user identifier | Yes | `user_12345` |
| `App-Key` | Application-specific API key | Yes | `ak_abcd1234...` |
| `App-Symbol` | Application symbol identifier | Yes | `ENGMA` |

## Environment-Specific Setup

### Development Environment

For development environments, use the staging endpoint:

```json
{
  "onli-mcp": {
    "url": "https://stg.onli.app",
    "headers": {
      "User-Id": "dev_user_id",
      "App-Key": "dev_app_key",
      "App-Symbol": "ENGMA"
    },
    "options": {
      "timeout": 30000,
      "retries": 3,
      "debug": true
    }
  }
}
```

### Production Environment

For production environments, use the production endpoint:

```json
{
  "onli-mcp": {
    "url": "https://api.onli.app",
    "headers": {
      "User-Id": "prod_user_id",
      "App-Key": "prod_app_key",
      "App-Symbol": "ENGMA"
    },
    "options": {
      "timeout": 15000,
      "retries": 5,
      "debug": false
    }
  }
}
```

### Testing Environment

For testing and QA environments:

```json
{
  "onli-mcp": {
    "url": "https://test.onli.app",
    "headers": {
      "User-Id": "test_user_id",
      "App-Key": "test_app_key",
      "App-Symbol": "ENGMA"
    },
    "options": {
      "timeout": 20000,
      "retries": 2,
      "debug": true
    }
  }
}
```

## Implementation Steps

### Step 1: Obtain Credentials

1. Log into your Onli Platform dashboard
2. Navigate to **API Settings** > **MCP Configuration**
3. Generate or retrieve your:
   - Master User ID
   - App Key
   - App Symbol (if not already assigned)

### Step 2: Environment Configuration

1. Create your configuration file (e.g., `mcp-config.json`)
2. Add the appropriate configuration for your environment
3. Secure your credentials using environment variables or secret management

### Step 3: Initialize MCP Client

```javascript
// Example initialization (implementation may vary)
const mcpConfig = require('./mcp-config.json');
const MCPClient = require('@onli/mcp-client');

const client = new MCPClient(mcpConfig['onli-mcp']);
```

### Step 4: Verify Connection

```javascript
// Example connection verification
async function verifyConnection() {
  try {
    const status = await client.healthCheck();
    console.log('MCP connection successful:', status);
  } catch (error) {
    console.error('MCP connection failed:', error);
  }
}
```

## Security Considerations

### Credential Management

- **Never commit credentials** to version control
- Use environment variables for sensitive data
- Implement credential rotation policies
- Monitor API key usage

### Network Security

- Ensure HTTPS connections only
- Implement proper timeout configurations
- Use appropriate retry policies
- Monitor connection patterns

## Advanced Configuration Options

### Timeout Settings

```json
{
  "options": {
    "timeout": 15000,
    "connectionTimeout": 5000,
    "requestTimeout": 10000
  }
}
```

### Retry Configuration

```json
{
  "options": {
    "retries": 3,
    "retryDelay": 1000,
    "retryOnFailure": true
  }
}
```

### Logging Configuration

```json
{
  "options": {
    "debug": false,
    "logLevel": "info",
    "logRequests": true,
    "logResponses": false
  }
}
```

## Next Steps

After completing the basic setup:

1. Review [Best Practices](/mcp-configuration/best-practices) for optimization guidelines
2. Test your configuration thoroughly
3. Implement error handling and monitoring
4. Refer to [Troubleshooting](/mcp-configuration/troubleshooting) if you encounter issues

## Support

For setup assistance or questions:

- **Email**: [support@onli.one](mailto:support@onli.one)
- **Documentation**: [Configuration Guides](/mcp-configuration/guides)
- **Community**: [Onli Developer Forum](https://forum.onli.app) 