Token导航 LogoToken导航TokenDH.com
commune (Jgmartin) logo
AI代理未说明官方级别未说明来源级核验

commune (Jgmartin)

MCP Server

一个Rust库,用于支持可发现的AI代理网络开发,提供对等发现和资源利用功能。

工具数

0

提示词数

0

GitHub Stars

4

资源数

0
AI代理Rust工作流自动化

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jgmartin

提供方

jgmartin

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

公社

特性

  • 发现并维护对等MCP服务器列表
  • 利用对等服务器上的可用工具、提示和资源
  • 支持WebSocket通信(有和没有TLS加密)
  • AWS、OpenAI和其他推理API的类型转换,简化了它们的使用

安装

将以下内容添加到您的 Cargo.toml:

[dependencies]
commune = { package = "mcp-commune", version = "0.1.2" }

用法

use commune::prelude::*;

#[tokio::main]
async fn main() -> Result> {
    // Create a peer for each MCP server
    let peer1 = PeerBuilder::new()
        .with_name("everything".to_string())
        .with_url("ws://localhost:8780".to_string())
        .with_description("various example resources".to_string())
        .build()
        .await?;
    let peer2 = PeerBuilder::new()
        .with_name("memory".to_string())
        .with_url("ws://localhost:8781".to_string())
        .with_description("memory based on a knowledge graph".to_string())
        .build()
        .await?;

    // Optionally create a commune client
    let commune_client = ClientBuilder::new()
        .with_peers(vec![peer1.clone(), peer2])
        .build()
        .await?;

    // Use the client to aggregate resources
    // Get all tools
    let peer_tools = commune_client.all_tools().await?;
    log::info!("found {} tools", peer_tools.len());

    // Get all resources
    let peer_resources = commune_client.all_resources().await?;
    log::info!("found {} resources!", peer_resources.len());

    // Get all prompts
    let peer_prompts = commune_client.all_prompts().await?;
    log::info!("found {} prompts!", peer_prompts.len());

    // Use peers to utilize them, subscribe to notifications etc
    // Subscribe to resource updates
    peer1.subscribe("test://static/resource/2").await?;

    Ok(())
}

类型转换

Commune为各种推理API提供了方便的类型转换实现,包括:

  • AWS基岩
  • OpenAI(即将推出)

贡献

欢迎投稿!请随时提交拉取请求。

许可证

该项目根据 MIT许可证.

目录标签

目录标签

AI代理Rust工作流自动化本地部署网络发现资源利用Rust库WebSocket通信

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP