Setup Instructions
Environment-specific configurations for MCP setup
By Onli Platform2024-01-013 min read
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:
{
"onli-mcp": {
"url": "https://stg.onli.app",
"headers": {
"User-Id": "<master-user-id>",
"App-Key": "<master-app-key>",
"App-Symbol": "ENGMA"
}
}
[object Object]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:
{
"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:
{
"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:
{
"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
- Log into your Onli Platform dashboard
- Navigate to API Settings > MCP Configuration
- Generate or retrieve your:
- Master User ID
- App Key
- App Symbol (if not already assigned)
Step 2: Environment Configuration
- Create your configuration file (e.g.,
mcp-config.json) - Add the appropriate configuration for your environment
- Secure your credentials using environment variables or secret management
Step 3: Initialize MCP Client
// 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
// 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
{
"options": {
"timeout": 15000,
"connectionTimeout": 5000,
"requestTimeout": 10000
}
}
Retry Configuration
{
"options": {
"retries": 3,
"retryDelay": 1000,
"retryOnFailure": true
}
}
Logging Configuration
{
"options": {
"debug": false,
"logLevel": "info",
"logRequests": true,
"logResponses": false
}
}
Next Steps
After completing the basic setup:
- Review Best Practices for optimization guidelines
- Test your configuration thoroughly
- Implement error handling and monitoring
- Refer to Troubleshooting if you encounter issues
Support
For setup assistance or questions:
- Email: support@onli.one
- Documentation: Configuration Guides
- Community: Onli Developer Forum