mcp_server

YDL-Amsterdam/mcp_server

3.1

If you are the rightful owner of mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server for document search and retrieval in the Vreugdenhil CSRD (Corporate Sustainability Reporting Directive) system.

Tools
4
Resources
0
Prompts
0

Vreugdenhil CSRD MCP Server

A Model Context Protocol (MCP) server for document search and retrieval in the Vreugdenhil CSRD (Corporate Sustainability Reporting Directive) system.

Features

  • Document Search: Search through indexed documents (PDF, DOCX, PPTX, MSG files)
  • Semantic Search: Uses Azure Cognitive Search with semantic capabilities
  • Multiple Content Types: Support for documents, presentations, and emails
  • RESTful API: HTTP-based MCP server with SSE transport
  • Docker Support: Containerized deployment with nginx reverse proxy
  • CI/CD Pipeline: Automated testing, building, and deployment

Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │────│   MCP Server     │────│  Azure Search   │
│                 │    │   (FastMCP)      │    │                 │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌──────────────────┐
                       │   Azure Blob     │
                       │   Storage        │
                       └──────────────────┘

Quick Start

Prerequisites

  • Python 3.11+
  • Docker and Docker Compose
  • Azure services (Search, Blob Storage, Cosmos DB, OpenAI)

Local Development

  1. Clone the repository

    git clone https://github.com/SnmIzadi/mcp_server.git
    cd mcp_server
    
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your Azure service credentials
    
  3. Run with Docker Compose

    docker-compose up --build
    
  4. Or run locally

    python -m venv myenv
    source myenv/bin/activate  # On Windows: myenv\Scripts\activate
    pip install -r requirements.txt
    python server.py
    

Environment Variables

Create a .env file based on .env.example:

# Azure Search Services
AZURE_SEARCH_ENDPOINT=https://your-search-service.search.windows.net
AZURE_SEARCH_API_KEY=your-search-api-key
AZURE_SEARCH_INDEX_NAME=your-index-name

# Azure Blob Storage
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=your-account;AccountKey=your-key;EndpointSuffix=core.windows.net
BLOB_CONTAINER_FILES=your-files-container

# Azure Cosmos DB
COSMOS_ENDPOINT=https://your-cosmos.documents.azure.com:443/
COSMOS_KEY=your-cosmos-key
COSMOS_DATABASE_NAME=your-database-name

# Azure OpenAI Configuration
AZURE_OPENAI_ENDPOINT=https://your-openai.openai.azure.com/
AZURE_OPENAI_API_KEY=your-openai-api-key
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name
AZURE_OPENAI_API_VERSION=2024-02-15-preview

# MCP Server Configuration
MCP_SERVER_URL=http://localhost:8000

API Endpoints

The MCP server provides the following tools:

Search Tools

  • search_emails(query, max_results) - Search email content
  • search_documents(query, max_results) - Search document content
  • search_presentations(query, max_results) - Search presentation content
  • search_all_content(query, max_results) - Search all content types

Example Usage

# Search for sustainability reports
result = search_documents("sustainability report 2023", max_results=5)

# Search emails for specific topics
emails = search_emails("carbon emissions", max_results=10)

# Search all content
all_results = search_all_content("ESG compliance", max_results=15)

Deployment

Docker

# Build the image
docker build -t vreugdenhil-mcp-server .

# Run the container
docker run -p 8000:8000 --env-file .env vreugdenhil-mcp-server

Azure Container Apps

The repository includes CI/CD pipelines for automatic deployment to Azure Container Apps:

  1. Push to develop branch triggers development deployment
  2. Push to main branch triggers production deployment
  3. Pull requests trigger testing and security scans

Development

Project Structure

├── .github/workflows/     # CI/CD pipelines
├── scripts/               # Deployment scripts
├── server.py             # Main MCP server
├── azure_search_service.py # Azure Search integration
├── search_models.py      # Data models
├── app_config.py         # Configuration management
├── dockerfile            # Docker configuration
├── docker-compose.yml    # Local development setup
└── requirements.txt      # Python dependencies

Testing

# Run tests
pytest tests/

# Run with coverage
pytest tests/ --cov=. --cov-report=html

# Run linting
flake8 .
black --check .

CI/CD Pipeline

The repository includes several GitHub Actions workflows:

  • CI/CD Pipeline (cicd.yaml): Builds, tests, and deploys the application
  • Security Scan (security.yml): Runs security scans and vulnerability checks

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Security

  • Never commit .env files or secrets
  • Use .env.example as a template
  • All secrets are managed through Azure Key Vault in production
  • Regular security scans are performed via CI/CD

License

This project is proprietary to Vreugdenhil and is not open source.

Support

For support and questions, please contact the development team or create an issue in this repository.