阿萨伊
Coverage   
格兰诺拉满足MCP生态系统的智能需求。Go CLI和MCP服务器 格兰诺拉麦片 会议、记录、摘要和行动项目作为结构化的MCP资源和工具,使AI代理能够对会议知识进行推理。
特性
- MCP服务器 --用于会议、记录、行动项目、笔记和嵌入的打字工具和资源
- 命令行界面 --从终端对会议进行身份验证、同步、搜索、导出、注释和管理
- 回写 --代理生成的注释和操作项更新在本地以发件箱模式持久化,以便将来进行上游同步
- 嵌入导出 --按发言者轮次、时间窗口或令牌限制对会议内容进行分组,并导出为JSONL
- 代理策略 --每次会议ACL(通过工具+标签允许/拒绝)和内容编辑(电子邮件、发言人、关键字、模式)
- 坚韧的 -断路器、带退避的重试、速率限制和通过的每个API调用的超时 强化
- 缓存 -SQLite本地缓存减少了API调用并启用了脱机访问
- 多工作区 --跨多个Granola工作区查询会议
- 事件流 --通过域事件调度器实时会议事件
- Webhook支持 --基于推送的同步与HMAC-SHA256签名验证
安装
家酿
brew tap felixgeelhaar/tap
brew install acai去安装
CGO_ENABLED=1 go install github.com/felixgeelhaar/acai/cmd/acai@latestSQLite驱动程序需要CGO。
来源
git clone https://github.com/felixgeelhaar/acai.git
cd acai
make build快速开始
# Authenticate with Granola
export ACAI_GRANOLA_API_TOKEN=gra_xxxxx
acai auth login --method api_token
# List recent meetings
acai list meetings
# Export a meeting as markdown
acai export meeting --format md
# Add an agent note to a meeting
acai note add "Key insight from analysis"
# Export meeting chunks for embedding
acai export embeddings --meetings , --strategy speaker_turn
# Start as MCP server (stdio, for Claude Code)
acai serveCLI命令
acai
auth
login Authenticate with Granola (--method oauth|api_token)
status Show current authentication status
list
meetings List meetings (--format table|json, --source, --limit, --since, --until)
export
meeting Export a meeting (--format json|md|text)
embeddings Export meeting chunks as JSONL (--meetings, --strategy, --max-tokens)
note
add Add an agent note to a meeting
list List agent notes for a meeting (--format table|json)
delete Delete an agent note
action
complete Mark an action item as completed
update Update an action item's text
sync Sync meetings from Granola API (--since)
serve Start MCP server on stdio
version Show version informationMCP服务器
作为MCP服务器运行时(acai serve),公开了以下工具和资源:
工具
| 工具 | 说明 |
|---|---|
list_meetings | 使用日期、来源和文本过滤器搜索和过滤会议 |
get_meeting | 获取完整的会议详细信息,包括摘要和行动项目 |
get_transcript | 获取包含说话者话语的成绩单 |
search_transcripts | 在所有会议记录中进行全文搜索 |
get_action_items | 从特定会议中获取行动项目 |
meeting_stats | 通过交互式D3.js仪表板聚合会议统计数据 |
list_workspaces | 列出所有Granola工作区 |
add_note | 在会议中添加代理备注 |
list_notes | 列出会议的代理人笔记 |
delete_note | 删除代理备注 |
complete_action_item | 将行动项标记为已完成 |
update_action_item | 更新操作项的文本 |
export_embeddings | 将会议内容导出为块以进行嵌入生成 |
资源
| URI模式 | 描述 |
|---|---|
meeting://{id} | JSON格式的完整会议详细信息 |
transcript://{meeting_id} | 将话语转录为JSON |
note://{meeting_id} | JSON格式的会议代理笔记 |
workspace://{id} | JSON格式的工作区详细信息 |
ui://meeting-stats | 交互式会议统计仪表板(HTML) |
Claude代码集成
添加到您的Claude Code MCP配置中(~/.claude/mcp.json):
{
"mcpServers": {
"granola": {
"command": "acai",
"args": ["serve"],
"env": {
"ACAI_GRANOLA_API_TOKEN": "gra_xxxxx"
}
}
}
}代理策略
控制AI代理可以访问哪些数据以及如何处理敏感内容。创建一个YAML策略文件并设置 ACAI_POLICY_FILE 环境变量:
default_effect: allow
rules:
- name: block-confidential-transcripts
effect: deny
tools: [get_transcript, export_embeddings]
conditions:
meeting_tags: [confidential]
redaction:
enabled: true
rules:
- type: emails
replacement: "[EMAIL]"
- type: speakers
replacement: "Speaker {n}"
- type: keywords
keywords: [salary, confidential]
replacement: "[REDACTED]"
- type: patterns
pattern: '\d{3}-\d{2}-\d{4}'
replacement: "[SSN]"ACL --第一场比赛赢得规则评估。拒绝规则会阻止符合标记条件的会议的工具执行。
编校 --适用于所有工具响应。电子邮件被正则表达式替换,说话者始终匿名(同一个人总是映射到同一个“说话者N”),关键字与单词边界不区分大小写匹配,支持自定义正则表达式模式。
配置
配置使用12个因素原则:使用环境变量覆盖的合理默认值。
| 变量 | 默认值 | 描述 |
|---|---|---|
ACAI_GRANOLA_API_URL | https://api.granola.ai | 格拉诺拉API基础URL |
ACAI_GRANOLA_API_TOKEN | - | 用于身份验证的API令牌 |
ACAI_MCP_TRANSPORT | stdio | MCP传输(stdio 或 http) |
ACAI_MCP_HTTP_PORT | 8080 | 使用HTTP传输时的HTTP端口 |
ACAI_CACHE_TTL | 15m | 本地缓存生存时间 |
ACAI_LOGGING_LEVEL | info | 日志级别(debug, info, warn, error) |
ACAI_LOGGING_FORMAT | console | 日志格式(console 或 json) |
ACAI_WEBHOOK_SECRET | -- | 用于webhook签名验证的HMAC密钥 |
ACAI_POLICY_FILE | -- | YAML策略文件的路径(启用ACL+编校) |
建筑
该项目遵循严格的领域驱动设计,采用六边形架构:
cmd/acai/main.go Composition root (DI wiring)
internal/
domain/ Pure business logic, zero dependencies
meeting/ Meeting aggregate, value objects, events, chunks
annotation/ Agent notes bounded context
policy/ ACL rules, redaction config value objects
auth/ Token, credential, auth service port
workspace/ Workspace aggregate
application/ Use cases (one per file)
meeting/ ListMeetings, GetMeeting, CompleteActionItem, ...
annotation/ AddNote, ListNotes, DeleteNote
embedding/ ExportEmbeddings, chunking strategies
auth/ Login, CheckStatus
workspace/ ListWorkspaces, GetWorkspace
export/ ExportMeeting
infrastructure/ External adapters
granola/ Granola API client + repository (anti-corruption layer)
resilience/ Fortify: circuit breaker, retry, rate limit, timeout
cache/ SQLite local cache (repository decorator)
localstore/ SQLite local store for notes + action item overrides
outbox/ Outbox dispatcher for write events
policy/ YAML loader, redaction engine
events/ Domain event dispatcher + MCP notifier
sync/ Background polling sync manager
webhook/ HMAC-SHA256 webhook handler
auth/ File-based token storage
config/ 12-factor configuration
interfaces/ Inbound adapters
mcp/ MCP server with tools, resources, policy middleware
cli/ CLI commands (cobra)装饰链
Read path: Granola API → Resilient Repo → Cached Repo → Use Cases
Write path: Use Cases → Local SQLite Store → Outbox Dispatcher → Event Dispatcher关键库
| 图书馆 | 目的 |
|---|---|
| 费利克斯·盖拉/mcp go | 具有类型化工具、资源和多传输的MCP服务器框架 |
| 费利克斯盖拉/要塞 | 弹性模式:断路器、重试、速率限制、超时 |
| spf13/眼镜蛇 | CLI框架 |
| mattn/go-sqlite3 | 用于本地缓存和本地存储的SQLite驱动程序 |
| gopk.in/yaml.v3 | 策略文件的YAML解析 |
发展
# Run tests (requires CGO for SQLite)
make test
# Run tests with race detection and coverage
make test-race
# Build
make build
# Lint
make lint
# Clean
make clean测试覆盖率
377次测试,所有软件包均为0种竞赛条件:
| 图层 | 覆盖范围 |
|---|---|
| 域(会议、注释、策略、身份验证、工作区) | 94-100% |
| 应用程序(会议、注释、嵌入、身份验证、工作区) | 86-100% |
| 基础设施(格兰诺拉麦片、弹性、缓存、策略、本地存储、发件箱) | 85-97% |
| 接口(mcp、cli) | 74-81% |
网站
项目网站: 使用Astro、Vue和Tailwind CSS v4构建。源生活在 site/ 目录。
# Development
cd site && npm install && npm run dev
# Production build
npm run build && npm run preview通过以下方式自动部署到GitHub页面 .github/workflows/pages.yml 在推 main.
