Skip to content

MCP Server Overview

papersmith includes a built-in Model Context Protocol (MCP) server that exposes 25+ document generation tools to LLM clients like Claude Desktop and Cursor.

What is MCP?

MCP is an open protocol that lets AI assistants use external tools. Instead of generating code that describes a document, the AI can directly call papersmith tools to create the document.

How It Works

sequenceDiagram
    participant User
    participant Claude as Claude Desktop
    participant MCP as papersmith MCP Server
    participant FS as Filesystem

    User->>Claude: "Create a research paper about sorting algorithms"
    Claude->>MCP: create_document(preset="academic")
    MCP-->>Claude: doc_id="doc_1"
    Claude->>MCP: add_heading(doc_id, "Introduction", level=1)
    Claude->>MCP: add_text(doc_id, "Sorting algorithms are...")
    Claude->>MCP: add_equation(doc_id, "O(n \\log n)")
    Claude->>MCP: save_document(doc_id, "sorting.docx")
    MCP->>FS: Write sorting.docx
    MCP-->>Claude: "Success: saved to ~/Documents/sorting.docx"
    Claude-->>User: "Done! Your paper is saved."

Available Tools

The MCP server exposes these tool categories:

Category Tools
Session create_document, open_document, list_documents
Content add_heading, add_text, add_equation, add_table, add_code_block
Structure add_cover_page, add_page_break, add_toc, add_numbered_list, add_bullet_list
Layout set_header, set_footer, add_page_numbers
Metadata set_metadata, find_replace, get_outline
Export save_document, export_pdf, get_document_base64

Next Steps