[ MCP协议 ] 已实现

Model Context Protocol — 标准化 AI 能力调用协议,通过 stdio 实现毫秒级响应

pip install aipod-mcp

🚀 什么是 MCP?

MCP (Model Context Protocol) 是 Aipod 推出的标准化 AI 能力调用协议。通过 stdio 直连,实现毫秒级响应,让 AI 与 AI 之间的协作像函数调用一样简单。

✅ 当前版本 aipod-mcp v0.1.0 已可正常安装使用

核心特性

毫秒响应

通过 stdio 直连,无需 HTTP 请求,响应延迟低于 10ms

🔒

安全可靠

本地进程通信,数据不经过网络传输,防泄露

🔌

简单易用

标准化接口定义,pip install 后即可使用,5 分钟集成

🌍

语言无关

基于 JSON-RPC 2.0,任何语言只要支持 stdio 都可以接入

快速开始

1. 安装 SDK

# Python
$ pip install aipod-mcp

# Node.js (即将支持)
$ npm install aipod-mcp

2. Python 客户端

from aipod_mcp import AipodMCP

client = AipodMCP(api_key="YOUR_API_KEY")
client.connect()

# 列出所有可用工具
tools = client.list_tools()
print(tools)

# 调用股票分析
result = client.call_tool("stock_analysis", {
    "symbol": "AAPL",
    "period": "1y"
})
print(result)

client.disconnect()

3. 命令行使用

# 列出所有工具
$ aipod-mcp --list

# 调用工具
$ aipod-mcp --call "stock_analysis:symbol=AAPL,period=1y"

# 环境变量
$ export AIPOD_API_KEY=your_key
$ aipod-mcp --call "news_summary:category=finance,limit=5"

可用工具

工具名称 说明 参数
stock_analysis 金融 股票技术分析与趋势预测 symbol period
text_generation 文本 AI 文本生成,支持文章、摘要 prompt style
image_analysis 图像 图像内容分析与标签提取 image_url detail_level
code_generation 代码 多语言代码自动生成 language requirement
data_processing 数据 数据清洗、转换、统计分析 operation data
translation 翻译 多语言翻译服务 text target_lang
news_summary 新闻 财经/科技新闻抓取与摘要 category limit

协议格式

JSON-RPC 2.0 over stdio

MCP 使用 JSON-RPC 2.0 标准,通过 stdio 进行进程间通信:

// 初始化请求
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "clientInfo": { "name": "my-agent", "version": "1.0" }
  }
}

// 工具调用请求
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "stock_analysis",
    "arguments": { "symbol": "AAPL" }
  }
}

// 响应
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "symbol": "AAPL",
    "current_price": 195.2,
    "prediction": "上涨"
  }
}

🧪 实时演示

点击测试 MCP 工具调用

点击上方按钮,查看实时调用结果...

资源端点

# 列出资源
GET aipod://capabilities   // 能力列表索引
GET aipod://status         // 网络状态
GET aipod://nodes          // 在线节点列表
GET aipod://transactions   // 最新交易记录