Agent Jobs MCP Server

Agent Jobs MCP Server

Allows AI agents to query and manage asynchronous jobs in the Agent Jobs system of the AI Connect platform, supporting operations like listing, creating, and canceling jobs.

Category
访问服务器

README

AI Connect MCP Server

An MCP (Model Context Protocol) server that allows AI agents to query and manage jobs in the AI Connect platform.

About AI Connect Jobs

AI Connect Jobs is a robust asynchronous task management system on the AI Connect platform, enabling the creation, monitoring, and execution of jobs across different platforms like Slack and WhatsApp, with support for scheduled execution, automatic retries, and timeout handling. The API provides endpoints to create, list, query, and cancel jobs, allowing developers and external systems to easily integrate asynchronous processing functionalities into their applications, automating complex workflows without the need to implement the entire task management infrastructure.

Features

This MCP Server provides tools for AI agents to:

  • 📋 List Jobs: Query all jobs with advanced filtering
  • 🔍 Get Specific Job: Retrieve details of a specific job by ID
  • Create Jobs: Create new jobs for immediate or scheduled execution
  • Cancel Jobs: Cancel running or scheduled jobs
  • 📊 Monitor Status: Track job status (WAITING, RUNNING, COMPLETED, FAILED, CANCELED)

Technologies

  • Node.js with TypeScript
  • Model Context Protocol (MCP) by Anthropic
  • Zod for schema validation
  • AI Connect API for integration with the Agent Jobs system

Installation

NPX (Recommended)

You can run the MCP server directly using npx without installation:

npx @aiconnect/agentjobs-mcp --help

Local Installation

  1. Clone the repository:
git clone <repository-url>
cd agentjobs-mcp
  1. Install dependencies:
npm install
  1. Configure environment variables (Optional):

The MCP server comes with default values from .env.example, so you can run it without setting any environment variables. However, you must provide an API key for authentication.

cp .env.example .env

Edit the .env file with your credentials:

DEFAULT_ORG_ID=your-organization     # Default: aiconnect
AICONNECT_API_KEY=your-api-key       # Required: Must be provided
AICONNECT_API_URL=https://api.aiconnect.cloud/api/v0  # Default

Important: If no environment variables are provided, the server will use these defaults:

  • DEFAULT_ORG_ID: aiconnect
  • AICONNECT_API_URL: https://api.aiconnect.cloud/api/v0
  • AICONNECT_API_KEY: empty (must be provided for API calls to work)
  1. Build the project:
npm run build

Usage

CLI Usage

The MCP server now supports CLI commands for easy management:

# Show help and usage information
npx @aiconnect/agentjobs-mcp --help

# Show version information
npx @aiconnect/agentjobs-mcp --version

# Show current configuration status
npx @aiconnect/agentjobs-mcp --config

# Start MCP server (default behavior)
npx @aiconnect/agentjobs-mcp

Setting Environment Variables:

# Using environment variables with npx
AICONNECT_API_URL=https://api.aiconnect.cloud/api/v0 \
AICONNECT_API_KEY=your-api-key-here \
npx @aiconnect/agentjobs-mcp

# Or create a .env file (recommended for development)
cp .env.example .env
# Edit .env with your credentials
npx @aiconnect/agentjobs-mcp

Required Environment Variables:

  • AICONNECT_API_URL: API endpoint URL (e.g., https://api.aiconnect.cloud/api/v0)
  • AICONNECT_API_KEY: Your API authentication key

CLI Command Examples:

# Quick help
npx @aiconnect/agentjobs-mcp -h

# Check version
npx @aiconnect/agentjobs-mcp -v

# Verify configuration before starting
npx @aiconnect/agentjobs-mcp -c

# Test with environment variables
env AICONNECT_API_URL=https://api.aiconnect.cloud/api/v0 \
    AICONNECT_API_KEY=test-key \
    npx @aiconnect/agentjobs-mcp --config

Local Development

For local development, you can use npm scripts:

# Build and test CLI commands
npm run cli:help
npm run cli:version  
npm run cli:config

# Run test suite (if available)
npm run test:cli

Configuration Options

This MCP server is designed to work out-of-the-box with minimal configuration. It uses a smart fallback system:

  1. With environment variables: Full control over all settings
  2. Without environment variables: Uses defaults from .env.example
  3. Partial configuration: Mix of environment variables and defaults

Default Values (when no env vars are set):

  • DEFAULT_ORG_ID: "aiconnect"
  • AICONNECT_API_URL: "https://api.aiconnect.cloud/api/v0"
  • AICONNECT_API_KEY: "" (empty - you must provide this)

Error Handling:

  • If AICONNECT_API_KEY is not provided, tools will return helpful error messages
  • If AICONNECT_API_URL is not set, it defaults to the production API
  • If DEFAULT_ORG_ID is not set, it defaults to "aiconnect"

Running the MCP server

npm start

The server will start and wait for connections via stdio transport.

Claude Desktop Configuration

To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "agentjobs": {
      "command": "node",
      "args": ["/path/to/agentjobs-mcp/build/index.js"],
      "env": {
        "DEFAULT_ORG_ID": "your-organization",
        "AICONNECT_API_KEY": "your-api-key",
        "AICONNECT_API_URL": "https://api.aiconnect.cloud/api/v0"
      }
    }
  }
}

Available Tools

🔧 list_jobs

Lists all jobs with filtering and pagination options.

Parameters:

  • status (optional): Filter by status (WAITING, RUNNING, COMPLETED, FAILED, CANCELED)
  • job_type_id (optional): Filter by job type
  • channel_code (optional): Filter by channel code
  • limit (optional): Result limit (default: 50)
  • offset (optional): Pagination offset
  • sort (optional): Field and direction for sorting

🔍 get_job

Gets details of a specific job.

Parameters:

  • job_id (required): ID of the job to query

create_job

Creates a new job for execution.

Parameters:

  • target_channel: Target channel configuration
  • job_type_id: Job type ID
  • config: Job configuration (timeouts, retries, etc.)
  • params: Job-specific parameters
  • scheduled_at (optional): Date/time for scheduled execution
  • delay (optional): Random delay in minutes

cancel_job

Cancels a running or scheduled job.

Parameters:

  • job_id (required): ID of the job to cancel
  • reason (optional): Cancellation reason

Job Status

Jobs can have the following status values:

  • WAITING: Job waiting for execution
  • SCHEDULED: Job scheduled for future execution
  • RUNNING: Job currently running
  • COMPLETED: Job completed successfully
  • FAILED: Job failed
  • CANCELED: Job was canceled

Usage Examples

List running jobs

Agent: "Show me all jobs that are currently running"

Query specific job

Agent: "What's the status of job job-123?"

Create scheduled job

Agent: "Create a daily report job for Slack channel C123456 to run tomorrow at 9 AM"

Cancel job

Agent: "Cancel job job-456 because it's no longer needed"

Project Structure

agentjobs-mcp/
├── src/                    # TypeScript source code
│   ├── index.ts           # Main MCP server
│   ├── cancel_job.ts      # Tool for canceling jobs
│   ├── create_job.ts      # Tool for creating jobs
│   ├── get_job.ts         # Tool for querying job
│   └── list_jobs.ts       # Tool for listing jobs
├── build/                 # Compiled JavaScript code
├── docs/                  # Documentation
│   └── agent-jobs-api.md  # API documentation
├── package.json           # Dependencies and scripts
├── tsconfig.json          # TypeScript configuration
├── .env.example           # Environment variables example
└── README.md              # This file

Development

Available scripts

  • npm run build: Compiles TypeScript
  • npm start: Runs the compiled server

Adding new tools

  1. Create a new file in the src/ folder (e.g., new_tool.ts)
  2. Implement the tool following the pattern of existing files
  3. Register the tool in src/index.ts
  4. Recompile with npm run build

Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

Support

For technical support or questions about AI Connect Jobs:


Note: This project was developed using the Anthropic mcp-tools scaffold for integration with the AI Connect platform.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选