Skip to content

Commit 231d6dd

Browse files
committed
fix: Config enfironment variable TFO-MCP
1 parent 22a2b1e commit 231d6dd

6 files changed

Lines changed: 849 additions & 84 deletions

File tree

.env.example

Lines changed: 182 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,205 @@
1-
# TelemetryFlow Python MCP Server - Environment Variables Example
1+
# TelemetryFlow Python MCP Server Environment Variables
22
# Copy this file to .env and fill in your values
33

4-
# Required: Anthropic API Key
5-
ANTHROPIC_API_KEY=your-api-key-here
4+
# =============================================================================
5+
# CLAUDE API (Required)
6+
# =============================================================================
7+
# Your Anthropic API key
8+
ANTHROPIC_API_KEY=your-anthropic-api-key-here
69

7-
# Optional: Server Configuration
8-
TELEMETRYFLOW_MCP_SERVER_DEBUG=false
9-
TELEMETRYFLOW_MCP_LOG_LEVEL=info
10+
# Alternative environment variable name (both are supported)
11+
# TELEMETRYFLOW_MCP_CLAUDE_API_KEY=your-api-key-here
1012

11-
# Optional: Claude Configuration
12-
TELEMETRYFLOW_MCP_CLAUDE_DEFAULT_MODEL=claude-sonnet-4-20250514
13-
TELEMETRYFLOW_MCP_CLAUDE_MAX_TOKENS=4096
14-
TELEMETRYFLOW_MCP_CLAUDE_TEMPERATURE=1.0
13+
# Claude API base URL (optional, defaults to https://api.anthropic.com)
14+
# TELEMETRYFLOW_MCP_CLAUDE_BASE_URL=https://api.anthropic.com
1515

16-
# Optional: MCP Configuration
17-
TELEMETRYFLOW_MCP_MCP_ENABLE_TOOLS=true
18-
TELEMETRYFLOW_MCP_MCP_ENABLE_RESOURCES=true
19-
TELEMETRYFLOW_MCP_MCP_ENABLE_PROMPTS=true
16+
# Default model to use (optional)
17+
# TELEMETRYFLOW_MCP_CLAUDE_DEFAULT_MODEL=claude-sonnet-4-20250514
2018

21-
# Optional: Database (for full deployment)
22-
POSTGRES_PASSWORD=your-postgres-password
23-
CLICKHOUSE_PASSWORD=your-clickhouse-password
19+
# =============================================================================
20+
# TELEMETRYFLOW OBSERVABILITY (TELEMETRYFLOW SDK)
21+
# =============================================================================
22+
# Your TelemetryFlow API key for observability (logs, metrics, traces)
23+
# Option 1: Single API key (Python SDK compatibility)
24+
TELEMETRYFLOW_API_KEY=your-telemetryflow-api-key-here
2425

25-
# Optional: TelemetryFlow SDK Configuration
26-
# Enable telemetry to send metrics, logs, and traces to TelemetryFlow platform
27-
TELEMETRYFLOW_ENABLED=false
26+
# Option 2: Split API key ID and secret (Python SDK native)
27+
# TELEMETRYFLOW_API_KEY_ID=tfk_your-key-id-here
28+
# TELEMETRYFLOW_API_KEY_SECRET=tfs_your-key-secret-here
2829

29-
# TelemetryFlow API Credentials (required if telemetry is enabled)
30-
TELEMETRYFLOW_API_KEY_ID=tfk_your-key-id-here
31-
TELEMETRYFLOW_API_KEY_SECRET=tfs_your-key-secret-here
30+
# TelemetryFlow API endpoint (default: api.telemetryflow.id:4317)
31+
TELEMETRYFLOW_ENDPOINT=localhost:4317
3232

33-
# TelemetryFlow Service Configuration
33+
# Service identification
3434
TELEMETRYFLOW_SERVICE_NAME=telemetryflow-mcp
3535
TELEMETRYFLOW_SERVICE_VERSION=1.1.2
3636
TELEMETRYFLOW_SERVICE_NAMESPACE=telemetryflow
37+
38+
# Environment (development, staging, production)
3739
TELEMETRYFLOW_ENVIRONMENT=development
3840

39-
# TelemetryFlow Connection Settings
40-
TELEMETRYFLOW_ENDPOINT=api.telemetryflow.id:4317
41+
# =============================================================================
42+
# SERVER CONFIGURATION
43+
# =============================================================================
44+
# Server host (default: localhost)
45+
TELEMETRYFLOW_MCP_SERVER_HOST=localhost
46+
47+
# Server port (default: 8080)
48+
TELEMETRYFLOW_MCP_SERVER_PORT=8080
49+
50+
# Transport type: stdio, sse, websocket (default: stdio)
51+
TELEMETRYFLOW_MCP_SERVER_TRANSPORT=stdio
52+
53+
# Debug mode (default: false)
54+
TELEMETRYFLOW_MCP_DEBUG=false
55+
56+
# =============================================================================
57+
# LOGGING
58+
# =============================================================================
59+
# Log level: debug, info, warn, error (default: info)
60+
TELEMETRYFLOW_MCP_LOG_LEVEL=info
61+
62+
# Log format: json, text (default: json)
63+
TELEMETRYFLOW_MCP_LOG_FORMAT=json
64+
65+
# =============================================================================
66+
# MCP PROTOCOL CONFIGURATION
67+
# =============================================================================
68+
# Enable tools capability (default: true)
69+
TELEMETRYFLOW_MCP_ENABLE_TOOLS=true
70+
71+
# Enable resources capability (default: true)
72+
TELEMETRYFLOW_MCP_ENABLE_RESOURCES=true
73+
74+
# Enable prompts capability (default: true)
75+
TELEMETRYFLOW_MCP_ENABLE_PROMPTS=true
76+
77+
# =============================================================================
78+
# REDIS (Caching & Queue)
79+
# =============================================================================
80+
# Redis connection URL
81+
TELEMETRYFLOW_MCP_REDIS_URL=redis://localhost:6379
82+
83+
# Enable caching (default: true)
84+
TELEMETRYFLOW_MCP_CACHE_ENABLED=true
85+
86+
# Cache TTL in seconds (default: 300)
87+
TELEMETRYFLOW_MCP_CACHE_TTL=300
88+
89+
# Enable queue processing (default: true)
90+
TELEMETRYFLOW_MCP_QUEUE_ENABLED=true
91+
92+
# Queue concurrency (default: 5)
93+
TELEMETRYFLOW_MCP_QUEUE_CONCURRENCY=5
94+
95+
# =============================================================================
96+
# DATABASE (PostgreSQL)
97+
# =============================================================================
98+
# PostgreSQL connection URL
99+
TELEMETRYFLOW_MCP_POSTGRES_URL=postgres://postgres:postgres@localhost:5432/telemetryflow_mcp?sslmode=disable
100+
101+
# Connection pool settings
102+
TELEMETRYFLOW_MCP_POSTGRES_MAX_CONNS=25
103+
TELEMETRYFLOW_MCP_POSTGRES_MIN_CONNS=5
104+
105+
# =============================================================================
106+
# ANALYTICS DATABASE (ClickHouse)
107+
# =============================================================================
108+
# ClickHouse connection URL
109+
TELEMETRYFLOW_MCP_CLICKHOUSE_URL=clickhouse://localhost:9000/telemetryflow_mcp
110+
111+
# =============================================================================
112+
# TELEMETRY CONFIGURATION
113+
# =============================================================================
114+
# Enable telemetry (default: true)
115+
TELEMETRYFLOW_MCP_TELEMETRY_ENABLED=true
116+
117+
# Telemetry backend: telemetryflow, otel (default: telemetryflow)
118+
# Uses TelemetryFlow SDK as the primary telemetry backend
119+
TELEMETRYFLOW_MCP_TELEMETRY_BACKEND=telemetryflow
120+
121+
# =============================================================================
122+
# OPENTELEMETRY COMPATIBILITY (Optional - for legacy OTEL integration)
123+
# =============================================================================
124+
# Note: TelemetryFlow SDK is the primary telemetry backend.
125+
# These settings are only used when TELEMETRY_BACKEND=otel or for OTEL export.
126+
127+
# OTLP endpoint for traces/metrics (used by TelemetryFlow SDK for OTEL export)
128+
TELEMETRYFLOW_MCP_OTLP_ENDPOINT=localhost:4317
129+
130+
# Service name (standard OTEL env var, used alongside TelemetryFlow SDK)
131+
TELEMETRYFLOW_MCP_SERVICE_NAME=telemetryflow-mcp
132+
133+
134+
# =============================================================================
135+
# TELEMETRYFLOW SDK ADVANCED SETTINGS
136+
# =============================================================================
137+
# Protocol (grpc, http)
41138
TELEMETRYFLOW_PROTOCOL=grpc
139+
140+
# Use insecure connection (default: false)
42141
TELEMETRYFLOW_INSECURE=false
142+
143+
# Request timeout in seconds
43144
TELEMETRYFLOW_TIMEOUT=30
145+
146+
# Enable compression (default: true)
44147
TELEMETRYFLOW_COMPRESSION=true
45148

46-
# TelemetryFlow Signal Configuration
149+
# Signal configuration
47150
TELEMETRYFLOW_ENABLE_TRACES=true
48151
TELEMETRYFLOW_ENABLE_METRICS=true
49152
TELEMETRYFLOW_ENABLE_LOGS=true
50153
TELEMETRYFLOW_ENABLE_EXEMPLARS=true
154+
155+
# Batch settings
156+
TELEMETRYFLOW_BATCH_TIMEOUT_MS=5000
157+
TELEMETRYFLOW_BATCH_MAX_SIZE=512
158+
159+
# Retry settings
160+
TELEMETRYFLOW_RETRY_ENABLED=true
161+
TELEMETRYFLOW_MAX_RETRIES=3
162+
TELEMETRYFLOW_RETRY_BACKOFF_MS=500
163+
164+
# Rate limiting
165+
TELEMETRYFLOW_RATE_LIMIT=1000
166+
167+
# =============================================================================
168+
# SECURITY
169+
# =============================================================================
170+
# Require API key for requests
171+
# TELEMETRYFLOW_MCP_SECURITY_REQUIRE_API_KEY=false
172+
173+
# Rate limit per minute
174+
# TELEMETRYFLOW_MCP_SECURITY_RATE_LIMIT_PER_MINUTE=100
175+
176+
# =============================================================================
177+
# DOCKER COMPOSE SPECIFIC
178+
# =============================================================================
179+
# MCP Server version
180+
TELEMETRYFLOW_MCP_VERSION=1.1.2
181+
182+
# Database ports (for docker-compose)
183+
REDIS_PORT=6379
184+
POSTGRES_PORT=5432
185+
POSTGRES_USER=postgres
186+
POSTGRES_PASSWORD=postgres
187+
POSTGRES_DB=telemetryflow_mcp
188+
CLICKHOUSE_HTTP_PORT=8123
189+
CLICKHOUSE_NATIVE_PORT=9000
190+
CLICKHOUSE_DB=telemetryflow_mcp
191+
CLICKHOUSE_USER=default
192+
CLICKHOUSE_PASSWORD=
193+
194+
# Message Queue (NATS)
195+
NATS_PORT=4222
196+
NATS_MONITOR_PORT=8222
197+
198+
# Observability ports (for docker-compose with observability profile)
199+
OTEL_GRPC_PORT=4317
200+
OTEL_HTTP_PORT=4318
201+
JAEGER_UI_PORT=16686
202+
PROMETHEUS_PORT=9090
203+
GRAFANA_PORT=3000
204+
GRAFANA_ADMIN_USER=admin
205+
GRAFANA_ADMIN_PASSWORD=admin

configs/tfo-mcp.yaml

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# TelemetryFlow Python MCP Server Configuration
22
# Python Implementation v1.1.2
33

4+
# =============================================================================
5+
# Server Configuration
6+
# =============================================================================
47
server:
58
name: "TelemetryFlow-MCP"
69
version: "1.1.2"
@@ -11,6 +14,9 @@ server:
1114
read_timeout: 300.0
1215
write_timeout: 60.0
1316

17+
# =============================================================================
18+
# Claude API Configuration
19+
# =============================================================================
1420
claude:
1521
# API key - can also be set via ANTHROPIC_API_KEY environment variable
1622
api_key: ""
@@ -21,6 +27,9 @@ claude:
2127
max_retries: 3
2228
# base_url: "" # Optional custom base URL
2329

30+
# =============================================================================
31+
# MCP Protocol Configuration
32+
# =============================================================================
2433
mcp:
2534
protocol_version: "2024-11-05"
2635
enable_tools: true
@@ -31,13 +40,89 @@ mcp:
3140
tool_timeout: 30.0
3241
max_message_size: 10485760 # 10MB
3342

43+
# =============================================================================
44+
# Logging Configuration
45+
# =============================================================================
3446
logging:
3547
level: "info" # debug, info, warning, error
3648
format: "json" # json, text
3749
output: "stderr" # stderr, stdout, or file path
3850

51+
# =============================================================================
52+
# Cache Configuration (Redis)
53+
# =============================================================================
54+
cache:
55+
redis_url: "redis://localhost:6379"
56+
cache_enabled: true
57+
cache_ttl: 300 # seconds
58+
59+
# =============================================================================
60+
# Queue Configuration (NATS)
61+
# =============================================================================
62+
queue:
63+
queue_enabled: true
64+
queue_concurrency: 5
65+
nats_url: "nats://localhost:4222"
66+
67+
# =============================================================================
68+
# Database Configuration (PostgreSQL)
69+
# =============================================================================
70+
database:
71+
postgres_url: "postgres://telemetryflow:telemetryflow@localhost:5432/tfo_mcp?sslmode=disable"
72+
postgres_max_conns: 25
73+
postgres_min_conns: 5
74+
75+
# =============================================================================
76+
# Analytics Configuration (ClickHouse)
77+
# =============================================================================
78+
analytics:
79+
clickhouse_url: "clickhouse://localhost:9000/tfo_mcp_analytics"
80+
81+
# =============================================================================
82+
# MCP Telemetry Configuration
83+
# =============================================================================
84+
telemetry_mcp:
85+
enabled: true
86+
backend: "telemetryflow" # telemetryflow, otel
87+
otlp_endpoint: "localhost:4317"
88+
service_name: "telemetryflow-mcp"
89+
90+
# =============================================================================
91+
# TelemetryFlow SDK Configuration
92+
# =============================================================================
3993
telemetry:
4094
enabled: false
4195
service_name: "telemetryflow-mcp"
42-
otlp_endpoint: "localhost:4317"
43-
sampling_rate: 1.0
96+
service_version: "1.1.2"
97+
service_namespace: "telemetryflow"
98+
environment: "development"
99+
100+
# API credentials - supports both single key (Go SDK) and split keys (Python SDK)
101+
api_key: "" # Single API key (Go SDK compatibility)
102+
api_key_id: "" # TelemetryFlow API key ID (tfk_*)
103+
api_key_secret: "" # TelemetryFlow API key secret (tfs_*)
104+
105+
# Connection settings
106+
endpoint: "api.telemetryflow.id:4317"
107+
protocol: "grpc" # grpc, http
108+
insecure: false
109+
timeout: 30.0
110+
compression: true
111+
112+
# Signal configuration
113+
enable_traces: true
114+
enable_metrics: true
115+
enable_logs: true
116+
enable_exemplars: true
117+
118+
# Batch settings
119+
batch_timeout_ms: 5000
120+
batch_max_size: 512
121+
122+
# Retry settings
123+
retry_enabled: true
124+
max_retries: 3
125+
retry_backoff_ms: 500
126+
127+
# Rate limiting
128+
rate_limit: 1000

0 commit comments

Comments
 (0)