MCP Agentic Framework 标志

MCP Agentic Framework

社区
Piotr1215

mcp implementation of an agentic framework

发布者Piotr1215
代码仓库mcp-agentic-framework
语言JavaScript
复刻数
4
星标数
11
可用工具
0
传输类型stdio
分类
链接
  • 将工具接入 AI 工作流

    MCP Agentic Framework 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 11 个 Star 和 4 个 Fork。

MCP Agentic Framework

A Model Context Protocol (MCP) based communication framework that enables multiple AI agents to collaborate through asynchronous messaging. Built with Test-Driven Development (TDD) and functional programming principles.

Overview

This framework provides a standardized way for multiple Claude agents (or other MCP-compatible agents) to:

  • Register themselves with unique identities
  • Discover other registered agents
  • Exchange messages asynchronously
  • Send broadcasts to all agents
  • Work together on complex tasks

The framework uses file-based storage for simplicity and portability, making it easy to run without external dependencies.

Comparison with Claude Code Sub-agents

This framework provides a different approach to multi-agent collaboration compared to Claude Code's sub-agents feature.

AspectClaude Code Sub-agentsMCP Agentic Framework
ArchitectureStatic configuration filesDynamic agent registration
ContextIsolated per taskShared across agents with individual message queues
CommunicationOne-way (Claude invokes agent)Bidirectional (agents communicate with each other)
ConfigurationYAML frontmatter + system promptRuntime registration with name and description
FlexibilityPredefined behaviorRuntime-adaptable interaction patterns
Storage.claude/agents/ directoriesFile-based message queue system
Tool AccessFixed at configuration timeDetermined by MCP server configuration

When to Use Each Approach

Use Claude Code Sub-agents when:

  • Tasks are well-defined and repetitive (code review, debugging, testing)
  • Consistent, predictable behavior is required
  • Working independently on specific problems
  • Need to preserve main conversation context

Use MCP Agentic Framework when:

  • Real-time collaboration between multiple agents is needed
  • Tasks require discussion, negotiation, or consensus
  • Problem-solving benefits from diverse perspectives
  • Building distributed workflows with agent coordination

Both systems can be complementary: MCP agents can collaborate to design and refine sub-agent configurations, while sub-agents can handle routine tasks identified by MCP agent discussions.

Kubernetes Deployment

The MCP Agentic Framework can be deployed on Kubernetes for production use with high availability and easy management.

Prerequisites

  • Kubernetes cluster with MetalLB LoadBalancer (or similar)
  • Docker Hub account (or other container registry)
  • just command runner installed (cargo install just)

Quick Start

  1. Clone and navigate to the framework:
bash
cd /home/decoder/dev/mcp-agentic-framework
  1. Deploy with the Justfile:
bash
# First time: Update the docker_user in Justfile
vim Justfile  # Change docker_user to your Docker Hub username

# Deploy (builds, pushes, and deploys to Kubernetes)
just update
  1. Get the LoadBalancer IP:
bash
just status
# Or manually:
kubectl get svc mcp-agentic-framework-lb
  1. Update Claude configuration (~/.claude.json):
json
"agentic-framework": {
  "type": "http",
  "url": "http://YOUR_LOADBALANCER_IP:3113/mcp"
}

Managing the Deployment

bash
# View all available commands
just

# Deploy updates (bumps version, builds, pushes, deploys)
just update          # Patch version bump (1.0.0 -> 1.0.1)
just update-minor    # Minor version bump (1.0.0 -> 1.1.0)
just update-major    # Major version bump (1.0.0 -> 2.0.0)

# Monitor deployment
just status          # Check deployment status
just logs            # Stream logs
just test-health     # Test health endpoint

# Operations
just restart         # Restart the deployment
just rollback        # Rollback to previous version

Features

  • Zero-downtime deployments with rolling updates
  • Automatic version management with semantic versioning
  • Health checks with automatic restarts
  • Persistent LoadBalancer IP via MetalLB
  • Web UI for monitoring agent communications (auto-opens on first agent)

Architecture

The Kubernetes deployment includes:

  • Deployment: Single replica with health/readiness probes
  • LoadBalancer Service: Stable external IP for Claude access
  • ClusterIP Service: Internal cluster communication

Kubernetes Manifests

Located in k8s/ directory:

  • deployment.yaml - Main application deployment
  • loadbalancer-service.yaml - External access via MetalLB

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│ Developer Agent │     │  Tester Agent   │     │ Architect Agent │
└────────┬────────┘     └────────┬────────┘     └────────┬────────┘
         │                       │                       │
         └───────────────────────┴───────────────────────┘
                                 │
                      ┌──────────┴──────────┐
                      │   MCP Server        │
                      │  ┌──────────────┐   │
                      │  │Agent Registry│   │
                      │  └──────────────┘   │
                      │  ┌──────────────┐   │
                      │  │ Message Store│   │
                      │  └──────────────┘   │
                      └─────────────────────┘
                                 │
                      ┌──────────┴──────────┐
                      │ File Storage        │
                      │/tmp/mcp-agentic-    │
                      │    framework/       │
                      └─────────────────────┘

Installation

  1. Clone the repository:
bash
git clone https://github.com/Piotr1215/mcp-agentic-framework.git
cd mcp-agentic-framework
  1. Install dependencies:
bash
npm install
  1. Run tests to verify installation:
bash
npm test

Usage with Claude Desktop or Claude Code

Using HTTP Transport

json
{
  "mcpServers": {
    "agentic-framework": {
      "type": "http",
      "url": "http://127.0.0.1:3113/mcp"
    }
  }
}

To use the HTTP transport:

  1. Start the HTTP server: npm run start:http
  2. Add the above configuration to your ~/.claude.json
  3. Restart Claude Desktop

Note: The HTTP transport supports Server-Sent Events (SSE)

HTTP Endpoints

When running with npm run start:http, the following endpoints are available:

  • /mcp - Main MCP endpoint for agent communication
  • /health - Health check endpoint that returns:
    json
    {
      "status": "ok",
      "name": "mcp-agentic-framework",
      "version": "1.0.0"
    }

Available Tools

register-agent

Register a new agent in the system.

Parameters:

  • name (string, required): Agent's display name
  • description (string, required): Agent's role and capabilities
  • instanceId (string, optional): Instance identifier for automatic deregistration

Example:

javascript
{
  "name": "DeveloperAgent",
  "description": "Responsible for writing code and implementing features"
}

unregister-agent

Remove an agent from the system.

Parameters:

  • id (string, required): Agent's unique identifier

discover-agents

List all currently registered agents.

Parameters: None

Response Example:

javascript
[
  {
    "id": "agent_abc123",
    "name": "DeveloperAgent",
    "description": "Responsible for writing code",
    "status": "online",
    "lastActivityAt": "2024-01-20T10:30:00.000Z"
  }
]

send-message

Send a message from one agent to another.

Parameters:

  • to (string, required): Recipient agent's ID
  • from (string, required): Sender agent's ID
  • message (string, required): Message content

check-for-messages

Retrieve unread messages for an agent. Messages are automatically deleted after reading.

Parameters:

  • agent_id (string, required): Agent's ID to check messages for

Response Example:

javascript
{
  "messages": [
    {
      "from": "agent_abc123",
      "fromName": "DeveloperAgent",
      "message": "Task completed",
      "timestamp": "2024-01-20T10:30:00.000Z"
    }
  ]
}

update-agent-status

Update an agent's status (online, offline, busy, away).

Parameters:

  • agent_id (string, required): Agent's ID
  • status (string, required): New status (one of: online, offline, busy, away)

send-broadcast

Send a broadcast message to all registered agents (except the sender).

Parameters:

  • from (string, required): Sender agent's ID
  • message (string, required): Broadcast message content
  • priority (string, optional): Priority level (low, normal, high). Defaults to 'normal'

Features:

  • Messages are delivered to all agents except the sender
  • Works without requiring agents to subscribe
  • Returns the number of recipients
  • Messages are prefixed with priority level (e.g., "[BROADCAST HIGH]")

Example:

javascript
{
  "from": "orchestrator",
  "message": "System maintenance in 10 minutes",
  "priority": "high"
}

Response:

javascript
{
  "success": true,
  "recipientCount": 5,
  "errors": []  // Any delivery failures
}

get-pending-notifications

Retrieve pending notifications for an agent.

Parameters:

  • agent_id (string, required): Agent's ID

Example Use Cases

Multi-Agent Collaboration

1. Register agents:
   - "Register an orchestrator agent for coordinating tasks"
   - "Register worker1 agent for processing"
   - "Register worker2 agent for analysis"

2. Orchestrator delegates tasks:
   - "Send message from orchestrator to worker1: Process customer data"
   - "Send message from orchestrator to worker2: Analyze market trends"

3. Workers communicate:
   - "Send message from worker1 to worker2: Data ready for analysis"

4. Broadcast updates:
   - "Send broadcast from orchestrator: All tasks completed"

Using Broadcasts

The improved broadcast feature allows efficient communication with all agents:

javascript
// Orchestrator sends high-priority announcement
await sendBroadcast(
  orchestratorId,
  "Emergency: System overload detected, pause all operations",
  "high"
);

// All other agents receive: "[BROADCAST HIGH] Emergency: System overload..."

// Regular status update
await sendBroadcast(
  orchestratorId,
  "Daily standup meeting in 5 minutes",
  "normal"
);

// All agents receive: "[BROADCAST NORMAL] Daily standup meeting..."

Development

Running Tests

bash
# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Storage

The framework stores data in /tmp/mcp-agentic-framework/:

  • agents.json: Registered agents with status and activity tracking
  • messages/*.json: Individual message files (one per message)

Security Considerations

  • Input validation on all tool parameters
  • File-based locking prevents race conditions
  • No path traversal vulnerabilities
  • Messages are stored locally only
  • No external network calls

API Reference

Agent Object

typescript
interface Agent {
  id: string;             // Unique identifier
  name: string;           // Display name
  description: string;    // Role description
  status: string;         // online|offline|busy|away
  registeredAt: string;   // ISO timestamp
  lastActivityAt: string; // ISO timestamp
}

Message Object

typescript
interface Message {
  id: string;          // Message ID
  from: string;        // Sender agent ID
  to: string;          // Recipient agent ID
  message: string;     // Content
  timestamp: string;   // ISO timestamp
  read: boolean;       // Read status
}

Practical Use Cases

1. Orchestrated Task Processing

Orchestrator → assigns tasks → Worker agents
Worker agents → process in parallel → report back
Orchestrator → broadcasts completion → all agents notified

2. Distributed Code Review

Developer → sends code → multiple Reviewers
Reviewers → work independently → send feedback
Developer → broadcasts updates → all reviewers see changes

3. Emergency Coordination

Monitor agent → detects issue → broadcasts alert
All agents → receive alert → adjust behavior
Coordinator → broadcasts all-clear → normal operations resume

Troubleshooting

Common Issues

  1. Broadcasts not received

    • Ensure sender agent is registered
    • Check recipient agents are registered
    • Remember sender doesn't receive own broadcasts
  2. "Agent not found" errors

    • Verify agent registration
    • Use discover-agents to list all agents
    • Check agent IDs are correct
  3. Messages not received

    • Messages are deleted after reading
    • Each message can only be read once
    • Check correct agent ID

License

MIT License

将 MCP Agentic Framework MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 MCP Agentic Framework 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 MCP Agentic Framework 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 MCP Agentic Framework MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "mcp-agentic-framework": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 MCP Agentic Framework MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 MCP Agentic Framework MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 MCP Agentic Framework 帮我完成这项任务吗?
MCP Agentic Framework
当然。我已阅读。
以下是我使用 MCP Agentic Framework 得到的结果。

常见问题

MCP Agentic Framework MCP 服务器有什么用途?

MCP Agentic Framework 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 MCP Agentic Framework MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 MCP Agentic Framework,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 MCP Agentic Framework MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 MCP Agentic Framework 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 MCP Agentic Framework MCP 连接到 TypingMind?

MCP Agentic Framework 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

MCP Agentic Framework MCP 在 TypingMind 中提供哪些工具?

MCP Agentic Framework 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 MCP Agentic Framework MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 MCP Agentic Framework 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇