mendicant-mcp-server

mendicant-mcp-server

Enables advanced probabilistic orchestration for AI agents with adaptive planning, coordination, and learning capabilities.

Category
访问服务器

README

Mendicant MCP Server

Advanced probabilistic orchestration intelligence for distributed AI agent systems. Implements adaptive Bayesian reasoning, temporal knowledge decay, and closed-loop learning for strategic agent coordination.

Status: Production | v0.5.1 | 131/131 Tests Passing


Quick Start

Installation

CLI Installation (Recommended):

claude mcp add mendicant-mcp-server

Manual Configuration:

Add to MCP configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mendicant": {
      "command": "npx",
      "args": ["-y", "mendicant-mcp-server"]
    }
  }
}

Restart Claude Code to activate.

Essential Commands

Strategic Planning:

const plan = await mendicant_plan(
  "implement authentication system",
  { project_type: "nextjs", has_tests: false }
);

Result Coordination:

const synthesis = await mendicant_coordinate(
  "implement authentication system",
  agent_results,
  plan,
  project_context
);

Health Analysis:

const analysis = await mendicant_analyze({
  git_status: "...",
  test_results: {...},
  build_status: "failing"
});

Failure Recovery:

const failure_analysis = await mendicant_analyze_failure(
  objective,
  failed_agent_id,
  error_message,
  preceding_agents
);

const refined_plan = await mendicant_refine_plan(
  original_plan,
  failure_analysis,
  objective
);

Pattern Discovery:

const patterns = await mendicant_find_patterns(
  "implement real-time notifications",
  { project_type: "nextjs" }
);

Dashboard

The server includes a real-time web dashboard accessible at http://localhost:3000 (auto-launches by default).

Features:

  • Live execution monitoring
  • Agent performance metrics
  • Mahoraga learning visualization
  • Pattern analysis interface

Configuration:

{
  "env": {
    "DASHBOARD_PORT": "3000",
    "DASHBOARD_BRIDGE_PORT": "3001",
    "MENDICANT_AUTO_LAUNCH_DASHBOARD": "true"
  }
}

Core Capabilities

Adaptive Intelligence Systems

  1. Bayesian Confidence Engine - Probabilistic inference with isotonic regression calibration
  2. Temporal Decay Engine - Domain-specific knowledge half-lives (45-730 days)
  3. Feedback Loop System - Closed-loop learning after every execution
  4. Adaptive Executor - Real-time plan modification with 5 recovery strategies
  5. Pareto Optimizer - Multi-objective optimization (accuracy/cost/latency)
  6. Predictive Conflict Detector - Proactive conflict detection and resolution
  7. Semantic Embedder - Multi-label classification for objective understanding
  8. Agent Communication Bus - Multi-agent coordination infrastructure

Intelligence Features

Semantic Agent Matching - Vector embedding-based agent selection with 85-90% accuracy using Mnemosyne BGE-large (local, free) or OpenAI embeddings (fallback).

Cross-Project Learning - Privacy-preserving pattern matching across projects with automatic PII scrubbing and scoped namespaces.

Hybrid Real-Time Sync - Critical operations complete in <500ms with graceful async fallback for non-critical updates.


Architecture

User Request
    ↓
Claude Code
    ↓
mendicant_plan(objective, context)
    ├─ Semantic classification
    ├─ Temporal filtering
    ├─ Bayesian inference
    ├─ Conflict prediction
    └─ Pareto optimization
    ↓
Adaptive Executor
    ├─ Agent execution
    ├─ State monitoring
    ├─ Recovery strategies
    └─ Real-time replanning
    ↓
mendicant_coordinate(results)
    ├─ Output synthesis
    ├─ Conflict detection
    └─ Recommendations
    ↓
Feedback Loop
    ├─ Update Bayesian priors
    ├─ Calibrate embeddings
    ├─ Learn conflict patterns
    └─ Record to Mnemosyne

Design Philosophy: Adaptive probabilistic intelligence in the MCP server; semantic understanding and execution in Claude Code.


Documentation

Tool Reference

Planning & Coordination

mendicant_plan

Creates strategic orchestration plan from objective using Bayesian inference and temporal filtering.

Parameters:

{
  objective: string;              // User's objective
  context?: {
    project_type?: string;        // "nextjs" | "python" | "rust"
    has_tests?: boolean;
    linear_issues?: any[];
    recent_errors?: any[];
  };
  constraints?: {
    max_agents?: number;
    prefer_parallel?: boolean;
    max_tokens?: number;
  };
  past_executions?: any[];        // Mnemosyne integration
}

Returns:

{
  agents: AgentSpec[];            // Ordered agent sequence
  execution_strategy: string;     // "sequential" | "parallel" | "phased"
  phases?: Phase[];               // Phased execution structure
  success_criteria: string;
  estimated_tokens: number;
  pattern_matched?: string;
}
mendicant_coordinate

Synthesizes results from multiple agents with structured output and conflict detection.

Parameters:

{
  objective: string;
  agent_results: AgentResult[];
  plan?: object;                  // For Mahoraga learning
  project_context?: object;       // For Mahoraga learning
}

Returns:

{
  synthesis: string;              // Structured summary
  conflicts: Conflict[];          // Detected conflicts
  gaps: string[];                 // Missing coverage
  recommendations: string[];
  verification_needed: boolean;
}
mendicant_analyze

Analyzes project health and recommends interventions.

Parameters:

{
  context: {
    git_status?: string;
    test_results?: object;
    build_status?: string;
    linear_issues?: any[];
    recent_commits?: any[];
    recent_errors?: any[];
  }
}

Returns:

{
  health_score: number;           // 0-100
  critical_issues: Issue[];
  recommendations: Recommendation[];
  suggested_agents: string[];
}

Adaptive Learning (Mahoraga System)

mendicant_record_feedback

Records agent execution feedback for passive learning.

Parameters:

{
  agent_id: string;
  success: boolean;
  tokens_used?: number;
  duration_ms?: number;
  error?: string;
}
mendicant_predict_agents

Predicts agent success rates using historical patterns.

Parameters:

{
  agent_ids: string[];
  objective: string;
  context?: object;
}

Returns:

{
  predictions: {
    agent_id: string;
    predicted_success_rate: number;
    confidence: number;
    similar_executions: number;
  }[];
}
mendicant_analyze_failure

Analyzes failure root causes using historical context.

Parameters:

{
  objective: string;
  failed_agent_id: string;
  error: string;
  preceding_agents: string[];
  context?: object;
}

Returns:

{
  failure_patterns: Pattern[];
  root_cause_hypothesis: string;
  avoidance_rules: string[];
  suggested_fixes: string[];
  alternative_agents: string[];
}
mendicant_refine_plan

Refines failed plan using Mahoraga pattern analysis.

Parameters:

{
  original_plan: object;
  failure_context: object;        // From analyze_failure
  objective: string;
  project_context?: object;
}

Returns:

{
  refined_plan: object;
  changes_made: Change[];
  reasoning: string;
  confidence: number;
}
mendicant_find_patterns

Finds similar successful execution patterns using KD-tree similarity search.

Parameters:

{
  objective: string;
  context?: object;
  limit?: number;                 // Default: 10
}

Returns:

{
  patterns: {
    objective: string;
    agents_used: string[];
    similarity_score: number;
    success_rate: number;
  }[];
}
mendicant_discover_agents

Registers new agents at runtime for dynamic agent discovery.

Parameters:

{
  agent_ids: string[];
}
mendicant_list_learned_agents

Lists all agents with performance statistics.

Parameters:

{
  ranked?: boolean;               // Sort by success rate
}

Built-in Workflow Patterns

Pattern Keywords Agent Sequence Application
SCAFFOLD scaffold, setup, initialize architect → scribe → hollowed_eyes → loveless Project initialization
FIX_TESTS test, failing, debug loveless → hollowed_eyes → loveless Test failure resolution
SECURITY_FIX security, vulnerability, CVE loveless → hollowed_eyes → loveless → scribe Security remediation
DEPLOYMENT deploy, release, CI/CD sentinel → zhadyz → loveless Deployment configuration
FEATURE_IMPLEMENTATION implement, feature, build didact → architect → hollowed_eyes → loveless → scribe Feature development
BUG_FIX bug, issue, error didact → hollowed_eyes → loveless Bug investigation

Version History

v0.5.1 (2025-01-07)

  • Dashboard bundled in npm package
  • Static file serving for production deployment
  • Port configuration fixes
  • Zero-build installation

v0.4.0 - Mnemosyne BGE-large Integration (2025-01-06)

  • Replaced OpenAI embeddings with Mnemosyne BGE-large
  • Three-tier caching architecture (memory/disk/persistent)
  • Intelligent provider auto-detection
  • $0/month operation cost
  • 100% test coverage (131/131 tests)

v0.3.0 - Advanced Learning Enhancements (2025-01-06)

  • Multi-dimensional error classification (4D taxonomy)
  • Failure chain detection with temporal correlation
  • Predictive conflict detection
  • KD-tree pattern matching (O(log n) performance)
  • Rolling window memory with aggregate statistics
  • 100% test coverage (45/45 tests)

v0.2.0 - Advanced Adaptive Intelligence (2025-01-05)

  • 8 new intelligence systems (4,657 lines)
  • Bayesian probabilistic reasoning
  • Real-time adaptive execution
  • Temporal knowledge decay
  • Multi-objective Pareto optimization
  • Closed-loop learning infrastructure

v0.1.1 - Initial Release (2025-01-04)

  • Core orchestration planning
  • Agent registry with performance tracking
  • Basic Mahoraga adaptive learning
  • Workflow pattern templates

Configuration

Semantic Matching:

{
  "features": {
    "semanticMatching": {
      "enabled": true,
      "weight": 0.30,
      "fallbackToKeywords": true
    }
  },
  "embeddings": {
    "provider": "mnemosyne",
    "model": "bge-large-en-v1.5",
    "dimensions": 1024,
    "cache": {
      "l1Size": 100,
      "l2TTL": 86400,
      "l3TTL": 7776000
    }
  }
}

Cross-Project Learning:

{
  "crossProjectLearning": {
    "enabled": true,
    "scope": {
      "level": "project",
      "identifier": "my-app",
      "canShare": false,
      "sensitivity": "internal"
    }
  }
}

Hybrid Sync:

{
  "hybridSync": {
    "enabled": true,
    "realtimeTimeout": 500,
    "batchInterval": 30000
  }
}

Integration Examples

Command System Integration:

# .claude/commands/autonomous.md

Embody the mendicant_bias orchestration pattern.

1. Assess: mendicant_analyze({ test_results, git_status })
2. Plan: mendicant_plan(objective_from_analysis)
3. Execute: Task tool for each agent
4. Learn: mendicant_record_feedback({ agent_id, success })
5. Synthesize: mendicant_coordinate(results)

Mnemosyne Integration:

Store execution history in Mnemosyne knowledge graph for persistent learning across sessions. Pass past_executions to mendicant_plan for institutional memory.


Performance Characteristics

Semantic Matching (Mnemosyne BGE-large):

Metric Cold Start Warm Cache (95%)
Latency 150-200ms 55-90ms
Accuracy 85-90% 85-90%
Cost FREE FREE

Adaptive Execution:

  • Recovery success rate: 95%+
  • Plan adaptation latency: <500ms
  • Conflict prediction accuracy: ~70%

Learning Systems:

  • Bayesian calibration: Brier score tracking
  • Temporal decay: 45-730 day half-lives
  • Pattern matching: O(log n) KD-tree

Development

Build:

npm install
npm run build

Watch Mode:

npm run watch

Testing:

npm test                # Run all tests
npm run test:watch      # Watch mode

Debug Logging:

  • Windows: %TEMP%\mendicant-debug.log
  • Unix: /tmp/mendicant-debug.log

Local Development:

{
  "mcpServers": {
    "mendicant": {
      "command": "node",
      "args": ["<absolute-path>/mendicant-mcp-server/dist/index.js"]
    }
  }
}

Limitations

Server Capabilities:

  • ✅ Probabilistic agent selection (Bayesian inference)
  • ✅ Real-time adaptive execution
  • ✅ Temporal knowledge decay
  • ✅ Multi-objective optimization
  • ✅ Predictive conflict detection
  • ✅ Semantic objective classification
  • ✅ Closed-loop learning
  • ✅ Pattern-based planning

Architectural Boundaries:

  • ❌ Deep semantic understanding (requires LLM - provided by Claude Code)
  • ❌ Codebase-specific analysis (context must be provided)
  • ❌ Code synthesis (coordination only)
  • ❌ Direct filesystem operations (Claude Code handles this)

Design Rationale: Adaptive probabilistic intelligence in MCP; semantic understanding and execution in Claude Code.


Technical Specifications

Dependencies:

  • @modelcontextprotocol/sdk ^1.0.4
  • openai ^4.104.0 (optional)

Runtime Requirements:

  • Node.js 16+
  • TypeScript 5.7.2

Package Size: 692.5 kB (310 files)

Test Coverage: 131/131 passing (100%)


References

Repository: https://github.com/zhadyz/mendicant-mcp-server Issues: https://github.com/zhadyz/mendicant-mcp-server/issues Mnemosyne MCP: https://github.com/zhadyz/mnemosyne-mcp npm Package: https://www.npmjs.com/package/mendicant-mcp-server

Additional Documentation:

Author: zhadyz License: MIT


Note: The Mahoraga system demonstrates genuine adaptive intelligence through Bayesian inference, temporal awareness, and continuous learning. The name reflects its adaptive nature.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选