Utility MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Utility MCP Serversummarize the PDF report.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCPs
Think of MCP like the ๐๐๐-๐ ๐ฉ๐จ๐ซ๐ญ ๐จ๐ง ๐ ๐ฅ๐๐ฉ๐ญ๐จ๐ฉ. Any device that wants to connect, whether itโs an external hard drive, monitor, or power supply, must follow the USB-C standard. Similarly, MCP is a standardized protocol developed by Anthropic that defines how ๐๐๐๐ฌ ๐๐จ๐ง๐ง๐๐๐ญ ๐ญ๐จ ๐๐จ๐ง๐ญ๐๐ฑ๐ญ๐ฌ ๐๐ง๐ ๐๐๐ญ๐ ๐ฌ๐จ๐ฎ๐ซ๐๐๐ฌ.
The laptop = MCP host The USB-C port = MCP itself The monitor, hard drive, power supply = MCP servers
For more understanding of MCPs, visit https://medium.com/@BH_Chinmay/basics-of-mcps-why-and-what-9579c21caac4
Utility MCP Server
A Model Context Protocol (MCP) server that provides AI-powered document processing and search capabilities.
Overview
This project implements an MCP server with tools for:
PDF Document Processing: Extract text, metadata, and statistics from PDF files
Document Summarization: Use Azure OpenAI to generate intelligent summaries of documents and pages
Web Search: Perform Google searches and retrieve top results
Architecture
MCPs/
โโโ mcp-servers/ # MCP server entrypoint and tools
โ โโโ server.py # Server initialization and tool registration
โ โโโ mcp_instance.py # FastMCP instance with logging configuration
โ โโโ tools/ # Tool implementations
โ โโโ document_summerizer.py # PDF summarization tools
โ โโโ google_search.py # Web search tool
โ โโโ pdf_reader.py # Basic PDF reading tool
โโโ utils/ # Shared utility modules
โ โโโ llm_utils.py # Azure OpenAI integration
โ โโโ pdf_utils.py # PDF processing utilities
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables (secrets)
โโโ README.md # This fileTools
Document Summarization Tools (tools/document_summerizer.py)
summarize_document(pdf_path)
Analyzes a complete PDF document and generates an intelligent summary.
Extracts all text from the PDF
Splits content into manageable chunks
Summarizes each chunk using Azure OpenAI
Generates a final summary from partial summaries
Returns: File path, page count, chunk count, and final summary
summarize_page(pdf_path, page_number)
Generates a summary for a specific page in a PDF.
Extracts text from the specified page
Processes through Azure OpenAI
Returns: Page number and page summary
extract_document_text(pdf_path)
Extracts all text content from a PDF without summarization.
Returns: Full text content
document_statistics(pdf_path)
Calculates text statistics for a document.
Returns: Character count, word count, and line count
document_metadata(pdf_path)
Retrieves metadata from a PDF document.
Returns: Page count, title, author, creator, and producer
Google Search Tool (tools/google_search.py)
google_search(query, num_results)
Performs a Google search and returns top results.
Uses Google Custom Search API
Parameters:
query: Search query stringnum_results: Number of results to return (default: 5)
Returns: List of results with title, link, and snippet
PDF Reader Tool (tools/pdf_reader.py)
read_pdf(pdf_path)
Basic PDF text extraction tool.
Reads and returns all text from a PDF
Returns: Extracted text content
Utilities
LLM Utilities (utils/llm_utils.py)
Handles Azure OpenAI integration:
_get_client(): Initializes Azure OpenAI client with environment configurationllm_summary(text): Sends text to Azure OpenAI for summarization
PDF Utilities (utils/pdf_utils.py)
Core PDF processing functions:
extract_text(pdf_path): Extracts all text from a PDFchunk_text(text, chunk_size): Splits text into chunksget_metadata(pdf_path): Extracts PDF metadataget_page_text(pdf_path, page_number): Extracts text from a specific page
Configuration
Environment Variables (.env)
The application requires the following environment variables:
Google Search Configuration:
GOOGLE_API_KEY=<your-google-api-key>
GOOGLE_SEARCH_ENGINE_ID=<your-search-engine-id>Azure OpenAI Configuration:
AZURE_OPENAI_ENDPOINT=<your-azure-endpoint>
AZURE_OPENAI_API_KEY=<your-azure-api-key>
AZURE_OPENAI_API_VERSION=<api-version>
AZURE_OPENAI_DEPLOYMENT=<deployment-name>Important: Never commit .env with actual credentials to version control.
Setup and Installation
Prerequisites
Python 3.10+
Virtual environment (recommended)
Installation
Create a virtual environment:
python -m venv .venvActivate the virtual environment:
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtCreate and configure
.env:
cp .env.example .env
# Edit .env and add your API credentialsRunning the Server
Development Mode
cd mcp-servers
mcp dev server.pyProduction Mode
cd mcp-servers
python server.pyLogging
The application uses Python's built-in logging module with the following configuration:
Level: INFO (use DEBUG for detailed output)
Format:
YYYY-MM-DD HH:MM:SS - logger_name - LEVEL - messageSecurity: All credentials and API keys are masked in logs
Log Levels
DEBUG: Detailed operation information (page extraction, chunk processing)
INFO: Normal operation events (tool invocations, completion status)
WARNING: Warning messages (invalid page numbers, missing configuration)
ERROR: Error events with full exception tracebacks
Enabling Debug Logging
To see more detailed logs during development:
import logging
logging.getLogger().setLevel(logging.DEBUG)Dependencies
mcp (1.28.1+): Model Context Protocol framework
openai (1.0.0+): Azure OpenAI client
python-dotenv: Environment variable management
httpx (0.27.0+): Async HTTP client for Google Search API
PyMuPDF (1.24.0+): PDF text extraction
See requirements.txt for complete list.
Error Handling
All tools include comprehensive error handling:
File existence validation before processing
Exception logging with full tracebacks
User-friendly error messages in responses
No sensitive data logged in error messages
Security Considerations
Credentials: Store all API keys and endpoints in
.envfileLogging: Credentials are never logged or printed
Environment: Use separate
.envfiles for different environments (dev, staging, production)Access: Restrict access to
.envfile permissions (never commit to version control)
Development Notes
Adding New Tools
Create a new file in
tools/directoryImport and register with
@mcp.tool()decoratorAdd comprehensive logging with
logger.info()andlogger.error()Document the tool in this README
Code Style
Use descriptive variable names
Include docstrings for all functions
Log important operations and errors
Never log sensitive information (API keys, authentication tokens)
Troubleshooting
Import Errors
If you encounter ModuleNotFoundError:
Ensure virtual environment is activated
Run
pip install -r requirements.txtCheck that Python path includes both
mcp-servers/and project root directories
Missing Environment Variables
If you see "Missing Azure OpenAI environment variables":
Verify
.envfile exists in the project rootCheck that all required variables are set (not empty)
Restart the server after updating
.env
PDF Processing Issues
Ensure PDF file exists and is readable
Check that PyMuPDF (fitz) is properly installed
Verify sufficient disk space for large PDF files
Support
For issues or questions, please refer to the logging output for detailed error information.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AI-Chinmay/MCPs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server