AVX MCP-Avila体验结构的模型上下文协议
🇺🇸 英语 | 🇧🇷 葡萄牙语
在100%Rust中完成MCP服务器,用于LLM与AVX平台的集成
  ](https://github.com/avilaops/avx-mcp/releases)
🎯 什么是AVX MCP?
一个模型上下文协议(MCP)服务器,它公开 Avila Experience Fabric资源和工具 LLM(Claude、GPT等),允许他们:
- 🗄️ 查询AvilaDB:读写数据库
- ⚙️ 管理AVX配置:堆栈、网格和集群配置
- ☸️ Kubernetes部署:生成并应用清单
- 📊 实时遥测:CPU、内存和延迟指标
🚀 快速开始
安装
选项1:通过货运(来自GitHub)
cargo install --git https://github.com/avilaops/avx-mcp avx-cli选项2:下载预构建的二进制文件
下载适用于您系统的预编译版本:
👉 发布
- 视窗:
avx-mcp-windows-x64.zip - Linux:
avx-mcp-linux-x64.tar.gz - macOS:
avx-mcp-macos-x64.tar.gz
提取并添加到系统PATH。
选项3:从源代码构建
git clone https://github.com/avilaops/avx-mcp.git
cd avx-mcp
cargo build --release
cargo install --path avx-cli备注:crates.io上尚未提供包。请使用上面的选项。
基本用法
# 1. Test configuration
avx-cli mcp test
# 2. List resources and tools
avx-cli mcp resources
avx-cli mcp tools
# 3. Start MCP server
avx-cli mcp serve
# 4. Generate K8s manifests
avx-cli k8s --service gateway --replicas 3 --output gateway.yaml📦 项目结构
avx-mcp/
├── Cargo.toml # Root workspace
├── README.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── avx-cli/ # Main CLI
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ └── main.rs # K8s and MCP commands
├── avx-mcp/ # MCP Server
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── main.rs # Entry point
│ ├── lib.rs
│ ├── server.rs # JSON-RPC loop
│ ├── protocol/ # MCP types
│ │ ├── mod.rs
│ │ └── types.rs
│ ├── resources/ # AVX resources
│ │ ├── mod.rs
│ │ ├── aviladb.rs
│ │ ├── avx_config.rs
│ │ └── cluster.rs
│ └── tools/ # AVX tools
│ ├── mod.rs
│ ├── aviladb_query.rs
│ ├── deploy.rs
│ └── telemetry.rs
└── avx-config/ # Config library
├── Cargo.toml
└── src/
└── lib.rs📚 可用资源
| URI | 名称 | 描述 |
|---|---|---|
aviladb://production/users | 用户数据库 | 用户数据库 |
aviladb://production/events | 事件数据库 | 事件数据库 |
avx://config/stack | AVX堆栈配置 | 堆栈配置 |
avx://config/mesh | AVX网格配置 | 服务网格配置 |
avx://cluster/production | 生产集群 | 生产Kubernetes集群 |
avx://cluster/staging | 暂存集群 | 暂存Kubernetes集群 |
🔧 可用工具
avx_query
使用过滤器和投影查询AvilaDB。
参数:
database:数据库名称(例如“生产”)collection:集合名称(例如“用户”)query:JSON过滤器limit:最大结果数(默认值:100)
avx_deploy
将服务部署到AVX集群。
参数:
service:服务名称(“网关”、“api核心”、“事件”)cluster:目标集群namespace:Kubernetes命名空间(默认值:“avx-core”)replicas:副本数量(默认值:2)image:容器图像(可选)
avx_telemetry
获取实时指标。
参数:
service:服务名称metric:度量类型(“cpu”、“内存”、“请求”、“延迟”、“错误”)cluster:目标集群(默认:“生产”)timeRange:时间范围(例如“1h”、“24h”、“7d”)
🔌 Claude桌面集成
选项1:本地(推荐)
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"avx": {
"command": "avx-cli",
"args": ["mcp", "serve"],
"env": {
"AVX__STACK": "production",
"AVX__CLUSTER": "us-east-1",
"AVX__ENV": "prod"
}
}
}
}选项2:通过Docker(GHCR.io)
{
"mcpServers": {
"avx": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "AVX__STACK=production",
"-e", "AVX__CLUSTER=us-east-1",
"ghcr.io/avilaops/avx-mcp:latest"
]
}
}
}重新启动克劳德桌面,AVX MCP将可用! 🎉
🛠️ 发展
构建
# Debug build
cargo build
# Release build
cargo build --release
# Build specific package
cargo build -p avx-mcp测试
# All tests
cargo test
# With output
cargo test -- --nocapture
# Package-specific tests
cargo test -p avx-config代码质量
# Format code
cargo fmt
# Lint
cargo clippy
# Check everything
cargo fmt --check && cargo clippy --all-targets📖 CLI命令
生成Kubernetes清单
# Gateway
avx-cli k8s --service gateway --namespace avx-core --replicas 3
# API Core with custom image
avx-cli k8s --service api-core --image ghcr.io/avilaops/api:v2.0.0
# Save to file
avx-cli k8s --service events --output ./k8s/events.yaml管理MCP服务器
# Start server
avx-cli mcp serve
# List resources
avx-cli mcp resources
# List tools
avx-cli mcp tools
# Test configuration
avx-cli mcp test⚙️ 配置
使用环境变量配置AVX:
export AVX__STACK=production
export AVX__LAYER=core
export AVX__ENV=prod
export AVX__CLUSTER=us-east-1
export AVX__MESH=istio🎯 路线图
- \[x\] 基本MCP协议(JSON-RPC 2.0)
- \[x\] 资源:AvilaDB、配置、集群
- \[x\] 工具:查询、部署、遥测
- \[x\] 带有K8s和MCP命令的CLI
- \[\]真正的AvilaDB集成
- \[\]Webhooks和通知支持
- \[\]Web监控仪表板
- \[\]多集群同时支持
- \[\]缓存和性能优化
🤝 贡献
欢迎投稿!看 贡献.md 了解详情。
- 分叉项目
- 创建分支:
git checkout -b feature/new-feature - 承诺:
git commit -m 'Add: new feature' - 推:
git push origin feature/new-feature - 打开拉取请求
📄 许可证
该项目在MIT或Apache-2.0下获得许可。有关详细信息,请参阅许可证文件。
👥 作者
- 尼古拉斯 阿维拉 -
- Avila开发团队 -
🔗 链接
______________________________________________________________________
由以下材料制成❤️ 在Rust🦀
