=============== LIBRARY RULES =============== From library maintainers: - Use Python 3.8+ for compatibility - Run MCP server with: python pomera_mcp_server.py - All MCP tools are prefixed with 'pomera_' - Tool parameters use snake_case naming - Supports stdio transport for MCP communication ### Example GET Request Configuration Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Demonstrates the configuration for a simple GET request to fetch user data. It specifies the HTTP method, URL, and expected response structure. ```json { "method": "GET", "url": "https://jsonplaceholder.typicode.com/users/1", "headers": {}, "body": null, "auth": null } ``` -------------------------------- ### Custom Font Installation Example (JSON) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This JSON snippet demonstrates how to specify custom font settings, including font family, size, style, and weight. It allows users to integrate their preferred fonts into the application. ```json { "font_settings": { "text_font": { "family": "Your Custom Font", "size": 12, "style": "normal", // normal, bold, italic "weight": "normal" // normal, bold, light } } } ``` -------------------------------- ### Example: Email Extraction and Formatting Pipeline Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/FEATURE_GUIDE.md Illustrates an 'Extract and Format Emails' pipeline that extracts emails, sorts them alphabetically, and removes duplicates, followed by execution. ```python email_extract_pipeline = { "name": "Extract and Format Emails", "steps": [ {"tool": "pomera_extract_emails", "operation": "extract"}, {"tool": "pomera_sort", "operation": "alphabetical"}, {"tool": "pomera_line_tools", "operation": "deduplicate"} ] } email_list = executor.execute_pipeline(raw_text, email_extract_pipeline) ``` -------------------------------- ### Example: Document Preparation Pipeline Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/FEATURE_GUIDE.md Defines a 'Document Preparation' pipeline that normalizes whitespace, sets sentence case, wraps text to a specified width, and numbers the lines. ```python doc_prep_pipeline = { "name": "Document Preparation", "steps": [ {"tool": "pomera_whitespace", "operation": "normalize"}, {"tool": "pomera_case_transform", "operation": "sentence"}, {"tool": "pomera_text_wrap", "operation": "wrap", "params": {"width": 80}}, {"tool": "pomera_line_tools", "operation": "number", "params": {"start": 1}} ] } ``` -------------------------------- ### Example: Code Cleanup Pipeline Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/FEATURE_GUIDE.md An example demonstrating the creation of a 'Code Cleanup' pipeline which normalizes whitespace, removes empty lines, and trims lines, then executes it. ```python code_cleanup_pipeline = { "name": "Code Cleanup", "steps": [ {"tool": "pomera_whitespace", "operation": "normalize"}, {"tool": "pomera_line_tools", "operation": "remove_empty"}, {"tool": "pomera_line_tools", "operation": "trim"} ] } cleaned_code = executor.execute_pipeline(messy_code, code_cleanup_pipeline) ``` -------------------------------- ### HuggingFace AI Library Installation Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Installs the necessary HuggingFace Hub library for interacting with HuggingFace models. This is a prerequisite for configuring HuggingFace AI in Pomera. ```bash pip install huggingface_hub ``` -------------------------------- ### Google AI (Gemini) Configuration Example (Conceptual) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This conceptual example outlines the parameters and models available for interacting with Google's Gemini AI. It demonstrates how to specify models and control generation parameters like temperature and topP. ```json { "provider": "google", "model": "gemini-1.5-pro-latest", "api_endpoint": "https://generativelanguage.googleapis.com/v1beta/models/", "parameters": { "temperature": 0.7, "topK": 40, "topP": 0.9, "candidateCount": 1, "maxOutputTokens": 1024 } } ``` -------------------------------- ### Improve Sentence with Google AI Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This example demonstrates a basic AI request using Google AI's Gemini model. It details the setup steps, including selecting the provider, entering an API key, choosing a model, and setting a system prompt. The input is a sentence for improvement, and the expected response provides several enhanced versions with explanations. ```text Please help me improve this sentence: "The cat was walking on the street." ``` -------------------------------- ### Bash Basic Installation Script Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md A sequence of shell commands to perform a basic installation of Pomera AI Commander, including installing Python, downloading application files, installing core dependencies, and running the application. ```bash # Install all optional dependencies pip install reportlab python-docx requests # Run Application: python pomera_ai.py ``` -------------------------------- ### Install Dependencies Command Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Command to install project dependencies from a requirements file. This is a crucial step for troubleshooting application startup problems and ensuring all necessary libraries are present. ```bash pip install -r requirements.txt ``` -------------------------------- ### MCP Protocol Examples (JSON) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/FEATURE_GUIDE.md Illustrates the MCP protocol for interacting with tools via the server interface. It shows example JSON requests for listing tools and calling a tool, along with a sample response. This protocol is used by external AI assistants to programmatically call tools. ```json // tools/list request {"jsonrpc": "2.0", "id": 1, "method": "tools/list"} // tools/call request {"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {"name": "pomera_case_transform", "arguments": {"text": "hello", "op": "upper"}}} // Response {"jsonrpc": "2.0", "id": 2, "result": {"content": [{"type": "text", "text": "HELLO"}]}} ``` -------------------------------- ### Provider Configuration Dictionary Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md An example snippet from the `ai_providers` dictionary, showcasing configurations for Google AI, Vertex AI, AWS Bedrock, and LM Studio. It highlights differences in URL templates, headers, and specific flags like `local_service` and `aws_service`. ```python self.ai_providers = { "Google AI": { "url_template": "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}", "headers_template": {'Content-Type': 'application/json'}, "api_url": "https://aistudio.google.com/apikey" }, "Vertex AI": { "url_template": "https://{location}-aiplatform.googleapis.com/v1/projects/{project_id}/locations/{location}/publishers/google/models/{model}:generateContent", "headers_template": {'Content-Type': 'application/json', 'Authorization': 'Bearer {access_token}'}, "api_url": "https://cloud.google.com/vertex-ai/docs/authentication" }, "AWS Bedrock": { "url": "https://bedrock-runtime.{region}.amazonaws.com/model/{model}/invoke", "headers_template": {"Content-Type": "application/json"}, "api_url": "https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html", "aws_service": true }, "LM Studio": { "url_template": "{base_url}/v1/chat/completions", "headers_template": {"Content-Type": "application/json"}, "api_url": "http://lmstudio.ai/", "local_service": true } # ... other providers } ``` -------------------------------- ### Install PyAudio and Numpy for Audio Playback Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Installs the necessary Python packages, PyAudio and numpy, which are required for audio playback functionality within the application. This is a prerequisite for features that involve sound. ```shell pip install pyaudio numpy ``` -------------------------------- ### Bash Full Installation Script Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md A single shell command to install all optional dependencies for Pomera AI Commander, enabling all features of the application. ```bash # Install all optional dependencies pip install reportlab python-docx requests huggingface_hub pyaudio numpy psutil memory_profiler ``` -------------------------------- ### Extract Any Protocol URLs - Python Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This Python example utilizes regular expressions to find URLs with any protocol prefix (e.g., ftp://, mailto:, file://) within a text. This provides broader URL capturing capabilities. ```python import re def extract_any_protocol_urls(text): pattern = r'\b[a-zA-Z][a-zA-Z0-9+.-]*://[^\s"{}|\\^`\[\]]+' urls = re.findall(pattern, text) return urls text_with_protocols = "Check ftp://fileserver.net or mailto:user@domain.com" print(extract_any_protocol_urls(text_with_protocols)) ``` -------------------------------- ### MCP Client Configuration Source: https://context7.com/matbanik/pomera-ai-commander/llms.txt Configuration examples for integrating Pomera AI Commander with popular AI clients like Cursor IDE and Claude Desktop, and alternative installation methods. ```APIDOC ## MCP Client Configuration ### Description Configuration examples for integrating Pomera AI Commander with popular AI clients like Cursor IDE and Claude Desktop, and alternative installation methods. ### Method Configuration File / Command Line ### Endpoint N/A ### Parameters #### Cursor IDE Configuration - **`mcpServers.pomera.command`** (string) - The command to execute (e.g., `python`). - **`mcpServers.pomera.args`** (array of strings) - Arguments for the command, including the path to the server script. #### Claude Desktop Configuration - **`mcpServers.pomera.command`** (string) - The command to execute (e.g., `python`). - **`mcpServers.pomera.args`** (array of strings) - Arguments for the command, including the path to the server script (adjust path for Windows/macOS/Linux). #### NPM Package Installation - **`npm install -g pomera-ai-commander`** - Installs the package globally. - **`npx pomera-ai-commander`** - Runs the package without global installation. ### Request Example ```json // Cursor IDE configuration (config.json) { "mcpServers": { "pomera": { "command": "python", "args": ["/path/to/Pomera-AI-Commander/pomera_mcp_server.py"] } } } // Claude Desktop configuration (config.json) { "mcpServers": { "pomera": { "command": "python", "args": ["C:/Users/YourName/Pomera-AI-Commander/pomera_mcp_server.py"] } } } ``` ### Response #### Success Response - **Successful Connection** - The AI client connects to the Pomera MCP server. #### Response Example ``` # Example command for npx npx pomera-ai-commander ``` ``` -------------------------------- ### Example POST Request with JSON Body Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Illustrates setting up a POST request with a JSON body to create a new user. It includes specifying the Content-Type and Accept headers, the JSON payload, and expected success response. ```json { "method": "POST", "url": "https://api.example.com/users", "headers": { "Content-Type": "application/json", "Accept": "application/json" }, "body": { "name": "Alice Johnson", "email": "alice@example.com", "role": "developer" }, "auth": null } ``` -------------------------------- ### Example Authenticated Request (Bearer Token) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Shows how to configure an authenticated GET request using a Bearer Token for accessing protected resources. It details the URL, the authentication type, and the required token, along with the automatically generated Authorization header. ```json { "method": "GET", "url": "https://api.github.com/user", "headers": {}, "body": null, "auth": { "type": "Bearer Token", "token": "ghp_1234567890abcdefghijklmnopqrstuvwxyz" } } ``` -------------------------------- ### Expose Tools via MCP Server (Python) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/FEATURE_GUIDE.md This Python code snippet demonstrates how to expose tools using the FastMCP framework. It defines two tools, 'pomera_case_transform' and 'pomera_extract_emails', and starts the MCP server to handle requests. Dependencies include the 'mcp.server.fastmcp' module. ```python from mcp.server.fastmcp import FastMCP mcp = FastMCP("pomera") @mcp.tool() def pomera_case_transform(text: str, op: str) -> str: if op == "upper": return text.upper() if op == "lower": return text.lower() if op == "title": return text.title() @mcp.tool() def pomera_extract_emails(text: str) -> str: import re return "\n".join(re.findall(r'[\w.-]+@[\w.-]+\.\w+', text)) if __name__ == "__main__": mcp.run(transport='stdio') ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TROUBLESHOOTING.md Install required Python dependencies for the project using pip. This includes installing from a requirements file or manually listing packages. ```bash # Install required dependencies pip install -r requirements.txt # If requirements.txt doesn't exist, install manually: pip install tkinter requests reportlab python-docx ``` -------------------------------- ### Any Protocol URL Extraction Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Shows how to configure the extractor to capture URLs with any protocol scheme (e.g., http, https, ftp, mailto, file, ssh). The input includes various protocols, and the output lists all detected URLs regardless of their scheme. ```text Web: https://example.com FTP: ftp://files.example.com Email: mailto:contact@example.com File: file:///C:/documents/file.txt SSH: ssh://user@server.com ``` -------------------------------- ### Email Header Analysis Examples (Input/Output) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Demonstrates the input raw email headers and the structured output produced by the analysis tool, covering basic information, server hops, authentication results, and security assessments. ```text Input: ``` Received: from mx2.recipient.com (mx2.recipient.com [10.0.0.2]) by mail.recipient.com (Postfix) with ESMTP id 67890 for ; Mon, 1 Jan 2024 12:00:05 +0000 Received: from relay.isp.com (relay.isp.com [203.0.113.50]) by mx2.recipient.com (Postfix) with ESMTP id 54321 for ; Mon, 1 Jan 2024 12:00:03 +0000 Received: from mail.sender.com (mail.sender.com [198.51.100.10]) by relay.isp.com (Postfix) with ESMTP id 98765 for ; Mon, 1 Jan 2024 12:00:01 +0000 From: sender@sender.com To: user@recipient.com Subject: Multi-hop Email Authentication-Results: mx2.recipient.com; spf=pass smtp.mailfrom=sender.com; dkim=fail reason="signature verification failed"; dmarc=fail policy.dmarc=quarantine X-Spam-Status: No, score=2.1 required=5.0 ``` Output: ``` === EMAIL HEADER ANALYSIS === --- Basic Information --- From: sender@sender.com To: user@recipient.com Subject: Multi-hop Email --- Server Hops (3 total) --- Hop 1: mx2.recipient.com [10.0.0.2] Received: Mon, 1 Jan 2024 12:00:05 +0000 Hop 2: relay.isp.com [203.0.113.50] Received: Mon, 1 Jan 2024 12:00:03 +0000 Delay from previous: 2 seconds Hop 3: mail.sender.com [198.51.100.10] Received: Mon, 1 Jan 2024 12:00:01 +0000 Delay from previous: 2 seconds --- Delivery Timeline --- Total delivery time: 4 seconds Average hop delay: 2 seconds --- Authentication Results --- SPF: PASS DKIM: FAIL DMARC: FAIL --- Security Assessment --- Authentication Status: INSECURE (Failed: DKIM, DMARC) DMARC Policy: QUARANTINE --- Technical Details --- X-Spam-Status: No, score=2.1 required=5.0 --- Summary --- Total Hops: 3 Total Delivery Time: 4 seconds Spam Score: 2.1 (Not Spam) Authentication: Mixed Results ``` ``` ```text Input: ``` Received: from server2.com (server2.com [192.168.1.2]) by server3.com (Postfix) with ESMTP for ; Mon, 1 Jan 2024 12:00:10 +0000 Received: from server1.com (server1.com [192.168.1.1]) by server2.com (Postfix) with ESMTP for ; Mon, 1 Jan 2024 12:00:15 +0000 ``` Output: ``` --- Server Hops (2 total) --- Hop 1: server2.com [192.168.1.2] Received: Mon, 1 Jan 2024 12:00:10 +0000 Hop 2: server1.com [192.168.1.1] Received: Mon, 1 Jan 2024 12:00:15 +0000 WARNING: Clock skew detected (5 seconds) ``` ``` -------------------------------- ### Handle No Email Headers - Python Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Demonstrates how to handle cases where no email headers are found in the input. This is crucial for robust error handling and providing user-friendly feedback. ```python def analyze_email_headers(email_content): if not email_content or 'From:' not in email_content: return "No email headers found." # ... proceed with header analysis ... return "Analysis results..." plain_text_input = "This is just plain text without email headers." result = analyze_email_headers(plain_text_input) print(result) ``` -------------------------------- ### Progress Tracking Callback Example (Python) Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Illustrates how to implement and use a progress callback function with the `AsyncTextProcessor`. The callback receives information about the current chunk being processed and the total number of chunks, allowing for real-time progress updates to be displayed to the user. ```python def progress_callback(current_chunk, total_chunks): progress_percent = (current_chunk / total_chunks) * 100 print(f"Processing: {progress_percent:.1f}% complete") processor.process_text_async( context=context, processor_func=text_processing_function, callback=completion_callback, progress_callback=progress_callback ) ``` -------------------------------- ### Install PyAudio for Morse Code Audio Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This command installs the PyAudio library, which is necessary for handling audio playback, specifically for Morse code functionality. Ensure pip is available and configured correctly. ```shell pip install pyaudio ``` -------------------------------- ### Regex Email Replacement Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Demonstrates replacing email addresses using a regular expression pattern with a placeholder string. ```regex Input: ``` Contact us at john@example.com or mary@test.org Phone: 555-123-4567 or 555-987-6543 ``` Configuration: - Find: `\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b` (email regex) - Replace: `[EMAIL REMOVED]` - Mode: Regex - Options: Ignore case Output: ``` Contact us at [EMAIL REMOVED] or [EMAIL REMOVED] Phone: 555-123-4567 or 555-987-6543 ``` ``` -------------------------------- ### Filtered URL Extraction Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Illustrates the filtering capability of the URL extractor. By setting a `filter_text`, only URLs containing the specified string (case-insensitive) are returned. This example filters for URLs containing 'example.com'. ```text https://example.com/page1 https://google.com/search https://example.com/page2 https://github.com/project https://example.com/api ``` -------------------------------- ### Example Output: Strong Password Generation Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md This is an example of a cryptographically secure and randomly generated password. The output adheres to the specified length and character distribution requirements, ensuring a robust password for user accounts or API keys. ```plaintext aB3xY9mN2pQ5rT#k ``` -------------------------------- ### Default Configuration Settings Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Displays the default configuration settings for the comparison tool, specifying the initial comparison mode. This JSON object indicates that the default behavior is to 'ignore_case'. ```json { "option": "ignore_case" } ``` -------------------------------- ### Monitor and Control Tasks - Python Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Demonstrates how to retrieve the number of active tasks, get detailed information about each task including its tool name and content size, and wait for all tasks to complete within a specified timeout. This is crucial for understanding the current workload and ensuring operations finish in a timely manner. ```python # Get active task count active_count = processor.get_active_task_count() print(f"Currently processing {active_count} tasks") # Get detailed task information task_info = processor.get_active_task_info() for task_id, info in task_info.items(): print(f"Task {task_id}: {info['tool_name']} - {info['content_size']} bytes") # Wait for all tasks to complete completed = processor.wait_for_completion(timeout=30.0) if not completed: print("Some tasks are still running after timeout") ``` -------------------------------- ### HTTP and HTTPS URL Extraction Example Source: https://github.com/matbanik/pomera-ai-commander/blob/master/docs/TOOLS_DOCUMENTATION.md Illustrates the configuration for extracting only HTTP and HTTPS URLs from a given text. The example input contains a mix of protocols, but the output is filtered to include only the specified secure and unsecure web protocols. ```text Visit https://example.com for more info. Download from ftp://files.example.com/data.zip Email us at mailto:contact@example.com Check out https://github.com/project ```