MCP Server

MCP Server

An MCP server that provides document management capabilities including reading, editing, and summarizing documents through a CLI chat interface powered by Claude AI.

Category
Visit Server

README

MCP Server

A Model Context Protocol (MCP) server implementation that provides document management capabilities through a CLI interface powered by Claude AI.

Overview

This project implements an MCP server that allows you to:

  • Read and edit documents
  • List available documents
  • Format documents using Markdown
  • Summarize document contents
  • Interact with documents through a CLI chat interface powered by Claude AI

Features

  • Document Management: Read, edit, and manage various document types
  • MCP Protocol: Implements the Model Context Protocol for AI tool integration
  • Claude AI Integration: Uses Anthropic's Claude for intelligent document processing
  • CLI Interface: Command-line chat interface for document interactions
  • Multiple Document Formats: Support for various document types (MD, PDF, DOCX, TXT)

Prerequisites

  • Python 3.8+
  • UV package manager (recommended) or pip
  • Anthropic API key

Installation

  1. Clone the repository:
git clone <repository-url>
cd mcp-server
  1. Create and activate a virtual environment:
# Using UV (recommended)
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Or using standard Python
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
# Using UV
uv pip install -r requirements.txt

# Or using pip
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file in the project root:
CLAUDE_MODEL=claude-3-sonnet-20240229
ANTHROPIC_API_KEY=your_anthropic_api_key_here
USE_UV=1  # Set to 0 if not using UV

Usage

Basic Usage

Run the main application:

python main.py

Or with UV:

uv run main.py

Running the MCP Server

The MCP server can be run independently:

python mcp_server.py

Or with UV:

uv run mcp_server.py

CLI Chat Interface

The application provides a CLI chat interface where you can:

  • Ask questions about documents
  • Request document summaries
  • Format documents
  • Edit document contents

Project Structure

mcp-server/
├── core/                   # Core application modules
│   ├── chat.py            # Chat functionality
│   ├── claude.py          # Claude AI service integration
│   ├── cli.py             # CLI application logic
│   ├── cli_chat.py        # CLI chat interface
│   └── tools.py           # Utility tools
├── mcp_server.py          # MCP server implementation
├── mcp_client.py          # MCP client implementation
├── main.py                # Main application entry point
└── README.md              # This file

MCP Server Features

The MCP server provides the following tools and resources:

Tools

  • read_document: Read contents of a document
  • edit_document: Edit document content by replacing text

Resources

  • docs://documents: List all available documents
  • docs://documents/{doc_id}: Get specific document content

Prompts

  • format: Rewrite document in Markdown format
  • summarize: Summarize document contents

Available Documents

The server comes with sample documents:

  • deposition.md - Testimony documentation
  • report.pdf - Technical report
  • financials.docx - Financial information
  • outlook.pdf - Performance projections
  • plan.md - Implementation plan
  • spec.txt - Technical specifications

Configuration

Environment Variables

  • CLAUDE_MODEL: The Claude model to use (default: claude-3-sonnet-20240229)
  • ANTHROPIC_API_KEY: Your Anthropic API key
  • USE_UV: Set to "1" to use UV, "0" to use standard Python

UV vs Python

The application can use either UV or standard Python. Set USE_UV=1 in your .env file to use UV, or USE_UV=0 to use standard Python.

Development

Running Tests

# Using UV
uv run pytest

# Using Python
python -m pytest

Code Style

The project follows Python best practices and uses type hints throughout.

Troubleshooting

Common Issues

  1. API Key Error: Ensure your ANTHROPIC_API_KEY is set correctly in the .env file
  2. Model Error: Verify the CLAUDE_MODEL is a valid model name
  3. UV Not Found: Install UV or set USE_UV=0 to use standard Python

Debug Mode

The MCP server runs in DEBUG mode by default. Check the console output for detailed logging information.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

[Add your license information here]

Support

For issues and questions, please open an issue on the repository.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

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.

Official
Featured