Sponsored by Deepsite.site

Intent MCP Server

Created By
aintent8 months ago
A Model Context Protocol server for processing travel intents based on Deep Intent Architecture. This server provides a robust API for managing travel intents, generating deep flows, and creating DIML (Deep Intent Markup Language) representations.
Content

Intent MCP Server

A Model Context Protocol (MCP) server that processes natural language intents into structured, actionable formats. This server provides a robust API for managing and processing intents with a focus on extensibility and reliability.

Overview

This project implements an intent processing architecture that transforms natural language inputs into structured objects and generates executable workflows. It focuses on maintainability, type safety, and extensibility while providing a clean API for intent management.

Features

  • 🎯 Intent Processing: Create, retrieve, and process intents through a well-defined API
  • 🔍 Natural Language Understanding: Parse and understand raw user intentions
  • 🧩 Intent Decomposition: Transform intentions into structured objects with goals and constraints
  • 💾 Flexible Storage: Pluggable storage system with built-in in-memory implementation
  • 📝 Type Safety: Full TypeScript implementation with comprehensive type definitions
  • 🛡️ Error Handling: Robust error handling and logging system
  • 🧪 Testing: Comprehensive test suite with Jest
  • 📚 API Documentation: Clear API documentation and examples

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/openpandacodes/intent-mcp-server.git
cd intent-mcp-server
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory:
cp .env.example .env
  1. Update the .env file with your configuration settings.

Configuration

The server can be configured using environment variables:

  • NODE_ENV: Environment (development, production, test)
  • PORT: Server port (default: 3000)
  • LOG_LEVEL: Logging level (debug, info, warn, error)

Usage

Development

Start the development server with hot reloading:

npm run dev

Production

Build and start the production server:

npm run build
npm start

Testing

Run tests:

npm test

Run tests with coverage:

npm run test:coverage

API Endpoints

Intent Management

  • POST /api/intent: Create a new intent

    curl -X POST http://localhost:3000/api/intent \
      -H "Content-Type: application/json" \
      -d '{"rawIntent": "Your natural language intent here"}'
    
  • GET /api/intent/:id: Get an intent by ID

    curl -X GET http://localhost:3000/api/intent/YOUR_INTENT_ID
    

Additional endpoints are documented in the API specification.

Health Check

  • GET /health: Check server health status

Architecture

The server follows a clean architecture pattern with distinct layers:

  1. Controllers: Handle HTTP requests and responses
  2. Services: Implement core business logic and intent processing
  3. Storage: Manage data persistence with pluggable implementations
  4. Models: Define data structures and types

Key Components

  • IntentController: Handles intent-related HTTP endpoints
  • IntentService: Core service for intent processing
  • StorageInterface: Abstract storage layer
  • InMemoryStorage: Reference implementation of storage interface

Project Structure

intent-mcp-server/
├── src/
│   ├── controllers/     # HTTP request handlers
│   ├── services/        # Business logic implementation
│   │   └── __tests__/  # Service tests
│   ├── storage/        # Storage implementations
│   ├── models/         # Type definitions
│   └── utils/          # Utility functions
├── tests/              # Test suites
└── config/             # Configuration files

Intent Structure

The system structures intentions into formal objects:

interface Intent {
  id: string;
  rawIntent: string;
  processed: {
    goals: Goal[];
    constraints: Constraint[];
    metadata: Record<string, unknown>;
  };
  status: "pending" | "processing" | "completed" | "failed";
  createdAt: Date;
  updatedAt: Date;
}

Error Handling

The server implements comprehensive error handling:

  • Custom error classes for different types of errors
  • Proper HTTP status codes and error responses
  • Structured logging for debugging and monitoring
  • Validation using TypeScript types

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Create a Pull Request

Please ensure your code:

  • Follows the existing style and conventions
  • Includes appropriate tests
  • Updates documentation as needed
  • Uses conventional commit messages

License

MIT License - see LICENSE file for details

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server