# MCP Server — Quick Start

# MCP Server — Quick Start

## What is MCP?

MCP (Model Context Protocol) lets AI tools like Claude call external APIs. The mdfy MCP server gives Claude the ability to create, read, update, and manage documents on mdfy.cc.

## Setup

### Option A: Hosted HTTP MCP (recommended)

For **Claude Web** (claude.ai), **Cursor**, **Windsurf**:

1. Go to Settings → Integrations / MCP
2. Add server URL: `https://mdfy.cc/api/mcp`
3. Done — 25 tools available immediately

### Option B: Local stdio MCP

For **Claude Code** and **Claude Desktop**:

```bash
# 1. Install and login (one-time)
npx mdfy-cli login

# 2. Add to .mcp.json (project root)
```

```json
{
  "mcpServers": {
    "mdfy": {
      "command": "npx",
      "args": ["mdfy-mcp"]
    }
  }
}
```

No API keys needed. Authentication via `mdfy login`.

## Usage Examples

### Create a document

```
You: "Publish my meeting notes to mdfy"

Claude: I'll create the document now.
  → mdfy_create({ markdown: "# Meeting Notes..." })

Document created:
  URL: https://mdfy.cc/d/abc123
  Status: publicly accessible
```

### Read a document

```
You: "Read the document at mdfy.cc/d/abc123"

Claude:
  → mdfy_read({ id: "abc123" })
  
Here's the content:
# Meeting Notes
...
```

### Update a document

```
You: "Add a summary section to my doc"

Claude:
  → mdfy_read({ id: "abc123" })
  → mdfy_update({ id: "abc123", markdown: "# Meeting Notes\n\n## Summary\n..." })

Document updated. Same URL: https://mdfy.cc/d/abc123
```

### List your documents

```
You: "Show me my mdfy documents"

Claude:
  → mdfy_list()

Found 8 documents:
1. Meeting Notes (abc123) — shared — 12 views
2. API Design (def456) — private — 3 views
...
```

### Make private / public

```
You: "Make that document private"

Claude:
  → mdfy_publish({ id: "abc123", published: false })

Document is now private (draft).
```

### Cross-AI workflow

```
You (in Claude): "Summarize mdfy.cc/d/abc123"
Claude: → reads the document → provides summary

You (in ChatGPT): "Read mdfy.cc/d/abc123 and suggest improvements"
ChatGPT: fetches the URL → gives feedback

You (in Claude): "Update mdfy.cc/d/abc123 with the improvements"
Claude: → mdfy_update → same URL, updated content
```

## Available Tools

### Core (6 tools — local stdio package)

| Tool | Description |
|------|-------------|
| `mdfy_create` | Create document, get URL |
| `mdfy_read` | Read document content |
| `mdfy_update` | Update document |
| `mdfy_list` | List your documents |
| `mdfy_publish` | Toggle public/private |
| `mdfy_delete` | Delete document |

### Extended (25 tools — hosted HTTP MCP)

Append/prepend, sections (outline, extract, replace), duplicate, import URL, password protection, expiry, email restrictions, version history, diff, stats, folders, and more.