Skip to content

PerchIQXSemantic Perch Intelligence MCP

Part of Cormorant Foraging | Deep Insights. Database Intelligence. Dive into your D1 data.

PerchIQX - Perch Intelligence for Cloudflare D1

Quick Start โ€‹

bash
# Clone the repository
git clone https://github.com/semanticintent/semantic-perch-intelligence-mcp.git

# Install dependencies
cd semantic-perch-intelligence-mcp
npm install

# Configure your Cloudflare credentials
cp .env.example .env
# Edit .env with your credentials

# Build the MCP server
npm run build

# Start using with Claude Desktop
# Add to your Claude Desktop configuration

What is PerchIQX? โ€‹

PerchIQX (Perch Intelligence Quotient eXtended) is a Model Context Protocol (MCP) server that brings deep database intelligence to your AI assistant. Like a cormorant perched above the water, diving deep to catch fish, PerchIQX dives into your Cloudflare D1 databases to surface the insights you need.

Note: PerchIQX serves as both a practical D1 introspection tool and a reference implementation of the Semantic Intent pattern applied to database intelligence. The codebase demonstrates hexagonal architecture, domain-driven design, and semantic anchoring principles.

Why "Perch"? โ€‹

Perch (cormorant) birds are expert fishers that perch above water, dive deep, and surface with their catch. PerchIQX brings that same precision to database intelligence:

  • Perch = observation point above your data
  • IQ = Intelligence Quotient
  • X = eXtended capabilities

Core Philosophy โ€‹

  1. Deep Insights - Comprehensive schema analysis, not surface-level queries
  2. Database Intelligence - Semantic understanding of your data model
  3. Dive Deep. Surface Smart. - Extract meaningful patterns from complex schemas

Key Features โ€‹

๐ŸŽฏ MCP Tools โ€‹

  • Analyze Database Schema - Complete schema introspection with metadata and samples
  • Get Table Relationships - Foreign key analysis with cardinality detection
  • Validate Database Schema - Check for anti-patterns and schema issues
  • Suggest Optimizations - AI-powered recommendations for performance improvements

๐Ÿ“ก Cloudflare D1 Integration โ€‹

Direct API integration for:

  • Multi-environment support (dev, staging, production)
  • Real-time schema analysis
  • Complete table and column introspection
  • Index and foreign key discovery
  • Sample data extraction

๐Ÿง  Semantic Intent Pattern โ€‹

Built on research-backed principles:

  • Observable property anchoring
  • Intent preservation through transformations
  • Semantic over structural analysis
  • Domain-driven design

Architecture โ€‹

Built on Hexagonal Architecture with clean separation:

typescript
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Presentation Layer                     โ”‚
โ”‚              (MCP Server - Protocol Handling)            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Application Layer                       โ”‚
โ”‚        (Use Cases - Schema Analysis Orchestration)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Domain Layer                          โ”‚
โ”‚     (Schema Entities, Relationship Logic, Services)     โ”‚
โ”‚              Pure Business Logic                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                Infrastructure Layer                      โ”‚
โ”‚       (Cloudflare D1 REST API, HTTP Client)             โ”‚
โ”‚           Technical Adapters                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Use Cases โ€‹

๐Ÿ—๏ธ Database Development โ€‹

  • Schema Design - Understand existing schemas before making changes
  • Migration Planning - Identify relationships and dependencies
  • Optimization - Find missing indexes and schema improvements
  • Documentation - Auto-generate schema documentation

๐Ÿ“ˆ Analytics & Monitoring โ€‹

  • Track schema evolution across environments
  • Validate schema integrity and best practices
  • Monitor relationship complexity
  • Detect potential performance bottlenecks

๐Ÿค– AI Workflow Integration โ€‹

  • Query your database schema via Claude AI
  • Natural language database analysis
  • Conversational schema exploration
  • AI-assisted optimization planning

Documentation โ€‹

Community & Support โ€‹


About the Author โ€‹

Michael Shatny is a software developer specializing in modernizing legacy systems through agentic UX, AI-powered workflows, and semantic intent patterns. Based in Ontario, Canada, Michael's work bridges practical software development with academic research in AI-assisted development.

Research & Publications โ€‹

PerchIQX serves as a reference implementation of the Semantic Intent pattern applied to database intelligence. The research behind this pattern achieved 78% improvement in behavioral consistency in real-world applications.

Part of Cormorant Foraging โ€‹

PerchIQX is part of the Cormorant Foraging framework - a three-dimensional approach to intelligence systems that emerged organically from building production tools.

PerchIQX represents the Space dimension of Cormorant Foraging:

SystemDimensionFormula TypePurpose
ChirpIQXSound (Communication)AdditiveFantasy sports breakout analysis
PerchIQXSpace (Structure)MultiplicativeDatabase schema intelligence
WakeIQXTime (Memory)ExponentialAI context temporal intelligence

Learn more: cormorantforaging.dev - Intelligence Systems, Naturally Organized

  • ChirpIQX - Fantasy hockey intelligence MCP
  • WakeIQX - AI context temporal intelligence MCP

Connect โ€‹


Built with semantic intent patterns for database intelligence

Deep Insights. Database Intelligence. ๐Ÿ—„๏ธ