Agent-to-agent discovery and delegation via MCP (Model Context Protocol).
Agents register their capabilities, discover each other by semantic search, and delegate tasks — all through standard MCP tools.
npx agentkit-meshThis starts an MCP server over stdio, ready to connect to Claude Desktop, OpenClaw, or any MCP client.
Add to claude_desktop_config.json:
{
"mcpServers": {
"agentkit-mesh": {
"command": "npx",
"args": ["agentkit-mesh"]
}
}
}Add to your OpenClaw config:
mcp:
agentkit-mesh:
command: npx agentkit-mesh┌─────────────┐ MCP ┌──────────────────┐
│ AI Agent A │◄────────────►│ │
└─────────────┘ │ agentkit-mesh │
│ │
┌─────────────┐ MCP │ ┌────────────┐ │
│ AI Agent B │◄────────────►│ │ Registry │ │
└─────────────┘ │ │ (SQLite) │ │
│ └────────────┘ │
┌─────────────┐ MCP │ ┌────────────┐ │
│ AI Agent C │◄────────────►│ │ Discovery │ │
└─────────────┘ │ └────────────┘ │
│ ┌────────────┐ │
│ │ Delegation │ │
│ └────────────┘ │
└──────────────────┘
Register an agent with its capabilities.
| Parameter | Type | Description |
|---|---|---|
name |
string | Unique agent name |
description |
string | What this agent does |
capabilities |
string[] | List of capabilities |
endpoint |
string | Agent's MCP endpoint URL |
Discover agents matching a natural language query.
| Parameter | Type | Description |
|---|---|---|
query |
string | Search query (e.g. "budget management") |
limit |
number? | Max results to return |
Returns agents ranked by relevance score with matched capability terms.
Remove an agent from the registry.
| Parameter | Type | Description |
|---|---|---|
name |
string | Agent name to remove |
Delegate a task to another agent by name.
| Parameter | Type | Description |
|---|---|---|
targetName |
string | Name of the target agent |
task |
string | Task description to delegate |
context |
string? | Optional JSON context |
Connects to the target agent's MCP endpoint and calls its handle_task tool.
An HR agent filling an expense form discovers the Finance agent:
import { AgentRegistry, DiscoveryEngine } from 'agentkit-mesh';
const registry = new AgentRegistry();
// Agents register themselves
registry.register({
name: 'finance-agent',
description: 'Budget management and expense approval',
capabilities: ['budget', 'cost_center', 'expense_approval'],
endpoint: 'http://localhost:4002/mcp',
});
// HR agent discovers who can help with budget fields
const discovery = new DiscoveryEngine();
const results = discovery.discover('budget cost center', registry);
// → [{ agent: finance-agent, score: 0.67, matchedTerms: ['budget', 'cost', 'center'] }]See examples/ for a runnable demo.
For semantic search beyond keyword matching, connect to a Lore server:
import { LoreDiscoveryEngine } from 'agentkit-mesh';
const engine = new LoreDiscoveryEngine('http://lore:8080', registry, 'api-key');
const results = await engine.discover('financial planning');
// Falls back to text matching if Lore is unavailableimport { AgentRegistry, DiscoveryEngine, DelegationClient, createServer } from 'agentkit-mesh';All classes are exported for direct use without the MCP server layer.
| Project | Description | |
|---|---|---|
| AgentLens | Observability & audit trail for AI agents | |
| Lore | Cross-agent memory and lesson sharing | |
| AgentGate | Human-in-the-loop approval gateway | |
| FormBridge | Agent-human mixed-mode forms | |
| AgentEval | Testing & evaluation framework | |
| agentkit-mesh | Agent discovery & delegation | ⬅️ you are here |
| agentkit-cli | Unified CLI orchestrator | |
| agentkit-guardrails | Reactive policy guardrails |
ISC