Skip to main content

MCP server for PowerPoint integration and local file manipulation in AI applications

Project description

VoluteMCP Server

A FastMCP 2.0-based Model Context Protocol (MCP) server providing various tools, resources, and prompts for AI model interaction.

Features

  • ๐Ÿ”ง Tools: Mathematical calculations, text processing, JSON manipulation, hashing, encoding/decoding
  • ๐Ÿ“Š PowerPoint Tools: Comprehensive PowerPoint analysis, metadata extraction, and content processing
  • ๐Ÿ“ Resources: System status, user data, configuration sections, simulated logs
  • ๐Ÿ“ Prompts: Data analysis prompts, code review templates
  • ๐ŸŒ HTTP Endpoints: Health checks and server information
  • ๐Ÿท๏ธ Tag-based Filtering: Organize components with flexible tag system
  • โš™๏ธ Configuration: Environment-based configuration with Pydantic models

Quick Start

1. Setup Environment

# Clone or create the project
cd volutemcp

# Create and activate virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

2. Configure Environment

# Copy environment template
cp .env.example .env

# Edit .env with your settings
# SERVER_NAME=VoluteMCP
# SERVER_HOST=127.0.0.1
# SERVER_PORT=8000

3. Run the Server

HTTP Transport (Web Service)

python server.py

Server will be available at: http://127.0.0.1:8000

STDIO Transport (Local Tool)

python server.py stdio

Server Components

Tools

Tool Description Tags
echo Echo back messages for testing utility, public
calculate Safely evaluate math expressions math, utility
get_server_info Get server environment info system, info
format_text Format text (upper, lower, title, reverse) utility, text
process_json Process JSON (pretty, minify, keys, validate) data, json
get_timestamp Get timestamps in various formats system, time
list_operations Perform operations on string lists data, list
hash_text Generate text hashes (SHA256, SHA1, MD5) security, hash
encode_decode Encode/decode text (base64, URL, hex) development, base64

PowerPoint Tools

Advanced PowerPoint analysis and processing capabilities:

Tool Description
extract_powerpoint_metadata Extract comprehensive metadata from PowerPoint presentations
analyze_powerpoint_content Analyze content of specific slides or entire presentations
get_powerpoint_summary Get high-level summary of a PowerPoint presentation
validate_powerpoint_file Validate PowerPoint files and check for common issues

PowerPoint Features

  • Comprehensive Metadata Extraction: Core properties, slide dimensions, layout information
  • Shape Analysis: Position, size, formatting, and content of all shapes
  • Text Content: Fonts, colors, alignment, paragraph and run-level formatting
  • Multimedia Elements: Images with crop information, tables with cell data
  • Formatting Details: Fill, line, shadow formatting for all objects
  • Slide Structure: Master slides, layouts, notes, and comments
  • Content Summarization: Automatic extraction of slide titles and content
  • File Validation: Format checking, corruption detection, structural integrity

Resources

Static Resources

  • config://server - Server configuration
  • data://environment - Environment information
  • system://status - System status
  • data://sample-users - Sample user data
  • config://features - Available features

Resource Templates

  • users://{user_id} - Get user by ID
  • config://{section} - Get config section
  • data://{data_type}/summary - Get data summaries
  • logs://{log_level} - Get simulated logs
  • file://{file_path} - Read file contents (with safety checks)

Prompts

  • analyze_data - Generate data analysis prompts
  • code_review_prompt - Generate code review prompts

Custom HTTP Routes

  • GET /health - Health check endpoint
  • GET /info - Server information

Usage Examples

Using with MCP Clients

The server can be used with any MCP-compatible client. Here are some examples:

Call a Tool

# Using an MCP client library
result = client.call_tool("calculate", {"expression": "2 + 3 * 4"})
print(result)  # 14.0

Access a Resource

# Get server config
config = client.read_resource("config://server")
print(config)

# Get specific user
user = client.read_resource("users://1")
print(user)

Use a Prompt

# Generate analysis prompt
prompt = client.get_prompt("analyze_data", {
    "data_description": "Sales data for Q1 2024",
    "analysis_type": "trends"
})

PowerPoint Analysis

# Extract comprehensive metadata from a presentation
result = client.call_tool("extract_powerpoint_metadata", {
    "presentation_path": "./presentation.pptx",
    "include_slide_content": True,
    "output_format": "json"
})

# Get a quick summary of the presentation
summary = client.call_tool("get_powerpoint_summary", {
    "presentation_path": "./presentation.pptx"
})

# Analyze specific slides only
content = client.call_tool("analyze_powerpoint_content", {
    "presentation_path": "./presentation.pptx",
    "slide_numbers": [1, 3, 5],
    "extract_text_only": True
})

# Validate a PowerPoint file
validation = client.call_tool("validate_powerpoint_file", {
    "presentation_path": "./presentation.pptx"
})

Testing

The project includes a comprehensive test suite to validate all functionality:

Running Tests

# Run all tests using the test runner
python run_tests.py

# Or run tests directly
python tests/test_powerpoint_tools.py

# Using pytest (if installed)
pytest tests/

Test Coverage

The test suite validates:

  • โœ… All module imports work correctly
  • โœ… Pydantic data models function properly
  • โœ… PowerPoint tools register and integrate correctly
  • โœ… Server startup and configuration
  • โœ… Error handling for edge cases
  • โœ… FastMCP 2.0 async/await patterns

Test Results

  • 4 PowerPoint tools properly registered
  • 11 total tools available (including core tools)
  • 3 resources configured
  • 100% test pass rate

Development

Project Structure

volutemcp/
โ”œโ”€โ”€ server.py                    # Main server entry point
โ”œโ”€โ”€ server_modular.py           # Modular server implementation
โ”œโ”€โ”€ config.py                   # Configuration management
โ”œโ”€โ”€ tools.py                    # Core tool implementations
โ”œโ”€โ”€ resources.py                # Resource implementations
โ”œโ”€โ”€ powerpoint_metadata.py      # PowerPoint metadata extraction
โ”œโ”€โ”€ powerpoint_tools.py         # PowerPoint tool implementations
โ”œโ”€โ”€ tests/                      # Test directory
โ”‚   โ”œโ”€โ”€ __init__.py            # Test package initialization
โ”‚   โ”œโ”€โ”€ test_powerpoint_tools.py # PowerPoint tools test suite
โ”‚   โ””โ”€โ”€ README.md              # Test documentation
โ”œโ”€โ”€ run_tests.py               # Test runner script
โ”œโ”€โ”€ pytest.ini                # Pytest configuration
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ .env.example              # Environment template
โ”œโ”€โ”€ .gitignore               # Git ignore rules
โ””โ”€โ”€ README.md                # This file

Adding New Components

Add a Tool

# In tools.py
@mcp.tool(tags={"custom", "utility"})
def my_custom_tool(input_data: str) -> str:
    """My custom tool description."""
    return f"Processed: {input_data}"

Add a Resource

# In resources.py
@mcp.resource("custom://my-data")
def my_custom_resource() -> dict:
    """My custom resource description."""
    return {"data": "value"}

Add a Resource Template

# In resources.py
@mcp.resource("items://{item_id}")
def get_item(item_id: int) -> dict:
    """Get item by ID."""
    return {"id": item_id, "name": f"Item {item_id}"}

Configuration

The server uses Pydantic for configuration management. Settings can be provided via:

  1. Environment variables (prefixed with VOLUTE_)
  2. .env file
  3. Default values in config.py

Available Settings

Setting Default Description
VOLUTE_NAME VoluteMCP Server name
VOLUTE_HOST 127.0.0.1 Server host
VOLUTE_PORT 8000 Server port
VOLUTE_LOG_LEVEL INFO Logging level
VOLUTE_API_KEY None Optional API key

Tag-Based Filtering

Filter components by tags when creating the server:

# Only expose utility tools
mcp = FastMCP(include_tags={"utility"})

# Hide internal tools
mcp = FastMCP(exclude_tags={"internal"})

# Combine filters
mcp = FastMCP(include_tags={"public"}, exclude_tags={"deprecated"})

Advanced Usage

Server Composition

from fastmcp import FastMCP
from tools import register_tools

# Create modular servers
tools_server = FastMCP("ToolsOnly")
register_tools(tools_server)

# Mount into main server
main_server = FastMCP("Main")
main_server.mount(tools_server, prefix="tools")

Custom Serialization

import yaml

def yaml_serializer(data):
    return yaml.dump(data, sort_keys=False)

mcp = FastMCP(tool_serializer=yaml_serializer)

Deployment

Docker

FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

EXPOSE 8000
CMD ["python", "server.py"]

systemd Service

[Unit]
Description=VoluteMCP Server
After=network.target

[Service]
Type=simple
User=volute
WorkingDirectory=/opt/volutemcp
ExecStart=/opt/volutemcp/venv/bin/python server.py
Restart=always

[Install]
WantedBy=multi-user.target

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes with tests
  4. Submit a pull request

License

MIT License - see LICENSE file for details.

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

volutemcp-1.0.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

volutemcp-1.0.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file volutemcp-1.0.0.tar.gz.

File metadata

  • Download URL: volutemcp-1.0.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for volutemcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 930db9172ed29ca0b8dd5e770d5e190f4f0dc8c67aa507494525ab70a52c8d5b
MD5 719cb915b8eebe3f42c2153b010e3e39
BLAKE2b-256 bff19bc17969eaa01fd0b2e656080378af68aea12296c00d3fdfa0b6b2b0cf51

See more details on using hashes here.

File details

Details for the file volutemcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: volutemcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for volutemcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 415d128d2d73ebee0ae67875eb5c3a7f21fbf302da02b24f1a281d60f9417b1e
MD5 34f4718fdae2120e836ba3df8a89f805
BLAKE2b-256 3454af79974d20c562a32ea6e2757d562238e9b74a3fbaa09373e344f5623c2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page