skip to content
$cat mcp/README.md

> MCP server.

A Model Context Protocol server for MDflow. It lets MCP-capable agents pull markdown documents from your workspace, use folder descriptions as context, manage workspaces, folders, and documents you own, and control public and private sharing. Two ways to connect: the hosted remote server at https://mdflow.cz/api/mcp, or a local server that runs on your machine over stdio. The hosted server accepts an OAuth sign-in — Claude connects in one click from its Connectors Directory and ChatGPT by pasting the URL, with no token to copy — or a Personal Access Token; the local server uses a Personal Access Token. Both expose the same tools, except the local server adds one auth-setup helper (mdflow_auth_help). Working in a Team account? Its shared workspaces have their own Team MCP server.

$ls tools/

What it exposes

ToolWhat it does
mdflow_auth_helpShows token setup instructions (does not require a token). Local stdio server only — the hosted remote server is already authenticated.
mdflow_list_foldersLists folders, each with its workspace_id and full path — descriptions are the primary context signal for the documents inside. Optionally filter to one workspace.
mdflow_get_folderGets one folder with its full path and its compounded description — the cascade of descriptions from the workspace down to the folder.
mdflow_create_folderCreates a folder with an optional description. Pass parent_id to nest it under another folder.
mdflow_update_folder_descriptionReplaces a folder description.
mdflow_rename_folderRenames a folder; a duplicate name gets a numeric suffix.
mdflow_delete_folderDeletes a folder and the documents inside it.
mdflow_move_folderReparents a folder: nests it under another folder, or omit parent_id (or pass null) to move it to the top level.
mdflow_list_workspacesLists the workspaces you own, each with its name and description.
mdflow_create_workspaceCreates a workspace with an optional description. Duplicate names get a numeric suffix.
mdflow_rename_workspaceRenames a workspace; a duplicate name gets a numeric suffix.
mdflow_update_workspace_descriptionReplaces a workspace's description.
mdflow_delete_workspaceDeletes a workspace and every folder and document inside it. Cannot delete your last workspace.
mdflow_list_documentsLists document metadata, optionally scoped to one folder or workspace; each carries its full path.
mdflow_get_documentFetches one document by ID, including its body, full path, and compounded description.
mdflow_create_documentCreates a document inside an existing folder.
mdflow_rename_documentRenames a document; a duplicate title gets a numeric suffix.
mdflow_update_document_bodyReplaces a document's markdown body; clearing it requires explicit confirmEmpty=true.
mdflow_move_documentMoves a document to another folder.
mdflow_update_document_sharingTurns public sharing and comments on or off.
mdflow_delete_documentDeletes one document.
mdflow_list_document_sharesLists the people a document is privately shared with, including share IDs and pending/accepted status.
mdflow_add_document_sharePrivately shares a document with a person by email, optionally allowing comments, and returns a private link to give them. No notification email is sent.
mdflow_revoke_document_shareRevokes one person's private access to a document.
mdflow_revoke_all_document_sharesRevokes private access to a document for everyone it is shared with.
mdflow_get_contextFinds topic context by ranking folder descriptions first, then titles, then fetching the best-matching markdown bodies. When a topic clearly belongs to one workspace, pick the best-matching workspace first and pass workspaceId to scope retrieval there; omit it for broad or ambiguous topics to rank across the whole account.

Parameters use camelCase, but snake_case aliases are also accepted — e.g. mdflow_get_document takes both documentId and document_id.

$open https://mdflow.cz/api/mcp

Connect Claude or ChatGPT

Claude and the ChatGPT app connect to the hosted server with no token to copy — you sign in and MDflow issues the access token for you.

Connect Claude in one click

MDflow is in Claude's Connectors Directory. Click Connect to Claude and sign in to MDflow — no URL to paste, no token to create. One connection works in claude.ai, the desktop and mobile apps, and Claude Code. Requires MDflow Pro.

ChatGPT adds https://mdflow.cz/api/mcp as a custom connector:

  1. 1.In ChatGPT, open the connector settings and add a custom connector.
  2. 2.Paste https://mdflow.cz/api/mcp as the URL and click connect.
  3. 3.MDflow's sign-in and consent screen opens. Approve it, and the connector is ready — the mdflow tools appear in the client.

Behind the scenes the client discovers the authorization server from /.well-known/oauth-protected-resource (RFC 9728), registers itself (Dynamic Client Registration), and receives an OAuth access token — nothing is pasted by hand. OAuth needs an MDflow Pro account, the same as a Personal Access Token (ChatGPT's sign-in is in beta). Prefer a token, or connecting a client that sends its own Authorization header? Use the Personal Access Token setup below.

$curl https://mdflow.cz/api/mcp

Configure hosted remote server

Clients that send their own Authorization header — Cursor and the OpenAI Responses API — authenticate the hosted server at https://mdflow.cz/api/mcp with a Personal Access Token instead of the OAuth sign-in above. For Claude Code and Claude Desktop the token configs below are the legacy path; the Claude connector needs no token. It runs over the MCP Streamable HTTP transport and is always up to date. Create a Personal Access Token first; it starts with mdf_.

Claude Code (legacy — Personal Access Token)one command, applies to the current project
$bash
claude mcp add --transport http mdflow https://mdflow.cz/api/mcp \
  --header "Authorization: Bearer mdf_your_token_here"
Claude Desktop config (legacy — via mcp-remote)Settings → Developer → Edit Config · requires Node.js
$json
{
  "mcpServers": {
    "mdflow": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mdflow.cz/api/mcp",
        "--header",
        "Authorization:Bearer mdf_your_token_here"
      ]
    }
  }
}
Cursornative Streamable HTTP · ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project)
$json
{
  "mcpServers": {
    "mdflow": {
      "url": "https://mdflow.cz/api/mcp",
      "headers": { "Authorization": "Bearer mdf_your_token_here" }
    }
  }
}
OpenAI Responses APIPOST https://api.openai.com/v1/responses — remote MCP tool
$json
{
  "model": "gpt-5.2",
  "tools": [
    {
      "type": "mcp",
      "server_label": "mdflow",
      "server_url": "https://mdflow.cz/api/mcp",
      "headers": { "Authorization": "Bearer mdf_your_token_here" }
    }
  ],
  "input": "Get information about onboarding from mdflow."
}
Security: the token belongs in your client configuration, never in chat prompts or tool arguments. Requests without a valid token receive 401 with a WWW-Authenticate challenge. Tokens grant workspace-level access, including write, delete, and sharing operations, and require an MDflow Pro account.

For agents: the server is stateless — no session IDs, plain JSON responses, one POST per JSON-RPC message. Rate limit is 60 requests per minute per token; 429 responses carry Retry-After in seconds. The same API is also available as REST — see the API reference and OpenAPI spec.

$node --version

Local server — prerequisites

Prefer a process on your own machine? The local stdio server exposes the same tools and talks to the same API.

  • ›Node.js 18+ — the server relies on the built-in fetch.
  • ›A terminal with npm.
  • ›An MDflow Personal Access Token (created in step 3).
$./install

Local server — install

1

Download the server

Grab the files into a fresh folder.

$bash
mkdir mdflow-mcp && cd mdflow-mcp
curl -O https://mdflow.cz/mcp/server.mjs
curl -O https://mdflow.cz/mcp/package.json
curl -O https://mdflow.cz/mcp/README.md
2

Install dependencies

$bash
npm install

Pulls in @modelcontextprotocol/sdk and zod.

3

Create a Personal Access Token

Sign in to MDflow, open Settings, and create a token. It starts with mdf_. Copy it now — you won't see it again.

Security: never paste your token into a chat prompt or tool argument. It belongs only in your MCP client config (next step). The server deliberately refuses to accept the token as a tool parameter. Tokens grant workspace-level API access, including write and delete operations.
4

Wire it into your MCP client

Point your client at the absolute path of server.mjs. Run pwd inside the mdflow-mcp folder to get it, then replace /absolute/path/to/… below.

Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS) · %APPDATA%\\Claude\\claude_desktop_config.json (Windows)
$json
{
  "mcpServers": {
    "mdflow": {
      "command": "node",
      "args": ["/absolute/path/to/mdflow-mcp/server.mjs"],
      "env": {
        "MDFLOW_API_TOKEN": "mdf_your_token_here"
      }
    }
  }
}
Codex~/.codex/config.toml
$toml
[mcp_servers.mdflow]
command = "node"
args = ["/absolute/path/to/mdflow-mcp/server.mjs"]
env = { MDFLOW_API_TOKEN = "mdf_your_token_here" }
Cursor~/.cursor/mcp.json (global) or .cursor/mcp.json (per project)
$json
{
  "mcpServers": {
    "mdflow": {
      "command": "node",
      "args": ["/absolute/path/to/mdflow-mcp/server.mjs"],
      "env": { "MDFLOW_API_TOKEN": "mdf_your_token_here" }
    }
  }
}
5

Restart your client and try it

Restart the app so it picks up the config, then ask:

>Get information about onboarding from mdflow.
>Use mdflow to get context about my API documentation.
>Create a document called meeting-notes.md in my project folder.
>Update my project folder description in mdflow.
$env | grep MDFLOW

Local server — environment variables

VariableRequiredDefaultPurpose
MDFLOW_API_TOKENYes—Personal Access Token, usually starting with mdf_. MDFLOW_PAT is accepted as an alias.
MDFLOW_API_BASE_URLNohttps://mdflow.czOverride to point at local dev, e.g. http://localhost:3000.
$man mdflow_get_context

How get_context ranks results

mdflow_get_context is the main agent-facing tool. Given a topic it:

  1. 1.Lists folders and documents.
  2. 2.Scores folder descriptions highest — they define the intended context for the files they contain.
  3. 3.Scores folder names and document titles.
  4. 4.Fetches only the selected document bodies.
  5. 5.Returns a readable markdown context block plus structured data.

Defaults to 5 documents, each truncated to 12,000 characters. Callers can request up to 10 documents, or between 500 and 50,000 characters per document.

$curl https://mdflow.cz/api/team/mcp

Team MCP server

An MDflow Team account is a shared tenant with its own members, roles, workspaces, folders, and markdown documents, separate from any member's personal workspaces. It has its own hosted MCP server at https://mdflow.cz/api/team/mcp — the same Streamable HTTP transport as the personal server, stateless, one POST per JSON-RPC message — with 16 mdflow_team_* tools. Personal tokens are rejected here, and Team tokens are rejected on the personal server.

Team access tokens

Any member creates a named token on the Team's API Access page (/teams/<accountId>/api-access). It starts with mdt_ and is shown once. A token is bound to one Team account, granted only the workspaces picked when it was created, and capped at read-only or read-and-write. Every request re-checks the creator's live membership, role, and per-workspace permission and the Team account's state: a read cap can never write, a write token writes only where its creator currently has write access and the account is active, and removing a member deletes their tokens. Eligibility comes from the Team seat — no MDflow Pro is needed. Every write is attributed to the creator in the Team audit feed.

What it exposes

ToolWhat it does
mdflow_team_list_workspacesLists the Team workspaces the token can reach, each with its effective access_level (read or write) and the Team account state. Start here.
mdflow_team_list_foldersLists folders across the readable Team workspaces; descriptions are the primary context signal. Optionally filter to one workspace.
mdflow_team_get_folderGets one Team folder with its description, parent, and workspace.
mdflow_team_create_folderCreates a folder in a writable Team workspace. A top-level folder needs workspaceId — MDflow never guesses a workspace; a subfolder inherits its parent's.
mdflow_team_rename_folderRenames a Team folder; a duplicate name gets a numeric suffix.
mdflow_team_update_folder_descriptionReplaces a Team folder's description.
mdflow_team_move_folderReparents a Team folder within its workspace, or pass parentId null for the top level. Folders never move across workspaces.
mdflow_team_delete_folderPermanently deletes a Team folder with every subfolder and document inside it.
mdflow_team_list_documentsLists Team document metadata (no bodies), optionally scoped to one workspace or one folder.
mdflow_team_get_documentFetches one Team document by ID, including its markdown body.
mdflow_team_create_documentCreates a Team document in a folder (folderId) or at a workspace root (workspaceId). Duplicate titles get a numeric suffix.
mdflow_team_rename_documentRetitles a Team document; a duplicate title gets a numeric suffix.
mdflow_team_update_document_bodyReplaces a Team document's entire markdown body; clearing it requires explicit confirmEmpty=true.
mdflow_team_move_documentMoves a Team document to another folder in the same workspace, or to the workspace root with folderId null.
mdflow_team_delete_documentPermanently deletes one Team document.
mdflow_team_get_contextFinds topic context across the readable Team workspaces by ranking folder descriptions first, then names and titles, then fetching the best-matching bodies in one batched request. Pass workspaceId to stay inside one workspace.

Same conventions as the personal tools: camelCase parameters with snake_case aliases, documents up to 500 KiB, folder descriptions up to 5000 characters, automatic numeric suffixes for duplicate names, and mdflow_team_get_context defaults of 5 documents at 12,000 characters each. Documents can live at a workspace root (folderId null), and creating a top-level folder or root document requires an explicit workspaceId. There is no sharing tool set — Team sharing is managed in the app.

Connect a client

The Team server accepts only Team access tokens today, so it works with clients that send their own Authorization header — Claude Code, Cursor, Codex, the OpenAI Responses API, MCP SDK clients, and Claude Desktop through mcp-remote. The MDflow connector in Claude's directory and the ChatGPT connector reach personal workspaces only; per-user OAuth for Team workspaces is a planned later phase.

Claude Codeone command, applies to the current project
$bash
claude mcp add --transport http mdflow-team https://mdflow.cz/api/team/mcp \
  --header "Authorization: Bearer mdt_your_team_token"
Cursornative Streamable HTTP · ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project)
$json
{
  "mcpServers": {
    "mdflow-team": {
      "url": "https://mdflow.cz/api/team/mcp",
      "headers": { "Authorization": "Bearer mdt_your_team_token" }
    }
  }
}
Claude Desktop (via mcp-remote)Settings → Developer → Edit Config · requires Node.js
$json
{
  "mcpServers": {
    "mdflow-team": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mdflow.cz/api/team/mcp",
        "--header",
        "Authorization:Bearer mdt_your_team_token"
      ]
    }
  }
}
OpenAI Responses APIPOST https://api.openai.com/v1/responses — remote MCP tool
$json
{
  "model": "gpt-5.2",
  "tools": [
    {
      "type": "mcp",
      "server_label": "mdflow_team",
      "server_url": "https://mdflow.cz/api/team/mcp",
      "headers": { "Authorization": "Bearer mdt_your_team_token" }
    }
  ],
  "input": "Summarize our incident playbooks from the mdflow team workspace."
}
Security: a Team token acts as its creator inside the selected workspaces, including delete operations on shared documents. Keep it in the client configuration only, never in prompts or tool arguments, and revoke it from the API Access page if it leaks. Requests without a valid token receive 401 with a WWW-Authenticate: Bearer realm="MDflow Team" challenge.

For agents: rate limit is 60 requests per minute per token, with Retry-After on 429. A 401 means the token is invalid or revoked — tokens also stop working when their creator leaves the team. A 403 means the operation exceeds the token's effective access: the token or the creator's workspace permission is read-only, or the Team account is not active. There is no local stdio variant of the Team server. The tools are HTTP clients over the Team REST API, which is described in the same OpenAPI spec.

$cat NOTES.md

Client compatibility notes

Claude connects through the MDflow connector in its Connectors Directory, and that one connection also serves the Claude desktop and mobile apps and Claude Code. The ChatGPT app connects through its custom-connector picker. Both use an OAuth sign-in — no token (see above). Clients that attach their own Authorization header — Cursor, VS Code, the OpenAI Responses API, and MCP SDK clients — connect with a Personal Access Token, as do the legacy Claude Code and Claude Desktop configs. Claude Desktop's config can reach it through the mcp-remote stdio bridge, which requires Node.js. The local server works with clients that can launch a process — Claude Desktop, Codex, Cursor, and similar.