DocumentMCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
DocumentMCP Server & Client (Advanced)
A Model Context Protocol (MCP) project written in Python. This codebase is the combination of the two following courses:
It includes an MCP Server that provides tools to interact with documents and the filesystem, and a Python MCP Client that demonstrates advanced MCP capabilities such as Sampling, Roots, Progress Reporting, and Logging.
Deprecation Notice (SEP-2577): As of July 28, 2026, the Sampling, Roots, and Logging capabilities have been officially deprecated in the MCP specification.
This repository intentionally retains these features in
mcp_server.pyandmcp_client.pyfor educational purposes (with deprecation warnings suppressed).In contrast, the basic
server.pyandclient.pyexamples have been updated to demonstrate the modern approach of usingsys.stderrfor logging instead of the protocol's logging capability.
Features
Server
Tools:
Read Documents (
read_doc_contents): Retrieve the contents of a specific document by its ID.Edit Documents (
edit_document): Perform find-and-replace operations on document contents.Summarize (
summarize): Uses the Sampling capability to ask the client to summarize text via an LLM.Research (
research): A simulated long-running task that uses Progress Reporting and Logging to keep the client updated.List Roots (
list_roots): Retrieves a list of allowed root directories exposed by the client.Read Directory (
read_dir): Reads the contents of a directory, restricting access to client-approved Roots.
Resources:
List available documents.
Fetch specific document contents via URI.
Prompts:
Format: Prompt template to help rewrite a document in Markdown format.
Client
Connects to the local MCP Server using standard I/O (stdio).
Implements Callbacks for advanced server capabilities:
Sampling: Resolves LLM completion requests initiated by the server.
Logging: Receives and prints server logs.
Progress: Receives and displays progress updates for long-running server tools.
Roots: Exposes specified local directories to the server.
Includes a basic
client.pyand a full-featuredmcp_client.py.
Related MCP server: mcp-document-chat
Mock Documents
The server comes with the following mock documents pre-configured:
deposition.mdreport.pdffinancials.docxoutlook.pdfplan.mdspec.txt
Prerequisites
Python 3.8+
mcp package installed
Setup
Clone or download this repository.
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activateInstall the required dependencies:
pip install -r requirements.txt
Usage
Running the Full Client
The included mcp_client.py script starts the MCP Server, connects to it, lists its tools, and tests the advanced tools (summarize, research, list_roots).
You can provide root directories as command-line arguments to expose them to the server:
python mcp_client.py /path/to/some/directory /another/directoryRunning the Basic Client and Server
A minimal client (client.py) and a minimal server (server.py) are also provided to demonstrate a simple tool execution with progress tracking.
python client.pyInspecting the Server
You can test and inspect the server interactively using the official MCP Inspector.
With your virtual environment active, run:
npx @modelcontextprotocol/inspector python mcp_server.pyIntegration with MCP Agents
You can configure this MCP server to be used with any compatible MCP client or agent (such as Claude Desktop, Cursor, Antigravity, etc.).
Locate your agent's MCP configuration file.
Add the following configuration, providing the absolute paths:
{ "mcpServers": { "my-document-server": { "command": "/absolute/path/to/your/project/venv/bin/python", "args": [ "/absolute/path/to/your/project/mcp_server.py" ] } } }Restart your agent or client.
This server cannot be deployed
Maintenance
Related MCP Connectors
- docs2mcpOAuthcom.docs2mcp
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
MCP-native collaborative markdown editor with real-time AI document editing
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Publish and share access-controlled Markdown documents from any MCP-enabled AI tool.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search, deep-read, and build knowledge bases from Markdown, PDF, DOCX, and PPTX documents via MCP tools for retrieval, document navigation, and ingestion.21 npm645MIT
- FlicenseNot gradedqualityDmaintenanceExposes a document store over MCP tools, resources, and prompts for reading, editing, summarizing, and formatting documents in a chat interface.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to extract structured data from PDFs with confidence scores and provenance, and to search, review, and correct documents via MCP tools, resources, and prompts.-
- AlicenseNot gradedqualityDmaintenanceTypebar (formerly SuperDocs): AI document editing for people and agents. Edits the exact section and leaves the rest. Hosted MCP server, REST API and web app.1MIT