Configuration
Server configuration and infrastructure setup for ISA MCP.
Overview
The platform uses config/init.yaml for service initialization and dependency configuration.
Service Configuration
MCP Server
mcp_service:
port: 8081 # External port
internal_port: 8300 # Internal port
description: "Model Context Protocol service"
depends_on:
- postgres_grpc
- qdrant
- redisAuto-Discovery
auto_discovery:
enabled: true
scan_interval_seconds: 300 # Re-scan every 5 minutes
paths:
tools: "tools/"
prompts: "prompts/"
resources: "resources/"
patterns:
tools: "*.py"
prompts: "*.py"
resources: "*.py"
exclude:
- "__pycache__"
- "*.pyc"
- "base_*.py"Infrastructure Dependencies
PostgreSQL
postgres_grpc:
port: 50061
schemas:
- mcp
tables:
- tool_executions # Tool execution logs
- prompt_templates # Custom prompts
- resource_cache # Resource metadataQdrant (Vector Store)
qdrant:
http: 6333
grpc: 6334
collections:
- name: "mcp_tool_embeddings"
vector_size: 1536
distance: "Cosine"
- name: "mcp_prompt_embeddings"
vector_size: 1536
- name: "mcp_document_embeddings"
on_disk: trueRedis (Cache)
redis:
port: 6379
key_prefixes:
- "mcp:tool:" # Tool response cache
- "mcp:prompt:" # Prompt cache
- "mcp:resource:" # Resource cache
- "mcp:embedding:" # Embedding cache
- "mcp:session:" # Session state
- "mcp:rate:" # Rate limitingMinIO (Object Storage)
minio:
port: 9000
buckets:
- name: "mcp-resources"
versioning: true
- name: "mcp-cache"
lifecycle:
expiration_days: 30
- name: "mcp-exports"
lifecycle:
expiration_days: 90Startup Order
startup_order:
- tier: 1
description: "Core Infrastructure"
services: [postgres, redis, qdrant, minio]
- tier: 2
description: "gRPC Gateways"
services: [postgres_grpc, redis_grpc, qdrant_grpc]
- tier: 3
description: "MCP Service"
services: [mcp]Health Checks
health_checks:
default_timeout_seconds: 5
default_interval_seconds: 30
default_failure_threshold: 3
mcp_specific:
tool_discovery:
check: "count_registered_tools > 0"
prompt_discovery:
check: "count_registered_prompts > 0"
resource_discovery:
check: "count_registered_resources > 0"Environment Variables
| Variable | Description | Default |
|---|---|---|
MCP_PORT | Server port | 8081 |
POSTGRES_HOST | PostgreSQL host | localhost |
QDRANT_HOST | Qdrant host | localhost |
REDIS_HOST | Redis host | localhost |
LOG_LEVEL | Logging level | INFO |
Running the Server
Development
cd /path/to/isA_MCP
python main.pyWith Custom Port
MCP_PORT=9000 python main.pyDocker
docker-compose up -dDirectory Structure
isA_MCP/
├── config/
│ └── init.yaml # Main configuration
├── tools/ # Auto-discovered tools
├── prompts/ # Auto-discovered prompts
├── resources/ # Auto-discovered resources
├── services/
│ └── skill_service/ # Skill management
├── core/
│ ├── auto_discovery.py # Discovery logic
│ ├── security.py # Security management
│ └── config.py # Config loading
└── main.py # Entry pointAdding External MCP Servers
See Server Aggregation for connecting to external MCP servers.
result = await client.call_tool("add_mcp_server", {
"name": "external-server",
"transport_type": "SSE",
"connection_config": {
"url": "https://external.example.com/sse"
},
"auto_connect": True
})Connection Pooling
The SessionManager maintains a pool of active MCP server connections to avoid the overhead of reconnecting on every request.
How It Works
- Lazy connect: connections are established on the first tool call, not at startup
- LRU eviction: when the pool reaches capacity, the least-recently-used connection is evicted
- Max 30 connections: configurable via
MCP_POOL_MAX_SIZEenv var
MCP_POOL_MAX_SIZE=30 # Maximum concurrent connections (default: 30)Pool Stats
Monitor pool health:
curl http://localhost:8081/api/v1/mcp/pool/stats \
-H "Authorization: Bearer YOUR_API_KEY"{
"active": 12,
"idle": 4,
"capacity": 30,
"evictions": 3,
"reconnections": 1
}| Field | Description |
|---|---|
active | Connections currently handling requests |
idle | Connections open but not active |
capacity | Pool size limit |
evictions | Total LRU evictions since startup |
reconnections | Connections re-established after eviction |
Server Priority Tiers
Assign a priority to each MCP server to control health check frequency and eviction behavior.
# Set priority when registering a server
{
"name": "critical-tool-server",
"url": "http://tool-server:8082",
"priority": "CRITICAL" # CRITICAL | STANDARD | OPTIONAL
}| Priority | Health check interval | LRU eviction |
|---|---|---|
CRITICAL | Every 30 seconds | Exempt — never evicted |
STANDARD | Every 60 seconds | Subject to eviction |
OPTIONAL | Every 120 seconds | First to be evicted |
Use CRITICAL for tool servers that are essential to your workflow (e.g., file system tools, code execution). Optional servers for rarely-used integrations can be OPTIONAL to free up pool capacity.
Regenerating Init Scripts
python -m scripts.generate_initThis generates initialization scripts based on config/init.yaml.
Next Steps
- Quick Start - Getting started
- Server Aggregation - External servers
- Tools - Creating tools