Document MCP Server
Provides tools and resources for managing in-memory documents, allowing users to read, edit, and list document contents via the Model Context Protocol. It includes features for formatting documents to Markdown and accessing document-specific resources.
README
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.
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 uv -
Clone 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.py
The 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.py -
In 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.