Skip to content

Scansca Technology Stack

This document outlines the recommended technology stack for implementing Scansca as an MCP server for database intelligence.

Core Components

Backend Services

Component Technology Rationale
MCP Server Go + mark3labs/mcp-go Native MCP protocol support through official SDK
API Server Go (Gin) High-performance, lightweight HTTP framework with middleware support
State Management Go + Viper Flexible configuration management with support for multiple formats
Task Scheduling robfig/cron Reliable cron-based job scheduling in Go

Database Connectors

Component Technology Rationale
PostgreSQL Connector pgx/v5 High-performance, feature-rich PostgreSQL driver
MySQL/MariaDB Connector go-sql-driver/mysql Official MySQL driver with broad compatibility
SQLite Connector mattn/go-sqlite3 CGo-based SQLite driver with full feature support
DynamoDB Connector aws-sdk-go Official AWS SDK for DynamoDB access

Core Storage

Component Technology Rationale
Configuration Storage JSON/YAML + Viper Flexible, human-readable configuration format
Metadata Storage PostgreSQL Robust relational database for structured metadata
Metrics Storage Prometheus Time-series database for performance metrics

Infrastructure

Deployment

Component Technology Rationale
Containerization Docker Portable, isolated runtime environment
Orchestration Kubernetes (optional) Scalable deployment for production environments
Configuration Kustomize Kubernetes-native configuration management
CI/CD GitHub Actions Integrated build and deployment pipeline

Observability

Component Technology Rationale
Logging zerolog Structured, high-performance logging for Go
Metrics Prometheus Industry-standard metrics collection and alerting
Tracing OpenTelemetry Distributed tracing for request flows
Visualization Grafana Dashboards for logs, metrics, and traces

Security

Component Technology Rationale
Authentication JWT Stateless authentication for API access
Authorization RBAC Role-based access control for database operations
Secret Management Environment variables + Vault (prod) Secure secrets management
TLS Let's Encrypt Automated certificate management

Development Tools

Component Technology Rationale
API Documentation OpenAPI/Swagger Industry standard API documentation
Testing Go testing framework + testify Comprehensive test coverage
Linting golangci-lint Enforces code quality and consistency
Database Migrations golang-migrate Version-controlled schema changes

Required Dependencies

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// MCP Server
go get github.com/mark3labs/mcp-go

// Web Framework
go get github.com/gin-gonic/gin

// Configuration
go get github.com/spf13/viper

// Database Drivers
go get github.com/jackc/pgx/v5
go get github.com/go-sql-driver/mysql
go get github.com/mattn/go-sqlite3
go get github.com/aws/aws-sdk-go

// Scheduling and Jobs
go get github.com/robfig/cron/v3

// Logging
go get github.com/rs/zerolog

// Testing
go get github.com/stretchr/testify

Project Structure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Scansca/
├── cmd/
│   └── Scansca-server/       # Main application entry point
│       └── main.go
├── internal/                # Internal packages - not exported
│   ├── connectors/          # Database connector implementations
│   │   ├── postgresql/
│   │   ├── mysql/
│   │   ├── sqlite/
│   │   ├── dynamodb/
│   │   └── interface.go     # Connector interface definition
│   ├── aml/                 # Scansca Management Layer
│   │   ├── registry/        # Database registry
│   │   ├── scheduler/       # Job scheduling
│   │   └── state/           # State management
│   ├── mci/                 # Model Context Interface
│   │   ├── api/             # API handlers
│   │   ├── middleware/      # HTTP middleware
│   │   └── server.go        # HTTP server setup
│   └── mcp/                 # MCP server implementation
│       ├── tools/           # MCP tool definitions
│       ├── handlers/        # Protocol handlers
│       └── server.go        # MCP server setup
├── pkg/                     # Public packages that can be imported
│   ├── types/               # Common type definitions
│   └── client/              # Client libraries for Scansca
├── docker/                  # Docker configurations
│   ├── Dockerfile
│   └── docker-compose.yml
└── documentation/           # Project documentation

Development Setup Requirements

  1. Go 1.22 or higher
  2. Docker and Docker Compose
  3. Git
  4. IDE with Go support (VSCode with Go extension recommended)

Production Deployment Considerations

  • Use separate database instances for Scansca metadata and monitored databases
  • Implement proper backup and disaster recovery procedures
  • Configure appropriate resource limits for database connections
  • Use a reverse proxy (Nginx, Traefik) for TLS termination and load balancing
  • Implement monitoring and alerting for system health