- Home
- MCP servers
- Document Analyzer
Document Analyzer
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"tathagat017-document-analyser-mcp": {
"command": "python",
"args": [
"fastmcp_document_analyzer.py"
]
}
}
}You can deploy and interact with the FastMCP Document Analyzer anytime you need to extract insights from large text collections. This server analyzes documents to measure sentiment, identify keywords, evaluate readability, and search across your collection with semantic similarity, all while providing easy-to-use management and analytics features for organized document handling.
How to use
Set up a client that talks to the MCP server you start locally. You can run the server in stdio mode for fast local development or enable HTTP transport if you plan to expose the service to web clients. With the server running, you can analyze documents, extract keywords, perform searches, and retrieve collection statistics through the defined tools. Start by launching the server, then connect your client to issue analysis requests and retrieve results.
How to install
# Prerequisites
Python 3.8 or higher
# Optional: check system requirements
# Ensure you have at least 500MB free disk space
# Clone the project
git clone <repository-url>
cd document-analyzer
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize NLTK data (needed for language processing)
python -c "import nltk; nltk.download('punkt'); nltk.download('vader_lexicon'); nltk.download('stopwords'); nltk.download('punkt_tab')"
# Run the server in stdio transport (default)
python fastmcp_document_analyzer.py
# Optional: run the HTTP transport variant
python fastmcp_document_analyzer.py --transport http --port 9000
# Test the server
python test_fastmcp_analyzer.py
Starting and testing the server
To start with the default setup, run the server in the terminal and keep it running to accept requests from your MCP client. You can switch to HTTP transport if your client uses HTTP-based communication. After starting, run the test suite to ensure everything is functioning as expected.
Usage patterns with an MCP client
- Analyze a document to obtain sentiment, keywords, readability, and basic statistics for a given document. - Retrieve sentiment scores and keyword relevance for text snippets. - Search your document collection using semantic similarity to surface the most relevant items. - Retrieve metrics about the entire collection to monitor growth and insights.
Notes on deployment
If you plan to expose the service to web clients, prefer the HTTP transport to enable remote access while keeping your internal processing within a controlled environment. Ensure proper security measures for the HTTP endpoint, such as authentication, rate limiting, and input validation.
Available tools
analyze_document
Performs a complete analysis of a document, returning sentiment, keywords, readability, and basic statistics.
get_sentiment
Analyzes sentiment of a given text and returns overall sentiment with confidence and component scores.
extract_keywords
Extracts top keywords from text using TF-IDF and frequency-based methods with relevance scoring.
calculate_readability
Computes readability metrics such as Flesch Reading Ease, Flesch-Kincaid, and ARI.
search_documents
Performs semantic search across documents using TF-IDF vectors and cosine similarity to return relevant results.
add_document
Adds a new document to the persistent collection with optional metadata like author, category, and tags.
get_document
Retrieves a document by its ID from storage.
delete_document
Removes a document from the collection by ID.
list_documents
Lists documents with optional filtering by category or tags.