MCP Async Server

MCP Async Server

🚀 A high-performance Model Context Protocol (MCP) server implementation showcasing asynchronous task processing with robust status tracking and error handling.


✨ Features

  • 🔄 Asynchronous Task Processing - Handle long-running operations efficiently
  • 📊 Real-time Status Tracking - Monitor task progress with polling support
  • 🧹 Automatic Resource Management - Smart task cleanup and memory management
  • ⏱️ Timeout Handling - Configurable timeouts for tasks
  • 🛡️ Robust Error Handling - Custom error types and comprehensive error reporting
  • 📝 TypeScript Support - Full type safety and modern JavaScript features
  • 🔍 Built-in Inspector - Debug and test your MCP server with ease

🚀 Quick Start

Prerequisites

  • Node.js 20.x or higher
  • npm 9.x or higher

Installing via Smithery

To install Async MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @ViezeVingertjes/example-async-mcp --client claude

Installation

# Clone the repository git clone https://github.com/ViezeVingertjes/example-async-mcp.git # Navigate to the project directory cd example-async-mcp # Install dependencies npm install # Build the project npm run build

Running the Server

npm start

Using the Inspector

npm run inspector

📖 API Reference

Available Tools

process_task

Creates a new asynchronous task.

{ "name": "process_task", "arguments": { "input": "Hello, World!", "delayMs": 5000, "timeoutMs": 30000 } }
ParameterTypeRequiredDefaultDescription
inputstring-The input string to process
delayMsnumber5000Processing delay in milliseconds
timeoutMsnumber30000Task timeout in milliseconds
check_task_status

Check the status of an existing task.

{ "name": "check_task_status", "arguments": { "taskId": "550e8400-e29b-41d4-a716-446655440000" } }
ParameterTypeRequiredDescription
taskIdstringThe ID of the task to check

Task States

StatusDescription
🕒 pendingTask created but not started
processingTask is being processed
completeTask completed successfully
errorTask failed

⚙️ Configuration

Key configuration options in src/constants.ts:

export const DEFAULT_TASK_TIMEOUT_MS = 30000; // 30 seconds export const DEFAULT_TASK_DELAY_MS = 5000; // 5 seconds export const DEFAULT_POLL_DELAY_MS = 10000; // 10 seconds export const POLL_INTERVAL_MS = 100; // 100ms export const MAX_TASKS = 1000; // Maximum concurrent tasks

🛠️ Development

Project Structure

src/ ├── index.ts # Main server implementation ├── types.ts # TypeScript types and interfaces ├── constants.ts # Configuration constants └── utils.ts # Utility functions

Development Commands

# Build the project npm run build # Watch for changes npm run watch # Run tests npm test # Run inspector npm run inspector

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

This server implements the Model Context Protocol (MCP) to handle asynchronous tasks with real-time status tracking, robust error handling, and automatic resource management.

  1. ✨ Features
    1. 🚀 Quick Start
      1. Prerequisites
      2. Installing via Smithery
      3. Installation
      4. Running the Server
      5. Using the Inspector
    2. 📖 API Reference
      1. Available Tools
      2. Task States
    3. ⚙️ Configuration
      1. 🛠️ Development
        1. Project Structure
        2. Development Commands
      2. 📝 License

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
          Last updated -
          4
          3
          TypeScript
          MIT License
        • -
          security
          A
          license
          -
          quality
          MCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.
          Last updated -
          13
          2
          TypeScript
          MIT License
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol (MCP) server that provides tools for managing todo items, including creation, updating, completion, deletion, searching, and summarizing tasks.
          Last updated -
          10
          4
          TypeScript
          MIT License
        • A
          security
          F
          license
          A
          quality
          A Model Context Protocol (MCP) server that provides a simple sleep/wait tool, useful for adding delays between operations such as waiting between API calls or testing eventually consistent systems.
          Last updated -
          1
          6
          7
          JavaScript

        View all related MCP servers

        ID: k2os9maqr0