A Model Context Protocol (MCP) server that provides AI agents with tools and prompts to interact with InterSystems IRIS databases.
This MCP server exposes a unified tool for database interaction with three operations:
- list_tables - Lists all tables in the SQLUser schema
- list_columns - Retrieves column definitions for a specific table
- query - Executes SELECT queries against the database (read-only for security)
The server provides three standardized prompts following MCP 2025 specification to help AI agents use the tools effectively:
- explore-database - Guides users to discover available tables in the SQLUser schema
- analyze-table - Guides users to understand table structure and column metadata
- query-data - Guides users to query data with proper SQL syntax and IRIS-specific considerations
- Node.js 18 or higher
- Access to an InterSystems IRIS database
- Database credentials (host, port, namespace, username, password)
npm installCreate a .env file in the project root with your IRIS database credentials:
IRIS_HOST=localhost
IRIS_PORT=1972
IRIS_NAMESPACE=USER
IRIS_USERNAME=_SYSTEM
IRIS_PASSWORD=SYS
IRIS_DEFAULT_SCHEMA=SQLUserYou can copy .env.example as a starting point:
cp .env.example .envnpm run buildnpm startThe server runs on stdio transport and follows the MCP protocol for communication with AI agents.
Watch for changes and rebuild automatically:
npm run watchThe unified iris tool supports three operations through the operation parameter.
Lists all tables in the SQLUser schema.
Parameters:
operation: "list_tables" (required)
Example:
{
"operation": "list_tables"
}Get detailed column information for a specific table.
Parameters:
operation: "list_columns" (required)table_name(required): Name of the table
Example:
{
"operation": "list_columns",
"table_name": "Users"
}Execute a SELECT query against the database.
Parameters:
operation: "query" (required)query(required): SQL SELECT query to executemax_rows(optional): Maximum rows to return (default: 100, max: 1000)
Example:
{
"operation": "query",
"query": "SELECT * FROM Users WHERE IsActive = 1",
"max_rows": 50
}Security: Only SELECT queries are allowed. Queries containing DROP, DELETE, INSERT, UPDATE, etc. will be rejected.
Helps users discover what tables are available in the database.
Arguments: None
Helps users understand the structure of a specific table.
Arguments:
table_name(required): The table to analyze
Helps users formulate and execute SQL queries effectively.
Arguments:
query_description(required): Description of what data to retrievetable_name(optional): Primary table to querymax_rows(optional): Maximum rows to return
npm run test:all# Integration tests
npm run test:integration
# Prompt tests
npm run test:prompts
# Security tests
npm run test:security
# Schema validation tests
npm run test:schemaThe project includes the official MCP Inspector for interactive testing and debugging.
npm run test:inspectorThis opens a web interface where you can:
- Explore available tools and prompts
- Test tool calls with different parameters
- View request/response cycles
- Debug MCP server behavior
npm run test:inspector:cliRuns automated tests using the MCP Inspector CLI.
The project includes Docker Compose configuration for running both IRIS database and the MCP server.
docker compose up -dThis starts:
- InterSystems IRIS Community Edition on ports 1972 and 52773
- MCP Server connected to IRIS
docker compose logs -f mcp-serverdocker compose downdocker compose build mcp-server
docker compose up -d mcp-serverConfigure via .env file or environment:
IRIS_HOST: IRIS database host (default: localhost, docker: iris)IRIS_PORT: IRIS database port (default: 1972)IRIS_NAMESPACE: IRIS namespace (default: USER)IRIS_USERNAME: Database username (default: _SYSTEM)IRIS_PASSWORD: Database password (default: SYS)IRIS_DEFAULT_SCHEMA: Default schema for queries (default: SQLUser)
iris-mcp/
├── src/
│ ├── index.ts # Main MCP server implementation
│ ├── db/
│ │ └── connection.ts # IRIS database connection management
│ ├── tools/
│ │ └── iris-tool.ts # Unified IRIS tool with three operations
│ └── prompts/
│ └── iris-prompts.ts # MCP prompts definitions
├── tests/
│ ├── integration/ # Integration tests for tool operations
│ ├── prompts/ # Prompt functionality tests
│ ├── security/ # SQL injection and security tests
│ └── schema/ # Schema validation tests
├── dist/ # Compiled JavaScript output
├── Dockerfile # Docker image for MCP server
├── docker-compose.yml # Docker Compose configuration
├── package.json
├── tsconfig.json
└── .env # Database configuration (not in repo)
The project includes a comprehensive CI/CD pipeline that runs automatically on every push and pull request.
-
Test Suite
- Sets up InterSystems IRIS database as a service
- Runs all test suites (integration, prompts, security, schema)
- Generates test reports and uploads artifacts
- Ensures code quality before merging
-
Lint and Type Check
- Validates TypeScript compilation
- Ensures code meets quality standards
-
Security Scan
- Runs npm audit for dependency vulnerabilities
- Generates security reports
- Flags potential security issues
-
Docker Build (main branch only)
- Builds Docker image after successful tests
- Validates Docker configuration
- Uses build cache for faster builds
-
Summary
- Generates comprehensive CI pipeline summary
- Reports status of all jobs
- Provides commit and branch information
- Push: Runs on
mainanddevelopbranches - Pull Request: Runs on PRs targeting
mainordevelop - Manual: Can be triggered manually via workflow_dispatch
The CI pipeline generates and uploads:
- Test reports (30-day retention)
- Build artifacts (7-day retention)
- Security audit reports (30-day retention)
See .github/workflows/ci.yml for the complete workflow configuration.
The project uses TypeScript and compiles to ES modules. All imports use absolute paths with .js extensions for proper ESM resolution.
- TypeScript for type safety
- Zod for runtime schema validation
- Comprehensive test coverage (47 tests across 4 suites)
- Security-first design (read-only queries)
- Automated CI/CD with GitHub Actions
Following MCP 2025 best practices:
- Integration testing with real database connections
- Security testing for SQL injection prevention
- Schema validation for MCP compliance
- Prompt testing for AI agent usability
- Automated testing in CI/CD pipeline
See ADR/001-testing-strategy.md for complete testing documentation.
- Read-only operations: Only SELECT queries are allowed
- SQL injection prevention: Dangerous keywords are blocked
- Input validation: All parameters validated with Zod schemas
- Non-root Docker user: MCP server runs as non-privileged user
MIT