- Home
- MCP servers
- Spire.Doc
Spire.Doc
- typescript
5
GitHub Stars
typescript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can manipulate Word documents directly through a dedicated MCP server without needing Microsoft Word. It lets you create, read, modify, format, convert, and secure Word documents from your AI agent, making document workflows automation-friendly and high fidelity.
How to use
You connect to the MCP server from your MCP client or IDE. Use the server to perform common document tasks such as creating documents from templates, applying protections, editing text and formatting, inserting tables and images, converting documents to PDF or other formats, and performing content analysis. The server exposes a set of tools you can call in an automated way, so your AI agent can generate or modify Word documents as part of its workflow.
How to install
Prerequisites: You need Python 3.10 or higher.
- Install the MCP server locally via the provided command line tool.
Run and configure locally
Start the MCP server on the default port 8000 with the standard runtime command.
Configuration and environment
The server expects an environment variable to point to the directory where Word files are stored. You can set this for your client and during startup.
Notes on usage
When you run tests or demos, ensure the port and path configurations match your environment. If you choose a non-default port, specify it before starting the server so your MCP client can connect to the correct endpoint.
Troubleshooting
If the server fails to start, verify Python version, ensure dependencies are installed, and confirm the port is not in use by another process. Check environment variables and the connection URL in your MCP client configuration.
Notes on security
Protect documents by applying password protection where supported and validate inputs to prevent injection or malformed content. Keep access to the MCP server restricted to trusted agents and secure networks.
Examples of common tasks
- Create a new Word document and populate it with sections and tables.
Project structure overview
The MCP server workflow is organized into API layers, core logic, and utilities, with a dedicated entry point that handles requests from clients.
Supported formats and conversions
The server can work with DOC, DOCX, DOCM, DOT, DOTX, DOTM inputs and can produce DOC, DOCX, PDF, RTF, HTML, TXT, EPUB, ODT, XML, and Markdown outputs.
Development hints
If you plan to develop or extend the server, refer to the project’s tooling and tests to ensure compatibility with the 18 available tools and robust error handling.
Security best practices
Limit access to the MCP server to trusted clients, rotate credentials periodically, and monitor for unusual activity in document processing.
Examples of integration patterns
Integrate the MCP server into an AI agent workflow to automate document generation, formatting, and conversion as part of response generation or batch processing.
Version and support
This server provides comprehensive Word document manipulation capabilities with structured tools and clear error handling to support production use.
Tools and capabilities overview
The server exposes a comprehensive set of tools across five categories to create, read, modify, format, and convert Word documents.
Available tools
create_document
Create a new Word document with optional templates or starting from scratch.
set_document_protection
Apply password protection to a document to restrict access.
find_and_replace
Search for text within a document and replace it with new content.
merge_documents
Combine multiple Word documents into a single document.
add_text_watermark
Insert a text watermark to protect or brand a document.
get_paragraph_text
Retrieve the text content of a specific paragraph or range.
delete_paragraph
Remove paragraphs from a document by position or criteria.
get_paragraph_info
Fetch detailed information about a paragraph, such as formatting and position.
add_paragraph
Insert a new paragraph with optional styling.
update_paragraph_text
Modify the text content of an existing paragraph.
create_table
Create tables with specified dimensions and initial content.
add_table_after_paragraph
Insert a table immediately after a given paragraph.
add_table_to_section
Append a table at the end of a document section.
get_table_info
Retrieve information about a table’s structure and cells.
delete_table
Remove a table from the document.
set_cell_text
Set the text content of a specific table cell.
format_paragraph
Apply formatting to a paragraph, including alignment, indentation, and spacing.
get_paragraph_format
Retrieve formatting details of a paragraph.
convert_document
Convert documents between formats such as DOC/DOCX/PDF/HTML/RTF and more.
get_conversion_status
Check the progress of ongoing document conversions.
get_conversion_history
View historical conversions performed by the server.