Docfarm
Publish, edit, share and track HTML docs and decks from chat, with view analytics.
我该使用它吗
质量与安全性
发现(5)
- HIGH
- MEDIUM在 get_doc_html 中
- LOW在 get_upload_url 中
- LOW在 get_doc_url 中
- INFO在 get_doc_html 中
基于对工具定义和协议合规性的自动分析。
上下文开销
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"docfarm": {
"url": "https://mcp.doc.farm/mcp"
}
}
}远程端点
https://mcp.doc.farm/mcpstreamable-http它能做什么
工具清单
工具(21)
🟢whats_possible
Show a grouped overview of everything docfarm can do for the user — reading, editing, sharing, tracking, drafting follow-ups, and collaborating. Call this when the user asks 'what can you do?', 'what does docfarm do?', 'show me what's possible', 'help', or similar capability questions. Cheap and self-contained — no doc lookup needed.
输入模式
{
"type": "object",
"properties": {},
"additionalProperties": false
}🟢get_skills(id, query)
Load a Docfarm skill, written instructions for a task that you then follow. docfarm/onboarding is the short tour for someone who has just connected Docfarm. Pass `id` (one id, or an array) for the full skill, `query` to search by keyword, or nothing to list every skill by name and description. When the person asks to use a Docfarm skill by name, call this with that id first.
输入模式
{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
],
"description": "One skill id such as \"docfarm/onboarding\", or several. Returns the full skill."
},
"query": {
"type": "string",
"description": "What the task is about, in plain words. Ignored when id is set."
}
},
"additionalProperties": false
}🟢get_build_brief(doc_name, account)
READ THIS FIRST, before writing a single line of HTML for this user. Returns the docfarm house standard (how to pick the page archetype, type scale, spacing, logo rules, motion, budgets and language rules) plus this user's own brand: their colours, their typefaces, and asset tokens for their real logo and any font file they own. About 3,000 tokens and it is the difference between a page that looks like their company and a generic template. Write any asset token verbatim where the file goes (e.g. <img src="DF_ASSET_LOGO_1">), then pass the same doc name as `brand_from` on host_html_content and docfarm swaps in the real bytes. Never paste base64 yourself: the token is smaller, exact and free. Every page published to docfarm is scored against this standard on the way in, so reading it first is how you score well the first time instead of fixing afterwards.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Optional. The doc to read the brand from (fuzzy-matched). Omit and docfarm picks the most recent doc in the farm that carries a logo."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🟢list_docs(account)
List the user's docs: first the ones they own, each with its share link, then the ones other people shared with them and how an edit to each behaves (overwrites the original, or makes the user's own copy).
输入模式
{
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🟢get_doc_status(doc_name, slug, account)
Who read a doc and how. Returns the share link, total and unique views, average reading time, when it was last opened, and the ten most recent viewers with their time, pages and whether they read to the end. Use it for 'who saw it', 'how is it doing', 'what is the link', and as the material for a follow-up email that refers to what each person actually read. Owner only; viewer data stays with the doc's owner. Identify the doc via doc_name (fuzzy-matched) or slug.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc (fuzzy-matched). Pass this or slug."
},
"slug": {
"type": "string",
"description": "The doc's slug or share URL."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🔴update_doc_settings(doc_name, slug, title, password_on, password_value, ...)
Change a doc the user OWNS: password protection (password_on / password_value), ask viewers for their email before viewing (ask_name), allow file downloads (allow_downloads), view notifications for the owner (notify), and the doc's title (title). Only the fields you pass are changed. Renaming changes the display title only; the share link and slug never change, so links already sent keep working. Identify the doc via doc_name (fuzzy-matched) or slug.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc (fuzzy-matched). Pass this or slug."
},
"slug": {
"type": "string",
"description": "The doc's slug or share URL."
},
"title": {
"type": "string",
"description": "A new title for the doc (max 500 chars). The link stays the same."
},
"password_on": {
"type": "boolean",
"description": "Require a password to view."
},
"password_value": {
"type": "string",
"description": "The password. Setting this also turns password_on on."
},
"ask_name": {
"type": "boolean",
"description": "Ask each viewer for their email before showing the doc. Despite the field name it asks for an email, not a name."
},
"allow_downloads": {
"type": "boolean",
"description": "Let viewers download the original file."
},
"notify": {
"type": "boolean",
"description": "Notify the owner on views."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🔴delete_doc(doc_name, slug, account)
Permanently delete a doc the user OWNS — removes the document, its share link(s), all view/analytics data, chat, comments, suggestions, collaborators, and the stored file. IRREVERSIBLE. Only the owner can delete. Confirm with the user before calling if there's any ambiguity. Identify the doc via `doc_name` (fuzzy-matched) or `slug`.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc to delete."
},
"slug": {
"type": "string",
"description": "Share-link slug or full URL. Alternative to doc_name."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🔴invite_collaborator(doc_name, slug, email, allow_overwrite, account)
Invite someone to collaborate on a doc the user OWNS, by email, so it lands in their docfarm. If they're already a docfarm user the doc appears in their farm immediately; if not, they get an invite email with a signup link. REQUIRES the collaborator's `email` AND `allow_overwrite` (true = their edits overwrite the original; false = their edits fork into a copy they own, auto-shared back to the inviter). If you don't have the email, ask for it. If the user hasn't said whether the person should edit directly or only make a copy, ask before calling — don't guess. Identify the doc via `doc_name` (fuzzy-matched) or `slug`.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc to share."
},
"slug": {
"type": "string",
"description": "Share-link slug or full URL. Alternative to doc_name."
},
"email": {
"type": "string",
"description": "Email address of the person to invite."
},
"allow_overwrite": {
"type": "boolean",
"description": "true = collaborator's edits overwrite the original; false = edits fork into a copy they own (auto-shared back to the inviter)."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"email",
"allow_overwrite"
],
"additionalProperties": false
}🔴host_html_content(html, name, replace, brand_from, account)
Host an HTML doc on docfarm and return its share link. A name that exactly matches an existing doc's title, ignoring case and surrounding spaces, overwrites that doc in place, keeping its share link, password, and view stats, so anyone holding the URL sees the new version. Any other name creates a new doc. A similar but different name, such as "Pricing" next to "Pricing final", also creates a new doc and leaves the other one untouched, and the response names that doc so you can offer to update it instead. To update a doc, reuse its exact title. Takes the HTML inline, so it works in any environment. For a small change to an existing doc, `get_doc_html` + `patch_doc` sends far less content. Every page is scored against the docfarm house standard on the way in and the score comes back in the response; call `get_build_brief` BEFORE you write the HTML so you meet the standard first time rather than fixing afterwards.
输入模式
{
"type": "object",
"properties": {
"html": {
"type": "string",
"description": "Full HTML body"
},
"name": {
"type": "string",
"description": "Page name. To update a doc, reuse its exact title, which keeps the share link. A new or merely similar name creates a new doc."
},
"replace": {
"type": "boolean",
"description": "Omit normally. Set false to publish a new doc even when the name exactly matches an existing one, which gets a new share link. Set true only when the person asked to replace a doc and you do not have its exact title. It then also overwrites the one doc with a similar name, such as \"Pricing v2\" for \"Pricing\", and publishes nothing when no doc or several docs match."
},
"brand_from": {
"type": "string",
"description": "Optional. Name of an existing HTML doc in this farm whose brand assets this page uses. Required for any DF_ASSET_ token you wrote to resolve to real bytes. Get the tokens from get_build_brief first, then pass the same doc name here."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"html",
"name"
],
"additionalProperties": false
}🟡duplicate_doc(doc_name, slug, new_name, account)
Server-side copy of any HTML doc the user can read (their own OR shared with them) into their own farm under a new name. THE fast path for building a modified version of an existing doc: content never passes through your context — duplicate in ~1s, then use patch_doc for the differences. Vastly faster than get_doc_html + re-hosting.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Source doc name (fuzzy-matched)."
},
"slug": {
"type": "string",
"description": "Source share-link slug or full URL. Alternative to doc_name."
},
"new_name": {
"type": "string",
"description": "Name for the copy in the user's farm."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"new_name"
],
"additionalProperties": false
}🟡get_upload_url(account)
Step 1 of 2 for hosting a large HTML file that is already on disk, without sending its bytes through the model's context. Returns a short-lived signed upload URL; upload the file to it with a direct HTTP PUT (Content-Type: text/html), then call `finalize_upload` with the returned upload_path and a doc name. Requires a shell and unrestricted outbound HTTP, so the PUT will not succeed where outbound network access is restricted; `host_html_content` accepts the HTML inline and works in any environment.
输入模式
{
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [],
"additionalProperties": false
}🔴finalize_upload(name, upload_path, account)
FAST PATH step 2/2: after PUTting the file to the signed URL from `get_upload_url`, call this to publish. NEW name → new doc + share link. Name matching an EXISTING HTML doc → updated in place, same share link. Verifies the uploaded object exists before publishing.
输入模式
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Doc name — same rules as host_html_content (existing name = in-place update)."
},
"upload_path": {
"type": "string",
"description": "The upload_path value returned by get_upload_url."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"name",
"upload_path"
],
"additionalProperties": false
}🟢get_doc_html(doc_name, slug, offset, max_chars, strip_data_uris, ...)
Read the current HTML body of any docfarm HTML doc the user has access to — their own docs OR docs other people have shared with them (as collaborator or via share link). Returns title, share URL, the caller's role (owner / collaborator / reader), and the full HTML. ESSENTIAL precursor to `patch_doc`: call this first whenever the user asks for any change to a doc you don't have in context, so you can see what's there and construct accurate before/after snippets. Pass `doc_name` (easiest, fuzzy-matched) or `slug`. Embedded base64 images are stripped to placeholders by default (huge docs become readable in one call), so hosting a stripped copy back would drop those images from the doc; edit via patch_doc, or re-fetch with strip_data_uris: false for the byte-exact original. Large docs page via offset/max_chars — the response tells you the offset for the next slice.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Doc name. Fuzzy-matched against the caller's own docs first, then docs they collaborate on."
},
"slug": {
"type": "string",
"description": "Share-link slug or full URL. Alternative to doc_name."
},
"offset": {
"type": "number",
"description": "Character offset to start reading from (default 0). Use the value from the previous response's continuation note."
},
"max_chars": {
"type": "number",
"description": "Max characters to return per call (default 200000, max 500000)."
},
"strip_data_uris": {
"type": "boolean",
"description": "Default true: base64 data URIs ≥1KB are replaced with short placeholders so content isn't crowded out by embedded images. Pass false for the byte-exact original."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🟢get_doc_url(doc_name, slug, ttl_seconds, download_filename, account)
Get a time-limited signed URL that downloads the raw file of any doc the user has access to — HTML, PDF, Markdown, anything stored on docfarm. Use this when you need to hand the file off to another tool or LLM, when the user asks for a download link, or when the doc isn't HTML (where get_doc_html doesn't apply). URL expires after `ttl_seconds` (default 3600, max 86400).
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string"
},
"slug": {
"type": "string"
},
"ttl_seconds": {
"type": "number",
"description": "Lifetime of the signed URL in seconds. Default 3600 (1h), max 86400 (24h)."
},
"download_filename": {
"type": "string",
"description": "If set, the URL forces a file download with this filename (Content-Disposition: attachment)."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🔴patch_doc(doc_name, slug, before_snippet, after_snippet, occurrence_index, ...)
Edit an existing hosted doc by replacing a snippet of its HTML. DEFAULT TOOL for ANY edit to a doc the user already has — typo, copy change, restyle, new section, anything. ~50 tokens instead of ~7000 for re-hosting. Workflow: (1) if you don't have the current HTML in context, call `get_doc_html` first to read it. (2) construct `before_snippet` as a unique chunk of the existing HTML and `after_snippet` as its replacement. Pass EITHER `doc_name` (easiest) OR `slug`. Ambiguous match → fails with context for each candidate. Preserves share link, password, view counts, comments. Patching sends only the changed snippet, so it costs far less than re-sending a whole doc. For several edits at once ("fix the typo AND change the CTA AND update the date") pass a `patches` array instead of before/after: all of them land atomically or none do, each validated after the previous one applied.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc to edit (same name you passed to host_html_content). Use this if you don't have the slug."
},
"slug": {
"type": "string",
"description": "Share-link slug or full URL. Alternative to doc_name."
},
"before_snippet": {
"type": "string",
"description": "Exact text to find (must be unique unless occurrence_index given). For a single edit."
},
"after_snippet": {
"type": "string",
"description": "Replacement text. For a single edit."
},
"occurrence_index": {
"type": "number",
"description": "0-based index of which match to replace when before_snippet isn't unique"
},
"patches": {
"type": "array",
"description": "Several edits applied atomically. Use this OR before_snippet/after_snippet.",
"items": {
"type": "object",
"properties": {
"before_snippet": {
"type": "string"
},
"after_snippet": {
"type": "string"
},
"occurrence_index": {
"type": "number"
}
},
"required": [
"before_snippet",
"after_snippet"
],
"additionalProperties": false
}
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}⚪rebuild_doc(doc_name, slug, brand_from, account)
Rebuild a PDF or PowerPoint the user already has on docfarm into a live HTML page built to the house standard, keeping every fact and reorganising the layout so it reads on a phone. This is the retrofit: it does NOT reproduce the original layout, it rewrites the document into one of four archetypes. Takes about three minutes, so this tool STARTS the rebuild and returns immediately with a rebuild_id. Tell the user it is building, then call `check_rebuild` to collect it. PDF and PowerPoint only today. Before you start, ask the user whether they have another doc in their farm whose brand this should match, and pass it as `brand_from`. It is one question and it is the difference between their brand and a generic page, because an HTML doc in their farm usually carries the real logo file and sometimes the real typeface. Do not ask them how it should look: the shape of the page is decided from what the document is for.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the PDF or PowerPoint doc to rebuild (fuzzy-matched)."
},
"slug": {
"type": "string",
"description": "Share-link slug or full URL. Alternative to doc_name."
},
"brand_from": {
"type": "string",
"description": "Optional. Name of another HTML doc in the same farm to take brand assets from: its colours, its logo, and any typeface it embeds. Ask the user whether they have one before rebuilding, because it is the difference between a page that looks like their brand and a page that looks generic. Assets ONLY. It never copies the reference doc's layout, orientation or how interactive it is, which are decided from what this document is for."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🔴check_rebuild(rebuild_id, name, account)
Check a rebuild started by `rebuild_doc` and publish it when it is done. Returns the current stage while it is still building, so call it again after a pause. When the rebuild has finished this publishes it as a new HTML doc in the user's farm and returns the share link and the quality scores. Safe to call repeatedly: publishing twice returns the same doc.
输入模式
{
"type": "object",
"properties": {
"rebuild_id": {
"type": "string",
"description": "The rebuild_id returned by rebuild_doc."
},
"name": {
"type": "string",
"description": "Name for the rebuilt doc. Defaults to the original's name."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"rebuild_id"
],
"additionalProperties": false
}🟢show_doc(doc_name, slug, account)
Open a doc inside the chat as a live view of the page. In hosts that render MCP Apps (claude.ai, Claude Desktop, Claude mobile) the doc appears in the conversation; the person can read it, switch on Edit text, click any heading or paragraph, retype it and save, and the share link shows the change at once. Call it when they ask to see, preview, check or hand-edit a doc, and whenever they paste a doc.farm link into the conversation: open it with show_doc first, then answer. host_html_content, patch_doc and duplicate_doc already show this view after they run, so do not call show_doc straight after them. Text-only hosts get the share link.
输入模式
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "Name of the doc (fuzzy-matched). Pass this or slug."
},
"slug": {
"type": "string",
"description": "The doc's slug or share URL."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"additionalProperties": false
}🟢app_read_doc(slug, account)
Used by the docfarm doc view inside the chat, not by the assistant. Returns a doc's HTML annotated for in-place text editing plus a content revision. Assistants read docs with get_doc_html instead.
输入模式
{
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "The doc's slug."
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"slug"
],
"additionalProperties": false
}🔴app_apply_edits(slug, rev, edits, account)
Used by the docfarm doc view inside the chat, not by the assistant. Saves text the person retyped in the view as exact edits of the stored HTML, guarded by the revision app_read_doc returned. Assistants edit docs with patch_doc instead.
输入模式
{
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "The doc's slug."
},
"rev": {
"type": "string",
"description": "The rev app_read_doc returned for the bytes being edited."
},
"edits": {
"type": "array",
"items": {
"type": "object",
"properties": {
"loc": {
"type": "string"
},
"html": {
"type": "string"
}
},
"required": [
"loc",
"html"
],
"additionalProperties": false
}
},
"account": {
"type": "string",
"description": "Email address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which."
}
},
"required": [
"slug",
"rev",
"edits"
],
"additionalProperties": false
}🟢list_accounts
List the farms this connection can reach: the signed-in account, plus the connected account when the person has one (docfarm's work/personal split, two separate farms held by one person). Call this FIRST whenever a request could concern either farm, or when the person says "my personal", "my work", "my other account", or names an address that is not the signed-in one. Then pass `account` on the tool you actually want. Docs, links, viewers and analytics never mix between the two.
输入模式
{
"type": "object",
"properties": {},
"additionalProperties": false
}社区
证据