Projects

MCP Server - Dialog Insight

TypeScript
MCP Protocol
Node.js
AI Integration
API Development
Software Engineering

A fully functional autonomous MCP (Model Context Protocol) server enabling natural language control of Dialog Insight's marketing platform through AI assistants. Built as a proof of concept for the GLO-3002 Software Engineering Project at Université Laval.

MCP Server Architecture

Project Overview

MCP Server is an innovative project developed for Dialog Insight as part of the GLO-3002 Software Engineering Project at Université Laval (Winter 2026 session). The project demonstrates the practical value of generative AI applied to a real marketing environment by implementing a Model Context Protocol server that bridges AI assistants with Dialog Insight’s marketing platform.

Project Mandate

The objective was to design and develop an autonomous MCP server that enables:

  • Natural Language Control: Pilot Dialog Insight’s marketing platform using an AI assistant in natural language
  • Real-world Integration: Work with a real Dialog Insight account provided by the organization
  • Proof of Concept: Serve as a functional prototype demonstrating the value of AI-driven marketing automation
  • Standard Compliance: Leverage the Model Context Protocol to orchestrate interactions between AI models and Dialog Insight’s web API

Core Features Implemented

Contact Management

  • Get Contacts: Search and filter contacts via Dialog Insight API using precise criteria (field name, logical operators, comparison values)
  • Add Contacts: Create new contacts with strict validation of mandatory fields (email, first name, last name) and support for optional fields (address, language, company, department)
  • Update Contacts: Partial updates of existing contacts identified by email, modifying only specified fields
  • Delete Contacts: Secure deletion based on filters with configurable safety limits (default: 10 records) to prevent accidental mass deletion

Campaign Management

  • Email Creation: Generate and store HTML email content directly in Dialog Insight’s API for campaigns
  • Campaign Sending: Execute targeted email campaigns with multiple configuration points including send date and other essential parameters

Technology Stack

Language: TypeScript (with strict mode enabled)

  • Chosen for strong type control while maintaining consistency with the Node.js ecosystem
  • Official MCP SDK is designed for Node.js, and the team works daily with JavaScript/TypeScript

Protocol: Official MCP SDK

  • Specifically designed to expose tools to AI models
  • Ensures compatibility with target clients like Claude Desktop and GitHub Copilot

Input Validation: Zod

  • Validates parameters generated by AI models at runtime
  • Blocks invalid input before calling Dialog Insight API

HTTP Client: Axios

  • Enables configuration of a single instance with base URL and authentication headers
  • Reduces code duplication across API calls

Testing: Vitest

  • Native support for ES modules used in the project
  • Fast execution with integrated code coverage reporting
  • CI/CD integration with GitHub for automated test statistics on pull requests

Architecture

The system is built on a three-layered architecture:

Layer 1: Tool Registration

Exposes AI-accessible functionalities organized by domain:

  • Contact Management Tools
  • Message Management Tools
  • Campaign Sending Tools

Receives parameters from the LLM, validates inputs, and delegates execution to the business layer.

Layer 2: Services Layer

Contains application-specific business logic organized by functional domains:

  • ContactService: Contact-related operations
  • MessageService: Email message operations
  • SendingService: Campaign sending operations

Prepares requests, applies business rules, and orchestrates API calls.

Layer 3: Configuration & API Client

Centralizes technical configuration:

  • Authentication keys
  • Project identifiers
  • Base URLs

Provides a shared HTTP instance used by all services to communicate with Dialog Insight API.

Project Progress

Status: Sprint 3 (Ahead of Schedule)

The project was initially planned to include database design and implementation during the first two sprints. However, due to a requirements change early in development, the team integrated directly with Dialog Insight’s real API, eliminating the need for local data storage. This allowed acceleration to other tasks and put the project ahead of the initially planned schedule.

Key Achievements

✅ Successfully implemented and tested core contact management features ✅ Developed campaign email creation and sending functionality ✅ Established robust input validation using Zod ✅ Created comprehensive test suite with Vitest ✅ Achieved ahead-of-schedule progress through effective planning ✅ Integrated directly with real Dialog Insight API account ✅ Built scalable, maintainable three-layer architecture

Reflection

This project demonstrates the practical application of software engineering principles in building AI-integrated solutions. By leveraging the Model Context Protocol and modern TypeScript tooling, we created a proof of concept that shows how generative AI can effectively enhance marketing automation and reduce manual intervention in marketing operations.

The experience highlighted the importance of:

  • Flexible Planning: Adapting to requirement changes while maintaining progress
  • Technology Selection: Choosing tools aligned with team expertise and project requirements
  • Clean Architecture: Implementing layered architecture for maintainability and scalability
  • Input Validation: Protecting API calls through rigorous runtime validation
  • Automated Testing: Ensuring reliability through comprehensive test coverage and CI/CD integration