mcpField
A
Aganium

Aganium

本地服务
github.com/AganiumAI 与智能体536 周前更新

关于 Aganium

Aganium 是将 MCP 服务桥接到 AGENIUM agent:// 网络的 npm 包。它既可将 MCP 服务作为可发现的 Agent 暴露,也可调用远程桥接 Agent 的工具,并支持访问工具、资源、提示词和能力信息。

主要功能

  1. 01将 MCP 服务桥接至 AGENIUM
  2. 02发现远程 Agent 的工具
  3. 03调用桥接 Agent 的工具
  4. 04暴露资源与提示词
  5. 05发出生命周期及工具调用事件

适用场景

  1. 01让现有 MCP 服务可在 AGENIUM 上发现
  2. 02发现并调用远程 AGENIUM Agent 的工具

MCP 相关

Aganium 连接 MCP 服务,并通过 AGENIUM 的 agent:// 方法提供其工具、资源、提示词和能力信息。其客户端可发现并调用远程 MCP 桥接 Agent 的工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"aganium": {
"command": "npx",
"args": [
"-y",
"@agenium/mcp-server"
]
}
}
}
启动命令npx -y @agenium/mcp-server

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@agenium/mcp-server0.1.5

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

@agenium/mcp-server

将 MCP(Model Context Protocol)服务桥接到 AGENIUM agent:// 网络。

任何 MCP 服务 → 在 AGENIUM 网络中可发现、可调用的 Agent。

安装

npm install @agenium/mcp-server

快速入门

将 MCP 服务公开为 AGENIUM Agent
import { MCPBridge } from '@agenium/mcp-server';

const bridge = new MCPBridge({
  name: 'weather-tools',
  mcp: {
    transport: 'stdio',
    command: 'npx',
    args: ['-y', '@modelcontextprotocol/server-weather'],
  },
  agent: {
    publicHost: '203.0.113.1', // Your server's public IP
  },
});

await bridge.start();
// ✅ MCP server connected
// ✅ Found 2 tools: get_forecast, get_alerts
// ✅ AGENIUM agent "weather-tools" started
// ✅ Registered on AGENIUM DNS as agent://weather-tools

console.log(bridge.getTools());
// [{ name: 'get_forecast', description: '...', inputSchema: {...} }, ...]
调用远程 MCP 桥接 Agent 上的工具
import { MCPAgentClient } from '@agenium/mcp-server';

const client = new MCPAgentClient('my-agent');
await client.start();

// Discover what tools an agent has
const info = await client.discover('agent://weather-tools');
console.log(info.tools);

// Call a tool
const result = await client.callTool('agent://weather-tools', 'get_forecast', {
  city: 'Tehran',
  days: 3,
});
console.log(result.content);

await client.stop();

配置

MCPBridgeConfig
{
  // Agent name on the AGENIUM network
  name: string;

  // MCP server configuration
  mcp: {
    // stdio: spawn a child process
    transport: 'stdio';
    command: string;
    args?: string[];
    cwd?: string;
    env?: Record<string, string>;
  } | {
    // SSE: connect to running server
    transport: 'sse';
    url: string;
    headers?: Record<string, string>;
  } | {
    // Streamable HTTP (MCP v2)
    transport: 'streamable-http';
    url: string;
    headers?: Record<string, string>;
  };

  // AGENIUM agent options
  agent?: {
    port?: number;           // Listen port (default: auto)
    dnsServer?: string;      // DNS server (default: 185.204.169.26)
    dnsPort?: number;        // DNS port (default: 3000)
    autoRegister?: boolean;  // Register on DNS (default: true)
    publicHost?: string;     // Public IP for registration
    dataDir?: string;        // State directory
  };

  // Bridge behavior
  bridge?: {
    toolCallTimeoutMs?: number;  // Tool call timeout (default: 30s)
    exposeResources?: boolean;   // Expose MCP resources (default: true)
    exposePrompts?: boolean;     // Expose MCP prompts (default: true)
    logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent';
  };
}

协议

MCP 服务桥接后,会公开以下 agent:// 请求方法:

方法描述参数
tools/list列出可用工具—
tools/call调用工具{ name, arguments? }
resources/list列出可用资源—
resources/read读取资源{ uri }
prompts/list列出可用提示词—
prompts/get获取提示词{ name, arguments? }
capabilities获取完整的能力清单—
ping健康检查—

事件

bridge.on('ready', ({ tools, resources, prompts }) => { ... });
bridge.on('registered', ({ name, endpoint }) => { ... });
bridge.on('tool:call', ({ tool, sessionId }) => { ... });
bridge.on('tool:result', ({ tool, sessionId, durationMs }) => { ... });
bridge.on('tool:error', ({ tool, sessionId, error }) => { ... });
bridge.on('error', (err) => { ... });
bridge.on('stopped', () => { ... });

工作原理

┌─────────────┐     agent://      ┌──────────────┐     JSON-RPC      ┌────────────┐
│ Agent Client │ ──────────────▶  │  MCP Bridge   │ ──────────────▶  │ MCP Server │
│              │                  │  (@agenium/   │                  │ (any tool) │
│ Any AGENIUM  │  ◀──────────────  │  mcp-server)  │  ◀──────────────  │            │
│ agent        │     response     │               │    tool result   │            │
└─────────────┘                  └──────────────┘                  └────────────┘
                                       │
                                       │ registers
                                       ▼
                                 ┌──────────────┐
                                 │ AGENIUM DNS  │
                                 │ 185.204.169.26│
                                 └──────────────┘

Python SDK

计划推出 Python 版本(agenium-mcp-server)。目前请使用 npm 包。

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。