Skip to main content
Glama
xdelmo

DocumentMCP Server

by xdelmo

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.

NOTE

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.py and mcp_client.py for educational purposes (with deprecation warnings suppressed).

  • In contrast, the basic server.py and client.py examples have been updated to demonstrate the modern approach of using sys.stderr for 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.py and a full-featured mcp_client.py.

Related MCP server: DocAgent-MCP

Mock Documents

The server comes with the following mock documents pre-configured:

  • deposition.md

  • report.pdf

  • financials.docx

  • outlook.pdf

  • plan.md

  • spec.txt

Prerequisites

  • Python 3.8+

  • mcp package installed

Setup

  1. Clone or download this repository.

  2. Create and activate a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate
  3. Install 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/directory

Running 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.py

Inspecting 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.py

Integration 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.).

  1. Locate your agent's MCP configuration file.

  2. 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"
          ]
        }
      }
    }
  3. Restart your agent or client.

F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    70
    616
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables local document question-answering and retrieval via MCP, supporting multi-turn conversation, intent recognition, and tools for document search, Q&A, and summarization.
    5
  • F
    license
    Not graded
    quality
    B
    maintenance
    Exposes a document store over MCP tools, resources, and prompts for reading, editing, summarizing, and formatting documents in a chat interface.
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.

View all related MCP servers

Related MCP Connectors

  • MCP-native collaborative markdown editor with real-time AI document editing

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • AI document editing for agents: draft, edit, export .docx/PDF. 37 MCP tools; agent self-signup.

View all MCP Connectors

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/xdelmo/mcp-server'

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