Skip to Content

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 - redis

Auto-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 metadata

Qdrant (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: true

Redis (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 limiting

MinIO (Object Storage)

minio: port: 9000 buckets: - name: "mcp-resources" versioning: true - name: "mcp-cache" lifecycle: expiration_days: 30 - name: "mcp-exports" lifecycle: expiration_days: 90

Startup 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

VariableDescriptionDefault
MCP_PORTServer port8081
POSTGRES_HOSTPostgreSQL hostlocalhost
QDRANT_HOSTQdrant hostlocalhost
REDIS_HOSTRedis hostlocalhost
LOG_LEVELLogging levelINFO

Running the Server

Development

cd /path/to/isA_MCP python main.py

With Custom Port

MCP_PORT=9000 python main.py

Docker

docker-compose up -d

Directory 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 point

Adding 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_SIZE env 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 }
FieldDescription
activeConnections currently handling requests
idleConnections open but not active
capacityPool size limit
evictionsTotal LRU evictions since startup
reconnectionsConnections 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 }
PriorityHealth check intervalLRU eviction
CRITICALEvery 30 secondsExempt — never evicted
STANDARDEvery 60 secondsSubject to eviction
OPTIONALEvery 120 secondsFirst 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_init

This generates initialization scripts based on config/init.yaml.

Next Steps