Skip to main content
Glama

docsmith-mcp

npm version

Python-powered document processing MCP with MCP Apps — Process Excel, Word, PDF, PowerPoint documents with ease using Python, and view them beautifully through an interactive MCP App.

Features

  • Excel: Read/write .xlsx files with sheet support and pagination

  • Word: Read/write .docx files with paragraph and table support

  • PDF: Read .pdf files with text extraction and pagination

  • PowerPoint: Read .pptx files with slide content extraction

  • Text Files: Read/write .txt, .csv, .md, .json, .yaml, .yml with pagination support

  • Run Python: Execute Python code for flexible file operations and data processing

  • MCP App: Beautiful React + Tailwind CSS app for viewing all document types

  • Flexible Reading Modes: Raw full read or paginated for large files

  • Powered by Pyodide: Runs in secure WebAssembly sandbox via code-runner-mcp

Related MCP server: docxtpl MCP Server

Quick Start

MCP Configuration

Add to your MCP client configuration (e.g., Claude Desktop, Cline, etc.):

Via npx (recommended):

{
  "mcpServers": {
    "docsmith": {
      "command": "npx",
      "args": ["-y", "docsmith-mcp"],
      "env": {
        "DOC_PAGE_SIZE": "100"
      }
    }
  }
}

Via global installation:

npm install -g docsmith-mcp
{
  "mcpServers": {
    "docsmith": {
      "command": "docsmith-mcp",
      "env": {
        "DOC_PAGE_SIZE": "100"
      }
    }
  }
}

Via local path:

{
  "mcpServers": {
    "docsmith": {
      "command": "node",
      "args": ["/path/to/docsmith-mcp/dist/index.js"]
    }
  }
}

Then use the read_document tool:

{
  "file_path": "/path/to/document.xlsx",
  "mode": "paginated",
  "page": 1,
  "page_size": 50
}

The MCP App will automatically open to display the document content beautifully.

Supported Formats

Format

Extensions

Read

Write

Notes

Excel

.xlsx

Multi-sheet support, pagination

Word

.docx

Paragraphs and tables

PDF

.pdf

Text extraction with pagination

PowerPoint

.pptx

Slide content extraction

CSV

.csv

-

Text

.txt, .md

Pagination support

JSON

.json

-

YAML

.yaml, .yml

-

Tools

read_document

Read document content with automatic format detection.

Parameters:

  • file_path (string, required): Path to the document

  • mode (string, optional): "paginated" or "raw" (default: "paginated")

  • page (number, optional): Page number for paginated mode (default: 1)

  • page_size (number, optional): Items per page (default: 100)

  • sheet_name (string, optional): Sheet name for Excel files

Example:

{
  "file_path": "/path/to/document.xlsx",
  "mode": "paginated",
  "page": 1,
  "page_size": 50,
  "sheet_name": "Sheet1"
}

write_document

Write document content.

Parameters:

  • file_path (string, required): Output path

  • format (string, required): "excel", "word", "csv", "txt", "json", "yaml"

  • data (array/object, required): Document content

Example:

{
  "file_path": "/path/to/output.xlsx",
  "format": "excel",
  "data": [
    ["Product", "Q1", "Q2"],
    ["Laptop", 100, 150],
    ["Mouse", 500, 600]
  ]
}

get_document_info

Get document metadata without reading full content.

Parameters:

  • file_path (string, required): Path to the document

Example:

{
  "file_path": "/path/to/document.pdf"
}

run_python

Execute Python code for flexible file operations, data processing, and custom tasks. Supports any file format and Python libraries.

Parameters:

  • code (string, required): Python code to execute

  • packages (object, optional): Package mappings (import_name -> pypi_name) for required dependencies

  • file_paths (array, optional): File paths that the code needs to access

Examples:

Read and process any file:

{
  "code": "import json\nwith open('/path/to/file.json') as f:\n    data = json.load(f)\n    result = len(data)\n    print(json.dumps({'count': result}))",
  "file_paths": ["/path/to/file.json"]
}

Batch rename files with regex:

{
  "code": "import os, re\nfolder = '/path/to/files'\nfor name in os.listdir(folder):\n    new_name = re.sub(r'old_', 'new_', name)\n    os.rename(os.path.join(folder, name), os.path.join(folder, new_name))\nprint(json.dumps({'success': True}))",
  "file_paths": ["/path/to/files"]
}

Process data with pandas:

{
  "code": "import pandas as pd\ndf = pd.read_csv('/path/to/data.csv')\nsummary = df.describe().to_dict()\nprint(json.dumps(summary))",
  "packages": {"pandas": "pandas"},
  "file_paths": ["/path/to/data.csv"]
}

Extract archive files:

{
  "code": "import zipfile, os\nwith zipfile.ZipFile('/path/to/archive.zip', 'r') as z:\n    z.extractall('/path/to/output')\nfiles = os.listdir('/path/to/output')\nprint(json.dumps({'extracted_files': files}))",
  "file_paths": ["/path/to/archive.zip", "/path/to/output"]
}

MCP App

The built-in MCP App provides a beautiful, interactive interface for viewing documents:

  • Excel: Interactive tables with sticky headers

  • PDF: Page-by-page text viewing

  • Word: Paragraph and table rendering

  • PowerPoint: Slide navigation

Built with React 19, Tailwind CSS v4, and Lucide icons.

Configuration

Environment variables for customizing behavior:

Variable

Description

Default

DOC_RAW_FULL_READ

Enable full raw read mode

false

DOC_PAGE_SIZE

Default items per page

100

DOC_MAX_FILE_SIZE

Max file size in MB

50

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

License

MIT

Available Tools

4 tools
get_document_infoB

Get document metadata (page count, sheet count, slide count, file size, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the document file
file_typeNoOverride file type detection (optional). Specify format explicitly instead of relying on extension

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
pagesNo
sheetsNo
slidesNo
tablesNo
headersNo
successNo
encodingNo
metadataNo
file_sizeNo
file_typeNo
key_countNo
item_countNo
line_countNo
paragraphsNo
total_colsNo
total_rowsNo
total_wordsNo

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Get document metadata' which implies a read-only operation, but doesn't disclose behavioral traits like error handling (e.g., if file doesn't exist), performance considerations, or authentication needs. The description is minimal and lacks context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and includes helpful examples (page count, etc.) that add value without verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple metadata retrieval), 100% schema coverage, and the presence of an output schema (which handles return values), the description is reasonably complete. It clearly states what the tool does, though it lacks usage guidelines and behavioral details that could enhance agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds no parameter-specific information beyond implying metadata retrieval, which is covered by the tool's purpose. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'document metadata' with specific examples (page count, sheet count, slide count, file size, etc.). It distinguishes from sibling tools like 'read_document' (which likely reads content) and 'write_document' (which modifies content), though it doesn't explicitly mention these distinctions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., file existence), when not to use it, or how it differs from siblings like 'read_document' beyond the metadata focus implied in the purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_documentA

Read document content (Excel, Word, PowerPoint, PDF, TXT, CSV, Markdown, JSON, YAML). Supports raw full read or paginated mode. Includes interactive UI for Excel and PDF.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the document file
file_typeNoOverride file type detection (optional). Specify format explicitly instead of relying on extension
modeNoRead mode
pageNoPage number for paginated mode
page_sizeNoItems per page
sheet_nameNoSheet name for Excel files

Output Schema

ParametersJSON Schema
NameRequiredDescription
dataNo
pageNo
errorNo
sheetsNo
slidesNo
tablesNo
contentNo
headersNo
successNo
encodingNo
has_moreNo
page_sizeNo
paragraphsNo
sheet_nameNo
total_colsNo
total_rowsNo
total_linesNo
total_pagesNo
current_pageNo
total_slidesNo
total_tablesNo
total_paragraphsNo
total_page_groupsNo
current_page_groupNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses key behavioral traits: format support, read modes (raw/paginated), and interactive UI for specific formats. However, it doesn't mention performance characteristics, error handling, authentication requirements, or rate limits that would be important for a document reading tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences that each add value: first establishes core functionality with format enumeration, second adds mode and UI information. No redundant information, though it could be slightly more front-loaded with the most critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, multiple formats and modes) and the presence of an output schema, the description provides good foundational context. It covers what the tool does, supported formats, and key operational modes. The output schema existence means return values don't need explanation, making this reasonably complete for agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds some context about format support and modes that complements the schema, but doesn't provide additional parameter semantics beyond what's already documented in the schema descriptions. The description doesn't explain parameter interactions or provide usage examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb ('Read') and resource ('document content'), enumerates supported file formats, and distinguishes from sibling tools like 'get_document_info' (metadata) and 'write_document' (write operation). It provides comprehensive scope information beyond just the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through format support and mode options, but doesn't explicitly state when to use this tool versus alternatives like 'get_document_info' for metadata or 'write_document' for modifications. No explicit when-not-to-use guidance or prerequisite information is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_pythonC

Execute Python code for flexible file operations, data processing, and custom tasks. Supports any file format and Python libraries.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYesPython code to execute. Access files using their absolute paths.
packagesNoPackage mappings (import_name -> pypi_name) for required dependencies
file_pathsNoFile paths that the code needs to access

Output Schema

ParametersJSON Schema
NameRequiredDescription
errorNo
resultNo
stderrNo
stdoutNo
successNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Supports any file format and Python libraries', which hints at capabilities, but lacks critical behavioral details: it doesn't mention security implications (e.g., sandboxing, permissions), resource limits (e.g., execution time, memory), error handling, or output format. For a powerful tool like code execution, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences that efficiently cover the tool's purpose and capabilities. It's front-loaded with the core function ('Execute Python code') and avoids unnecessary details. However, it could be slightly more structured by separating use cases or adding a brief example, but overall, it's well-sized with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (code execution with 3 parameters, no annotations, but an output schema exists), the description is moderately complete. It covers the high-level purpose and capabilities but lacks depth in usage guidelines, behavioral transparency, and parameter semantics. The presence of an output schema means return values are documented elsewhere, reducing the burden on the description, but for a tool with potential security and resource implications, more context is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters (code, packages, file_paths) with descriptions. The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter interactions, provide examples, or clarify semantics like how 'packages' mappings work or how 'file_paths' are accessed. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with the verb 'Execute' and resource 'Python code', specifying it's for 'flexible file operations, data processing, and custom tasks'. It distinguishes from sibling tools (get_document_info, read_document, write_document) by focusing on code execution rather than document operations, though it doesn't explicitly name those alternatives. The purpose is specific but could be more precise about what distinguishes it from similar code execution tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'flexible file operations, data processing, and custom tasks' but doesn't specify scenarios where run_python is preferred over sibling tools like write_document for file operations or other code execution methods. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent with minimal contextual guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_documentC

Write document content (Excel, Word, PowerPoint, Text)

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to save the document
formatYesDocument format
dataYesDocument data structure. Excel: array of rows [[cell1, cell2], ...]. Word: {paragraphs: string[], tables?: [[[cell]]]}. Text/CSV/JSON: string or object

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It implies a write operation ('Write') but lacks critical behavioral details: it doesn't disclose whether this overwrites existing files, requires specific permissions, handles errors, or has side effects like file creation. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded, using a single phrase that efficiently conveys the core purpose and supported formats. Every word earns its place with no redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a write operation with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, file system interactions, and return values, making it inadequate for safe and effective tool invocation by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by listing supported formats, but it doesn't provide additional context on parameter usage, constraints, or examples. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Write') and resource ('document content'), specifying the supported formats (Excel, Word, PowerPoint, Text). It distinguishes from sibling tools like 'read_document' by focusing on writing rather than reading. However, it doesn't explicitly differentiate from 'get_document_info' or 'run_python' in terms of document creation vs. metadata retrieval or execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., file system access), when-not-to-use scenarios (e.g., for reading documents), or explicit alternatives among sibling tools like 'read_document' for reading or 'run_python' for other operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.4/5.0
Disambiguation4/5

The tools are mostly distinct in purpose: get_document_info for metadata, read_document for reading content, write_document for writing content, and run_python for custom operations. However, run_python could overlap with read_document and write_document for file operations, potentially causing confusion about when to use it versus the specialized tools.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case: get_document_info, read_document, run_python, write_document. This makes them predictable and easy to understand, with no deviations in style.

Tool Count4/5

With 4 tools, the count is reasonable for a document processing server, covering core operations like reading, writing, and metadata retrieval. However, it feels slightly thin as it lacks tools for operations like document conversion, editing, or deletion, which might be expected in a comprehensive document toolset.

Completeness3/5

The toolset covers basic read, write, and metadata operations, but has notable gaps for a document processing domain. Missing operations include document conversion (e.g., to different formats), editing (e.g., modifying content without full rewrite), and deletion, which could limit agent workflows and cause dead ends in complex tasks.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • -
    license
    B
    quality
    Not graded
    maintenance
    Enables AI assistants to create, read, and manipulate Microsoft Word documents with comprehensive formatting, table creation, content management, and document protection capabilities. Supports advanced operations like merging documents, PDF conversion, and rich text formatting through a standardized interface.
    32
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to read, edit, and create Microsoft Word documents (.docx) with support for rich text, tables, and images, deployable locally or via SSE.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpc-tech/docsmith-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server