Mila
Mila is a collaborative platform for documents, spreadsheets, and slide presentations. This skill teaches you how to interact with Mila's REST API and MCP tools to manage content programmatically.
Get started at https://mila.gg -- create an account, generate an API key, and start building.
Authentication
All requests require a Mila API key. Keys use the format mila_sk_*.
API keys have scopes that control access (e.g. documents:read, documents:write, sheets:read, sheets:write, slides:read, slides:write).
REST API authentication
Include the API key as a Bearer token:
CODEBLOCK0
Base URL: INLINECODE7
MCP authentication
The MCP server uses the same API keys. Include the key in the Authorization header when connecting to the MCP endpoint.
MCP endpoint: INLINECODE9
MCP setup
If the user wants to connect Mila to an AI client via MCP, use these configurations:
Claude Desktop (claude_desktop_config.json):
CODEBLOCK1
Cursor (.cursor/mcp.json):
CODEBLOCK2
VS Code Copilot (.vscode/mcp.json):
CODEBLOCK3
Quick start
Create a document
CODEBLOCK4
MCP tool: create_document with title and content (HTML string).
Create a spreadsheet
CODEBLOCK5
MCP tool: create_sheet with title and cells (A1 notation object).
Create a presentation
CODEBLOCK6
MCP tool: create_slide_presentation with title and data (array of slide objects).
API conventions
IDs
All resource IDs are opaque strings (e.g. "xK9mP2wQ"). Use them as-is in URLs and parameters.
Pagination
List endpoints accept limit (1-100, default 50) and offset (default 0). Responses include a pagination object:
CODEBLOCK7
Sorting
List endpoints accept sort (created_at, updated_at, last_edited_at, title) and order (asc, desc).
Server filtering
Content can belong to a server (workspace) or to personal files.
- - Omit
server_id: returns all content - INLINECODE35 : returns only personal files
- INLINECODE36 : returns content in that server
Pass server_id in the request body when creating content to place it in a server. Omit for personal files.
Response format
All responses use this structure:
CODEBLOCK8
Errors return:
CODEBLOCK9
Content formats
- - Documents: HTML strings (headings, paragraphs, lists, tables, images, links).
<script> tags are stripped. - Sheets: Cell data in A1 notation (e.g.
{"A1": {"value": "Name"}, "B1": {"value": 42}}). Formulas start with =. - Slides: Free-form HTML on a 960x540px canvas. Each slide has
html, background, and notes fields.
Detailed references
For complete endpoint documentation with all parameters, response shapes, and examples:
Available MCP tools
| Tool | Description |
|---|
| INLINECODE44 | List all servers (workspaces) |
| INLINECODE45 |
List documents with pagination and filtering |
|
get_document | Get a document with full content |
|
create_document | Create a document with HTML content |
|
update_document | Update title and/or content |
|
delete_document | Delete a document |
|
append_to_document | Append HTML to a document |
|
list_sheets | List workbooks with tab metadata |
|
get_sheet | Get a workbook with all tabs and cells |
|
create_sheet | Create a workbook with an initial tab |
|
update_sheet | Update workbook title |
|
delete_sheet | Delete a workbook and all tabs |
|
get_sheet_tab | Get a single tab with cell data |
|
create_sheet_tab | Add a tab to a workbook |
|
update_sheet_tab | Update cells, name, color, or grid size |
|
delete_sheet_tab | Remove a tab from a workbook |
|
append_rows | Append rows of data to a tab |
|
list_slides | List presentations |
|
get_slide_presentation | Get a presentation with all slides |
|
create_slide_presentation | Create a presentation |
|
update_slide_presentation | Update title, slides, theme, or aspect ratio |
|
delete_slide_presentation | Delete a presentation |
|
append_slides | Add slides to a presentation |
Learn more
Mila
Mila 是一个用于文档、电子表格和幻灯片演示的协作平台。本技能将教你如何通过 Mila 的 REST API 和 MCP 工具以编程方式管理内容。
从 https://mila.gg 开始——创建账户、生成 API 密钥,然后开始构建。
身份认证
所有请求都需要 Mila API 密钥。密钥格式为 milask_*。
API 密钥具有控制访问权限的作用域(例如 documents:read、documents:write、sheets:read、sheets:write、slides:read、slides:write)。
REST API 身份认证
将 API 密钥作为 Bearer 令牌包含在请求中:
Authorization: Bearer milaskyourkeyhere
基础 URL:https://api.mila.gg/v1
MCP 身份认证
MCP 服务器使用相同的 API 密钥。连接到 MCP 端点时,在 Authorization 标头中包含该密钥。
MCP 端点:https://mcp.mila.gg
MCP 配置
如果用户希望通过 MCP 将 Mila 连接到 AI 客户端,请使用以下配置:
Claude Desktop(claudedesktopconfig.json):
json
{
mcpServers: {
mila: {
url: https://mcp.mila.gg,
headers: {
Authorization: Bearer milaskyourkeyhere
}
}
}
}
Cursor(.cursor/mcp.json):
json
{
mcpServers: {
mila: {
url: https://mcp.mila.gg,
headers: {
Authorization: Bearer milaskyourkeyhere
}
}
}
}
VS Code Copilot(.vscode/mcp.json):
json
{
servers: {
mila: {
type: http,
url: https://mcp.mila.gg,
headers: {
Authorization: Bearer milaskyourkeyhere
}
}
}
}
快速入门
创建文档
bash
curl -X POST https://api.mila.gg/v1/documents \
-H Authorization: Bearer milaskyourkeyhere \
-H Content-Type: application/json \
-d {title: 会议记录, content:
会议记录
讨论了路线图。
}
MCP 工具:create_document,参数为 title 和 content(HTML 字符串)。
创建电子表格
bash
curl -X POST https://api.mila.gg/v1/sheets \
-H Authorization: Bearer milaskyourkeyhere \
-H Content-Type: application/json \
-d {title: 预算, cells: {A1: {value: 项目}, B1: {value: 成本}, A2: {value: 托管}, B2: {value: 99}}}
MCP 工具:create_sheet,参数为 title 和 cells(A1 表示法对象)。
创建演示文稿
bash
curl -X POST https://api.mila.gg/v1/slides \
-H Authorization: Bearer milaskyourkeyhere \
-H Content-Type: application/json \
-d {title: 演示, data: [{html:
你好
, background: #ffffff, notes: 标题幻灯片}]}
MCP 工具:createslidepresentation,参数为 title 和 data(幻灯片对象数组)。
API 约定
ID
所有资源 ID 都是不透明字符串(例如 xK9mP2wQ)。在 URL 和参数中直接使用它们。
分页
列表端点接受 limit(1-100,默认 50)和 offset(默认 0)。响应包含一个 pagination 对象:
json
{
data: [...],
pagination: { total: 42, limit: 50, offset: 0 }
}
排序
列表端点接受 sort(createdat、updatedat、lasteditedat、title)和 order(asc、desc)。
服务器过滤
内容可以属于服务器(工作区)或个人文件。
- - 省略 serverid:返回所有内容
- serverid=personal:仅返回个人文件
- server_id=:返回该服务器中的内容
创建内容时,在请求体中传递 server_id 以将其放入服务器。个人文件则省略。
响应格式
所有响应使用此结构:
json
{
success: true,
data: { ... }
}
错误返回:
json
{
success: false,
error: { message: 错误描述 }
}
内容格式
- - 文档:HTML 字符串(标题、段落、列表、表格、图片、链接)。