Document MCP Server
Provides tools for managing and editing documents, including a dedicated prompt template for formatting document content into Markdown.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Document MCP Server List all documents and read the content of deposition.md"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Document MCP Server
A simple MCP (Model Context Protocol) server and MCP client for managing documents using FastMCP.
Features
Tools:
read_doc_contents: Read the contents of a document.edit_document: Edit a document by replacing text.return all the docs: List all document IDs.
Resources:
docs://documents: JSON list of document IDs.docs://documents/{doc_id}: Plain text content of a specific document.
Prompts:
format_to_md: Prompt template for formatting documents to Markdown.
Related MCP server: DevDocs MCP
Prerequisites
Python 3.12 or higher
uv (Python package manager and project manager)
Installation
Ensure you have Python 3.12+ installed.
Install uv if not already installed:
pip install uvClone or download this project to your local machine.
Navigate to the project directory:
cd "path/to/mcp server"Create a virtual environment and install dependencies:
uv sync
Running the Server
To run the MCP server in development mode:
uv run mcp dev mcp_server.pyThe server runs on stdio transport, suitable for MCP clients.
Testing the Functionality
Test client is provided in mcp_client.py to verify the server works.
To test:
In one terminal, start the server:
uv run python mcp_server.pyIn another terminal, run the test client:
uv run mcp_client.py
This will connect to the server and list the available tools, printing them to the console.
For more advanced testing, you can modify mcp_client.py to call specific tools, read resources, or get prompts.
Example: To read a document content, you could add code like:
# Inside the async main function
doc_content = await client.call_tool("read_doc_contents", {"doc_id": "deposition.md"})
print(doc_content)Project Structure
mcp_server.py: The main MCP server implementation.mcp_client.py: A test client for interacting with the server.pyproject.toml: Project configuration and dependencies.
Notes
The server uses an in-memory dictionary for documents. Changes are not persisted.
Ensure the virtual environment is activated when running Python commands.
Available Tools
3 toolsedit_documentA
Edit a document by replacing a string in the documents content with a new string.
Inputs: doc_id (required), old_str (required), new_str (required).
read_doc_contentsA
Read the contents of a document and return it as a string.
Inputs: doc_id (required).
return all the docsB
Return a list of all the document ids.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: edit_document modifies content, read_doc_contents retrieves content, and return all the docs lists document IDs. There is no overlap in functionality, making tool selection unambiguous for an agent.
The naming is inconsistent with mixed conventions: edit_document uses snake_case with a verb_noun pattern, read_doc_contents uses snake_case but abbreviates 'document' inconsistently, and return all the docs uses a sentence-like format with spaces and no clear pattern. This lack of uniformity could confuse agents.
With only 3 tools, the set feels thin for a document management server, as it lacks operations like creating or deleting documents. While the tools cover basic read, list, and edit functions, the scope is limited and may require workarounds for full document lifecycle management.
There are significant gaps in the tool surface for document management: no create_document or delete_document tools, and missing operations like search or metadata updates. This incomplete coverage will likely cause agent failures when trying to perform common document workflows beyond reading, listing, and editing.
Maintenance
Related MCP Connectors
Markdown workspace for AI agents: read, write, organize, and share markdown documents.
Manage, share, and collaborate on Markdown-based documents with team members and agents.
Read, create and update canonical AI-readable documents in your Data Rooms.
Shared Markdown memory for your agents: docs, typed collections, files, skills and Dispatch.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol implementation that enables AI assistants to interact with markdown documentation files, providing capabilities for document management, metadata handling, search, and documentation health analysis.1458MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol implementation that enables AI-powered access to documentation resources, featuring URI-based navigation, template matching, and structured documentation management.9MIT
- AlicenseNot gradedqualityDmaintenanceProvides a standardized interface for interacting with Google Docs through the Model Context Protocol, enabling document management and content operations via natural language.2MIT
- FlicenseNot gradedqualityDmaintenanceExposes a document store over MCP tools, resources, and prompts for reading, editing, summarizing, and formatting documents in a chat interface.-