Docmost MCP
Use this skill when a user asks a question that should be answered from Docmost knowledge base content, or when the user explicitly mentions Docmost MCP.
Preconditions
Docmost MCP must already be configured in the local MCP client.
If setup is the current task, configure the MCP server first, then verify it before answering that setup is complete.
Expected server:
docmost
Expected endpoint for OfferCore:
https://docmost.offercore.ru/mcp
For another Docmost instance, use that instance's /mcp endpoint.
Expected transport:
Streamable HTTP
Expected token format:
dcmcp_...
Do not ask the user for the token unless setup or authentication is the current task. Prefer client settings, secret storage, or local MCP config over pasting tokens into chat. Never print a full token in chat, logs, docs, diffs, or examples.
If the server is configured under a different name, either use that available server name if the client exposes it clearly, or tell the user to rename it to docmost for this skill.
Tool scope
Docmost MCP is read-only.
Allowed tools:
get_relevant_contextsearch_pagesget_pagelist_spaceslist_child_pagesget_mcp_context
Do not expect write, delete, admin, database, cookie, or browser-session access through MCP.
If the user asks to create, edit, delete, publish, invite users, change permissions, or perform admin work, explain that this MCP server cannot do that and ask for an appropriate write/admin workflow instead.
Do not fall back to browser sessions, cookies, direct database access, write APIs, admin panels, or local exports unless the user explicitly asks for that separate workflow.
Default workflow
- Search with
search_pagesusing the user's question. - If the first search is weak, rewrite the query with domain terms and search again.
- Select 2 to 5 relevant pages.
- Read selected pages with
get_page. - Answer only from retrieved content unless clearly labeled as general knowledge.
- Cite sources with
sourceUrllinks at the end.
If the answer needs one exact article and search returns a clear match, reading one page is enough.
For setup verification, use list_spaces or a small search_pages query such as трудоустройство. Do not read unrelated pages just to prove the connection works.
Screenshot/image/attachment workflow
When a query depends on media or file attachments, keep the answer flow MCP-first:
- Call
get_pageon the candidate page(s) to get markdown content. - Extract all markdown link URLs (no file-extension filtering):
image links are treated as image candidates[...](...)regular links are treated as attachment candidates by context
- Filter candidates by context and scheme:
- allow only URLs that are either:
- root-relative
/api/files...paths, rewritten tohttps://docmost.offercore.ru/api/files... - absolute
https://...URLs
- root-relative
- reject anything else (relative paths, protocol-relative URLs, http, data:, blob:, mailto:, etc.).
- allow only URLs that are either:
- Download each candidate with curl in a dedicated temp directory from
mktemp -d:- create a per-page temp directory and temp files for metadata and stderr.
- use only curl flags like:
--fail --location --silent --show-error --output <path> --max-filesize 52428800 --proto '=https' --proto-redir '=https' - write HTTP/content-type/size metadata into a temp metadata file and curl stderr into a temp error file.
- capture curl exit code immediately after the command.
- example:
curl --fail --location --silent --show-error --output "$file_path" --max-filesize 52428800 --proto '=https' --proto-redir '=https' --write-out '%{http_code} %{content_type} %{size_download}\n' "$attachment_url" >"$meta_file" 2>"$err_file" - do not attach
Authorization,Cookie, dcmcp token headers, or any other credentials when fetching attachments.
- Classify outcomes:
- parse the HTTP status from metadata, then take exactly one terminal branch:
- if the status is
401or403, ask the user to attach/upload the file directly in chat and stop processing that attachment. - else if the status is any other non-success HTTP status, report the exact status without guessing and stop processing that attachment.
- else if the status is successful but curl exit code is non-zero, report a transfer failure (for example, a truncated transfer), check
$err_file, and stop processing that attachment. - else if there is no usable HTTP status and curl exit code is non-zero, report a transport/TLS error, check
$err_file, and stop processing that attachment. - else proceed to MIME/size checks only when the HTTP status is successful and curl exit code is zero.
- if the status is
- parse the HTTP status from metadata, then take exactly one terminal branch:
- Reject the download if any condition holds:
- HTTP status is not successful,
- MIME type is not one of
image/*,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document(DOCX),audio/*,video/*, - size exceeds 50 MiB by curl limit or post-download byte check.
- Analyze attachment content:
- for images, use visual analysis directly from fetched file.
- for PDF/DOCX/audio/video, use matching available skill/tool in the environment.
- Cite evidence from both the parent page
sourceUrland the attachment filename in the final response.
Do not use browser sessions for attachments. Do not print tokens, cookies, auth headers, or request credentials.
If an attachment URL request returns:
401/403: report inability to fetch due to access and ask the user to upload/attach the file directly in chat.- Any other error: report the exact status/code from the response without inferring root cause.
Always remove the exact temp directory created for the page after processing, including on failure paths.
Source handling
Prefer direct page evidence over broad summaries.
When sources disagree, say so and cite both pages.
If Docmost does not contain enough information, say what is missing. Do not invent missing policy, process, pricing, student guidance, internal decisions, or operational details.
Search tips
Use the user's words first.
If needed, add synonyms, product names, team names, or Russian and English variants.
For broad questions, call list_spaces before searching and restrict search to the most relevant space if the MCP tool supports it.
Error handling
401 Unauthorized
Tell the user the MCP token is missing, invalid, expired, revoked, or copied incorrectly. Ask them to create a new dcmcp_... token if needed.
403 Forbidden
Tell the user MCP may be disabled, the user may not have access, or the token space scope may exclude the page.
429 Too Many Requests
Slow down. Retry only if the client workflow allows it. If rate limiting continues, tell the user the server limit needs adjustment.
No relevant pages
Try one narrower search and one broader search. If both fail, answer that Docmost did not return a relevant source and state the searches you tried.
MCP tools not visible
Tell the user the MCP client has not loaded the docmost server. Ask them to check the server name, endpoint, transport, authorization header, and then restart or refresh the MCP client.
Output format
Keep answers concise.
End with sources when Docmost content was used:
Sources:
- https://docmost.offercore.ru/s/.../p/...
- https://docmost.offercore.ru/s/.../p/...
Do not cite pages that were not read with get_page.