A powerful document analysis system built on the Model Context Protocol (MCP) that provides advanced document processing, analysis, and information extraction capabilities using Claude 3 Opus.
- 📄 Document Analysis: Extract key information, entities, dates, and monetary values
- 📊 Document Summarization: Generate summaries at different detail levels
- 🔍 Entity Search: Find documents mentioning specific entities
- 📁 Batch Processing: Process multiple documents efficiently
- 🤖 AI-Powered: Leverages Claude 3 Opus for intelligent analysis
- 🔄 MCP Integration: Built on the Model Context Protocol for standardized communication
- Python 3.11 or higher
- uv for dependency management
- Anthropic API key for Claude 3 access
- Clone the repository:
git clone https://github.com/yourusername/doc-analysis-agent.git
cd doc-analysis-agent- Create a virtual environment and install dependencies using uv:
uv venv
source .venv/bin/activate # On Unix/macOS
uv pip install -e .- Set up your environment variables:
cp .env.example .envEdit .env and add your Anthropic API key:
ANTHROPIC_API_KEY=your-api-key-here
The Document Analysis Agent provides several ways to process and analyze documents. Here are some common use cases:
from docanalysis.mcp.server import FastMCPDocumentAnalysisServer
# Initialize the server
server = FastMCPDocumentAnalysisServer()
await server.initialize()
# Analyze a document
result = await server.analyze_document({
"content": "Your document content here",
"metadata": {
"type": "contract",
"title": "Sample Document"
}
})Check out the examples directory for more detailed examples:
- Basic Analysis: Simple document analysis
- Batch Processing: Process multiple documents
- Document Summary: Generate summaries
- Entity Search: Search for entities
analyze_document(document): Analyze a single documentanalyze_documents(documents): Process multiple documentssummarize_document(document, detail_level): Generate document summaryextract_info(document, info_types): Extract specific informationfind_documents_by_entity(entity): Search for documents by entity
The system supports various document types with specialized analysis:
- Contracts
- Reports
- Invoices
- Amendments
- Press Releases
- And more...
python -m pytest tests/ -v
# If using hatch
hatch run test:testBuild and run using Docker:
docker-compose up --build- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with FastMCP
- Powered by Anthropic's Claude 3