loading…
Search for a command to run...
loading…
Provides tools and resources for managing in-memory documents, allowing users to read, edit, and list document contents via the Model Context Protocol. It inclu
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.
A simple MCP (Model Context Protocol) server and MCP client for managing documents using FastMCP.
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.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
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.
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)
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.Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"document-mcp-server": {
"command": "npx",
"args": []
}
}
}