### Example: Create a file using claude_code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This is a shell command example demonstrating how to use the 'claude_code' tool to create an 'index.html' file populated with a basic HTML5 template. ```shell Use claude_code to create index.html with a basic HTML5 template ``` -------------------------------- ### Make Start Script Executable (Bash) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md This command makes the `start.sh` script executable, allowing it to be run directly. This is part of the setup for running the server from a cloned repository. ```bash chmod +x start.sh ``` -------------------------------- ### Example: Run a git operation using claude_code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This shell command example shows how to utilize the 'claude_code' tool to perform a Git commit operation, specifying the commit message as 'Initial commit'. ```shell Use claude_code to commit all changes with message "Initial commit" ``` -------------------------------- ### Clone Repository and Install Dependencies (Bash) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Steps to clone the project repository using Git and install project dependencies using npm. This is a foundational step for both local development methods. ```bash git clone https://github.com/steipete/claude-code-mcp.git # Or your fork/actual repo URL cd claude-code-mcp npm install ``` -------------------------------- ### Bash Command for Environment Setup Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Shows an example of a fully executable bash command generated by the converter. This command handles changing the directory, creating a virtual environment, activating it, and installing project dependencies. ```bash cd /home/user/project && source .venv/bin/activate ``` -------------------------------- ### Example: Convert markdown tasks using convert_task_markdown Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This shell command example illustrates how to invoke the 'convert_task_markdown' tool to process a local markdown file named 'my tasks.md' and convert its contents into executable MCP commands. ```shell Use convert_task_markdown to convert my tasks.md file to MCP commands ``` -------------------------------- ### Install Claude CLI Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Installs the Claude CLI globally using npm. This is a prerequisite for the first-time setup. ```bash npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Configure MCP Client for start.sh (JSON) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Configuration for the MCP client to use the `start.sh` script as the server command. This involves updating the `mcp.json` file with the correct command path and arguments. ```json { "mcpServers": { "claude_code": { "type": "stdio", "command": ["/absolute/path/to/claude-mcp-server/start.sh"], "args": [] } // ... other MCP server configurations } } ``` -------------------------------- ### Automated Task Conversion Example Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This JSON array represents the output of the 'convert_task_markdown' tool, transforming a markdown task list into a sequence of 'claude_code' tool executions. Each object in the array details a specific command, its arguments, and the working directory. ```json [ { "tool": "claude_code", "arguments": { "prompt": "cd /project && create auth_module.py...", "workFolder": "/project" } }, { "tool": "claude_code", "arguments": { "prompt": "cd /project && add login endpoint to api/routes.py...", "workFolder": "/project" } } // ... more tasks ] ``` -------------------------------- ### Execute Claude Code Commands Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This JSON object demonstrates how to use the 'claude_code' tool to execute system commands. It includes a 'prompt' for the command to run and a 'workFolder' to specify the execution directory. ```json { "prompt": "Create a new Python file hello.py that prints 'Hello World'", "workFolder": "/path/to/project" } ``` -------------------------------- ### Build and Link Package for Local Development (Bash/JavaScript) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Commands to install dependencies, build the TypeScript project, and then link the package locally using `npm link`. This makes the globally installed command point to the local development version. ```bash npm install npm run build npm link ``` -------------------------------- ### Run Claude CLI with Permissions Skip (Bash) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Command to run the Claude CLI with a flag to skip permissions, necessary for first-time setup or to accept terms. This is a prerequisite for using the server. ```bash claude -p "hello" --dangerously-skip-permissions # Or ~/.claude/local/claude -p "hello" --dangerously-skip-permissions ``` -------------------------------- ### Configure Claude Code MCP Enhanced via GitHub URL Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This JSON snippet shows how to add the Claude Code MCP Enhanced project to your MCP configuration file using its GitHub URL. It specifies the command to use ('npx'), the GitHub repository, and debug environment variables. ```json { "mcpServers": { "claude-code-mcp-enhanced": { "command": "npx", "args": ["github:grahama1970/claude-code-mcp-enhanced"], "env": { "MCP_CLAUDE_DEBUG": "false" } } } } ``` -------------------------------- ### Local Installation Commands Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Commands to clone the repository, install dependencies, and build the Claude Code MCP server locally. This is useful for development or testing purposes. It involves standard git and npm commands. ```bash git clone https://github.com/grahama1970/claude-code-mcp-enhanced.git cd claude-code-mcp-enhanced npm install npm run build ``` -------------------------------- ### Configure MCP Client for Linked Command (JSON) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Configuration for the MCP client to use the globally linked `claude-code-mcp` command. This involves updating `mcp.json` to specify the command and optional environment variables. ```json { "mcpServers": { "claude_code": { "type": "stdio", "command": ["claude-code-mcp"], "args": [], "env": { "MCP_CLAUDE_DEBUG": "false" // Or "true" for debugging // You can set other ENV VARS here too if needed for the linked command } } } } ``` -------------------------------- ### Convert Markdown Task Lists to MCP Commands Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This JSON object specifies the input for the 'convert_task_markdown' tool, indicating the path to a markdown file containing human-readable tasks that need to be converted into MCP-compliant JSON commands for sequential execution. ```json { "markdownPath": "/path/to/tasks.md" } ``` -------------------------------- ### Rebuild Project After Changes (Bash) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/local_install.md Command to rebuild the project after making changes to the TypeScript source files. This is necessary for the `npm link` version to reflect the latest modifications. ```bash npm run build ``` -------------------------------- ### Markdown Task File Format Example Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Provides an example of the required markdown structure for task files. It includes sections for the task title, objective, requirements, and the core tasks with indented steps for validation. ```markdown # Task 001: API Endpoint Validation ## Objective Validate all API endpoints work with real database connections. ## Requirements 1. [ ] All endpoints must use real database 2. [ ] No mock data in validation ## Core API Tasks - [ ] Validate `api/users.py` - [ ] Change directory to project and activate .venv - [ ] Test user creation endpoint - [ ] Test user retrieval endpoint - [ ] Verify JSON responses ``` -------------------------------- ### Configure Local MCP Server Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example JSON configuration for an MCP client to connect to a local Claude Code MCP server. It specifies the command to run the server and environment variables. ```json { "mcpServers": { "Local MCP Server": { "type": "stdio", "command": "node", "args": [ "dist/server.js" ], "env": { "MCP_USE_ROOMODES": "true", "MCP_WATCH_ROOMODES": "true", "MCP_CLAUDE_DEBUG": "false" } }, "other-services": { // Your other MCP services here } } } ``` -------------------------------- ### Test ArangoDB Connection and Setup Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Tests the ArangoDB connection and setup functions in `core/arango_setup.py`. This includes removing mock code, establishing a connection to a real ArangoDB instance, and verifying database, collection, and view creation. ```Python import os import sys from arango import ArangoClient # Add project root to sys.path project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) sys.path.insert(0, project_root) from core.constants import ARANGO_URL, ARANGO_USER, ARANGO_PASSWORD, ARANGO_DB_NAME def setup_arango_connection(): print("Setting up ArangoDB connection...") try: client = ArangoClient(hosts=ARANGO_URL) db = client.db(ARANGO_DB_NAME, username=ARANGO_USER, password=ARANGO_PASSWORD) print("Successfully connected to ArangoDB.") return db except Exception as e: print(f"Error connecting to ArangoDB: {e}") return None def create_collections_and_views(db): if db is None: return print("Creating/verifying collections and views...") try: # Example: Create a document collection if it doesn't exist if not db.has_collection('my_documents'): db.create_collection('my_documents') print("Collection 'my_documents' created.") else: print("Collection 'my_documents' already exists.") # Example: Create a edge collection if it doesn't exist if not db.has_collection('my_edges', edge=True): db.create_collection('my_edges', edge=True) print("Edge collection 'my_edges' created.") else: print("Edge collection 'my_edges' already exists.") # Example: Create a view if it doesn't exist (requires ArangoSearch setup) # This is a placeholder, actual view creation depends on your schema and ArangoSearch configuration # try: # if not db.has_view('my_view'): # db.create_view('my_view', collection_name='my_documents', primary_sort={'field': '_key', 'direction': 'asc'}) # print("View 'my_view' created.") # else: # print("View 'my_view' already exists.") # except Exception as view_e: # print(f"Could not create view (may require ArangoSearch setup): {view_e}") print("Collections and views setup complete.") except Exception as e: print(f"Error during collection/view setup: {e}") if __name__ == "__main__": # Assuming the script is run from the project root or a subdirectory # Adjust the path if necessary db_connection = setup_arango_connection() create_collections_and_views(db_connection) ``` -------------------------------- ### MCP Server Configuration (Local Installation) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Configuration for the Claude Code MCP server when installed locally. This method points to the built server file. It specifies the command (`node`), the path to the server script, and environment variables for debugging, heartbeat interval, and execution timeout. ```json { "mcpServers": { "claude-code-mcp-enhanced": { "command": "node", "args": [ "/path/to/claude-code-mcp-enhanced/dist/server.js" ], "env": { "MCP_CLAUDE_DEBUG": "false", "MCP_HEARTBEAT_INTERVAL_MS": "15000", "MCP_EXECUTION_TIMEOUT_MS": "1800000" } } } } ``` -------------------------------- ### Fix ESLint Setup with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Demonstrates using the Claude Code MCP tool to interactively fix an ESLint setup by deleting old configuration files and creating a new one. This involves file system operations managed by the tool. ```Shell # Example command to fix ESLint setup (conceptual, actual interaction is via Claude) # claude_code --fix-eslint ``` -------------------------------- ### Accept Claude CLI Permissions Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Runs the Claude CLI with a flag to skip permissions, allowing manual acceptance. This is a one-time setup step required for the MCP server to function correctly. ```bash claude --dangerously-skip-permissions ``` -------------------------------- ### Check Claude Code Server Health Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/QUICKSTART.md This JSON object shows how to use the 'health' tool, specifically targeting 'claude_code:health', to check the status of the Claude Code server. ```json { "toolName": "claude_code:health" } ``` -------------------------------- ### Example Health Check Response Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example JSON response from the Claude Code MCP server's health tool, showing status, version, CLI availability, configuration, and system information. ```json { "status": "ok", "version": "1.12.0", "claudeCli": { "path": "claude", "status": "available" }, "config": { "debugMode": true, "heartbeatIntervalMs": 15000, "executionTimeoutMs": 1800000, "useRooModes": true, "maxRetries": 3, "retryDelayMs": 1000 }, "system": { "platform": "linux", "release": "6.8.0-57-generic", "arch": "x64", "cpus": 16, "memory": { "total": "32097MB", "free": "12501MB" }, "uptime": "240 minutes" }, "timestamp": "2025-05-15T18:30:00.000Z" } ``` -------------------------------- ### Sample Task Data Structure Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/claude-code-orchestrator.md An example of a detailed task.json structure that Claude Code would maintain during project execution, including task status, timestamps, and logs. ```json { "project": "Recipe Converter App", "description": "Create a simple web app that converts recipe measurements", "status": "in_progress", "tasks": [ { "id": "task-1", "description": "Create HTML structure", "status": "completed", "completedAt": "2025-05-15T14:30:00Z", "outputs": [ "index.html" ] }, { "id": "task-2", "description": "Implement conversion logic", "status": "in_progress", "startedAt": "2025-05-15T14:35:00Z" }, { "id": "task-3", "description": "Add styling", "status": "pending" } ], "logs": [ { "timestamp": "2025-05-15T14:25:00Z", "message": "Project started" }, { "timestamp": "2025-05-15T14:30:00Z", "message": "Task 1 completed: Created HTML with form for recipe inputs" } ] } ``` -------------------------------- ### JSON: Find Recipe Task Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example JSON payload for delegating a task to Claude Code to find a recipe. It includes the tool name, prompt, a parent task ID, return mode, and a task description. ```json { "toolName": "claude_code:claude_code", "arguments": { "prompt": "Search for a classic chocolate cake recipe. Find one with good reviews.", "parentTaskId": "cake-recipe-123", "returnMode": "summary", "taskDescription": "Find Chocolate Cake Recipe" } } ``` -------------------------------- ### Basic Code Operation Request Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example MCP request to the `claude_code` tool, providing a prompt to refactor a Python function and specifying the working directory. ```json { "toolName": "claude_code:claude_code", "arguments": { "prompt": "Your work folder is /path/to/project\n\nRefactor the function foo in main.py to be async.", "workFolder": "/path/to/project" } } ``` -------------------------------- ### Python Type Hinting Examples Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/CLAUDE.md Demonstrates correct usage of type hints in Python functions for parameters and return values, emphasizing clarity and the use of concrete types over 'Any'. It also shows when type hints are not necessary due to obvious type inference. ```Python from typing import Dict, List, Optional, Union, Tuple def process_document(doc_id: str, options: Optional[Dict[str, str]] = None) -> Dict[str, Any]: """Process a document with optional configuration.""" # Implementation return result # Simple types don't need annotations inside functions if obvious: def get_user_name(user_id: int) -> str: name = "John" # Type inference works here, no annotation needed return name ``` -------------------------------- ### Move/Copy/Delete File with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Shows how to perform file system management tasks like moving, copying, or deleting files using Claude Code. This example focuses on moving and renaming a file. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project\n\nMove the file 'report.docx' from the 'drafts' folder to the 'final_reports' folder and rename it to 'Q1_Report_Final.docx'." ``` -------------------------------- ### Python Validation & Testing Example Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/CLAUDE.md Demonstrates correct Python code for validating functionality by testing inputs against expected outputs and tracking failures. It includes examples for basic functionality, edge cases, and error handling, ensuring that validation failures are reported and the script exits appropriately. ```Python import sys # List to track all validation failures all_validation_failures = [] total_tests = 0 # Test 1: Basic functionality total_tests += 1 test_data = "example input" result = process_data(test_data) expected = {"key": "processed value"} if result != expected: all_validation_failures.append(f"Basic test: Expected {expected}, got {result}") # Test 2: Edge case handling total_tests += 1 edge_case = "empty" edge_result = process_data(edge_case) edge_expected = {"key": ""} if edge_result != edge_expected: all_validation_failures.append(f"Edge case: Expected {edge_expected}, got {edge_result}") # Test 3: Error handling total_tests += 1 try: error_result = process_data(None) all_validation_failures.append("Error handling: Expected exception for None input, but no exception was raised") except ValueError: # This is expected - test passes pass except Exception as e: all_validation_failures.append(f"Error handling: Expected ValueError for None input, but got {type(e).__name__}") # Final validation result if all_validation_failures: print(f"❌ VALIDATION FAILED - {len(all_validation_failures)} of {total_tests} tests failed:") for failure in all_validation_failures: print(f" - {failure}") sys.exit(1) # Exit with error code else: print(f"✅ VALIDATION PASSED - All {total_tests} tests produced expected results") print("Function is validated and formal tests can now be written") sys.exit(0) # Exit with success code ``` -------------------------------- ### JSON: Convert Measurements Task Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example JSON payload for delegating a task to Claude Code to convert recipe measurements. It specifies the prompt with measurements, parent task ID, return mode, and task description. ```json { "toolName": "claude_code:claude_code", "arguments": { "prompt": "Convert the measurements in this recipe from cups to grams:\n\n- 2 cups flour\n- 1.5 cups sugar\n- 3/4 cup cocoa powder", "parentTaskId": "cake-recipe-123", "returnMode": "summary", "taskDescription": "Convert Recipe Measurements" } } ``` -------------------------------- ### Generate Python Script with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Example of using Claude Code to generate a Python script for parsing CSV data and outputting JSON. This highlights code generation capabilities. ```Python # Prompt example for Claude Code: # "Generate a Python script to parse CSV data and output JSON." ``` -------------------------------- ### MCP Server Configuration (npm Package) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Configuration for the Claude Code MCP server using an npm package. This method installs the latest version of the package. It defines the command (`npx`), arguments including the npm package name, and environment variables for debugging, heartbeat interval, and execution timeout. ```json { "mcpServers": { "claude-code-mcp-enhanced": { "command": "npx", "args": [ "-y", "@grahama1970/claude-code-mcp-enhanced@latest" ], "env": { "MCP_CLAUDE_DEBUG": "false", "MCP_HEARTBEAT_INTERVAL_MS": "15000", "MCP_EXECUTION_TIMEOUT_MS": "1800000" } } } } ``` -------------------------------- ### Analyze and Refactor Python Script with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Example of using Claude Code to analyze a Python script for potential bugs and suggest improvements. This showcases code analysis and refactoring capabilities. ```Python # Prompt example for Claude Code: # "Analyze my_script.py for potential bugs and suggest improvements." ``` -------------------------------- ### Complex Multi-Step Operations with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Showcases the Claude Code tool's ability to handle intricate, multi-step tasks. An example includes preparing a release by creating a branch, updating multiple files (package.json, CHANGELOG.md), committing changes, and initiating a pull request. ```Shell # Example of a complex multi-step operation (conceptual, actual interaction is via Claude) # claude_code --prepare-release --version 1.2.0 --message "feat: Initial release" ``` -------------------------------- ### Specialized Mode Request (Roo Mode) for Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md An example of a specialized request to the 'claude_code' tool using a specific mode, 'coder'. This request includes a prompt for creating unit tests and specifies the working directory. ```json { "toolName": "claude_code:claude_code", "arguments": { "prompt": "Your work folder is /path/to/project\n\nCreate unit tests for the user authentication module.", "workFolder": "/path/to/project", "mode": "coder" } } ``` -------------------------------- ### MCP Server Configuration with Roo Modes Enabled Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Example of configuring the MCP server to use the 'claude-code-mcp-enhanced' project. It demonstrates enabling Roo modes integration and hot-reloading of the .roomodes configuration via environment variables within the server's configuration. ```json { "mcpServers": { "claude-code-mcp-enhanced": { "command": "npx", "args": ["github:grahama1970/claude-code-mcp-enhanced"], "env": { "MCP_USE_ROOMODES": "true", "MCP_WATCH_ROOMODES": "true", "MCP_CLAUDE_DEBUG": "false" } } } } ``` -------------------------------- ### Convert Markdown Task to JSON Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Demonstrates how to use the 'convert_task_markdown' tool to process a markdown file containing task definitions and convert it into an executable JSON format for the Claude Code tool. It includes an example of specifying the markdown file path. ```json { "tool": "convert_task_markdown", "arguments": { "markdownPath": "/project/tasks/api_validation.md" } } ``` -------------------------------- ### MCP Server Configuration (GitHub URL) Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Configuration for the Claude Code MCP server using a GitHub URL. This method ensures you always use the latest version from the repository. It specifies the command to execute (`npx`), arguments including the GitHub repository, and environment variables for debugging, heartbeat interval, and execution timeout. ```json { "mcpServers": { "claude-code-mcp-enhanced": { "command": "npx", "args": [ "github:grahama1970/claude-code-mcp-enhanced" ], "env": { "MCP_CLAUDE_DEBUG": "false", "MCP_HEARTBEAT_INTERVAL_MS": "15000", "MCP_EXECUTION_TIMEOUT_MS": "1800000" } } } } ``` -------------------------------- ### Run Terminal Commands with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Illustrates executing arbitrary terminal commands using Claude Code. This includes running build scripts and opening URLs in the default browser. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project/frontend\n\nRun the command 'npm run build'." ``` ```Shell # Prompt example for Claude Code: # "Open the URL https://developer.mozilla.org in my default web browser." ``` -------------------------------- ### Create Entry Script for Orchestration Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/claude-code-orchestrator.md A bash script to initiate the Claude Code orchestration process. It defines the initial project tasks in a JSON file and launches the orchestrator with a specific prompt. ```bash #!/bin/bash # orchestrate.sh echo "Starting Claude Code orchestration process..." # Initial task description (saved to a file) cat > task.json << EOL { "project": "Recipe Converter App", "description": "Create a simple web app that converts recipe measurements", "tasks": [ { "id": "task-1", "description": "Create HTML structure", "status": "pending" }, { "id": "task-2", "description": "Implement conversion logic", "status": "pending" }, { "id": "task-3", "description": "Add styling", "status": "pending" } ] } EOL # Launch the orchestrator echo "Launching orchestrator..." claude --dangerously-skip-permissions -p "You are an orchestrator tasked with breaking down and executing a project. Read the task.json file to understand the project requirements and execute each task in sequence. After completing each task, update task.json to mark it as completed before moving to the next task." > orchestrator_output.log echo "Orchestration complete. See orchestrator_output.log for details." ``` -------------------------------- ### Web Search and Summarization with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Shows how Claude Code can be used to perform web searches and summarize the findings. This leverages external information retrieval. ```Shell # Prompt example for Claude Code: # "Search the web for 'benefits of server-side rendering' and provide a concise summary." ``` -------------------------------- ### Example Health Check Request Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md A JSON object representing a request to the health tool of the Claude Code MCP server to retrieve its status and configuration. ```json { "toolName": "claude_code:health", "arguments": {} } ``` -------------------------------- ### JSON: claude_code Tool with Enhanced Parameters Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/ENHANCEMENTS.md Illustrates the configuration for the 'claude_code:claude_code' tool, including new parameters for task orchestration and result formatting. Parameters like 'prompt', 'workFolder', 'parentTaskId', 'returnMode', 'taskDescription', and 'mode' are supported. ```json { "toolName": "claude_code:claude_code", "arguments": { "prompt": "...", "workFolder": "/path/to/project", "parentTaskId": "task-123", // For task orchestration "returnMode": "summary", // "summary" or "full" "taskDescription": "...", // Description for orchestration "mode": "coder" // Roo mode to use } } ``` -------------------------------- ### Perform ArangoDB Document Operations Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Tests core document operations (create, get, update, delete) in `core/db_operations.py` using real data. It also includes testing document queries and relationship management. ```Python import os import sys from arango import ArangoClient from arango.exceptions import DocumentGetError, DocumentDeleteError, DocumentUpdateError # Add project root to sys.path project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) sys.path.insert(0, project_root) from core.constants import ARANGO_URL, ARANGO_USER, ARANGO_PASSWORD, ARANGO_DB_NAME COLLECTION_NAME = 'my_documents' EDGE_COLLECTION_NAME = 'my_edges' def setup_db(): client = ArangoClient(hosts=ARANGO_URL) db = client.db(ARANGO_DB_NAME, username=ARANGO_USER, password=ARANGO_PASSWORD) if not db.has_collection(COLLECTION_NAME): db.create_collection(COLLECTION_NAME) if not db.has_collection(EDGE_COLLECTION_NAME, edge=True): db.create_collection(EDGE_COLLECTION_NAME, edge=True) return db def create_document(db, data): print(f"Creating document...") try: collection = db.collection(COLLECTION_NAME) doc = collection.insert(data) print(f"Document created with key: {doc['_key']}") return doc['_key'] except Exception as e: print(f"Error creating document: {e}") return None def get_document(db, doc_key): print(f"Getting document with key: {doc_key}...") try: collection = db.collection(COLLECTION_NAME) doc = collection.get(doc_key) print(f"Retrieved document: {doc}") return doc except DocumentGetError: print(f"Document with key {doc_key} not found.") return None except Exception as e: print(f"Error getting document: {e}") return None def update_document(db, doc_key, update_data): print(f"Updating document with key: {doc_key}...") try: collection = db.collection(COLLECTION_NAME) result = collection.update({'_key': doc_key, **update_data}) if result['error']: print(f"Error updating document: {result['errorMessage']}") return False print(f"Document updated successfully.") return True except Exception as e: print(f"Error updating document: {e}") return False def delete_document(db, doc_key): print(f"Deleting document with key: {doc_key}...") try: collection = db.collection(COLLECTION_NAME) collection.delete(doc_key) print(f"Document with key {doc_key} deleted.") return True except DocumentDeleteError: print(f"Document with key {doc_key} not found for deletion.") return False except Exception as e: print(f"Error deleting document: {e}") return False def query_documents(db, query): print(f"Executing query: {query}...") try: cursor = db.aql.execute(query) results = list(cursor) print(f"Query results: {results}") return results except Exception as e: print(f"Error executing query: {e}") return [] def create_relationship(db, from_key, to_key, relationship_type='related_to'): print(f"Creating relationship from {from_key} to {to_key}...") try: edge_collection = db.collection(EDGE_COLLECTION_NAME) edge_data = { '_from': f'{COLLECTION_NAME}/{from_key}', '_to': f'{COLLECTION_NAME}/{to_key}', 'type': relationship_type } edge = edge_collection.insert(edge_data) print(f"Relationship created with key: {edge['_key']}") return edge['_key'] except Exception as e: print(f"Error creating relationship: {e}") return None def delete_relationship_by_key(db, edge_key): print(f"Deleting relationship with key: {edge_key}...") try: edge_collection = db.collection(EDGE_COLLECTION_NAME) edge_collection.delete(edge_key) print(f"Relationship with key {edge_key} deleted.") return True except DocumentDeleteError: print(f"Relationship with key {edge_key} not found for deletion.") return False except Exception as e: print(f"Error deleting relationship: {e}") return False if __name__ == "__main__": db = setup_db() if db: # Test create, get, update, delete new_doc_data = {'name': 'Test Document', 'value': 123} doc_key = create_document(db, new_doc_data) if doc_key: retrieved_doc = get_document(db, doc_key) if retrieved_doc: update_document(db, doc_key, {'value': 456}) get_document(db, doc_key) # Verify update delete_document(db, doc_key) get_document(db, doc_key) # Verify deletion # Test query # First, create some documents to query key1 = create_document(db, {'name': 'Alice', 'age': 30}) key2 = create_document(db, {'name': 'Bob', 'age': 25}) key3 = create_document(db, {'name': 'Charlie', 'age': 30}) if key1 and key2 and key3: query = f"FOR doc IN {COLLECTION_NAME} FILTER doc.age == 30 RETURN doc" query_documents(db, query) # Test relationships edge_key = create_relationship(db, key1, key2, 'FRIENDS') if edge_key: delete_relationship_by_key(db, edge_key) # Clean up remaining documents if any were created and not deleted if doc_key and db.collection(COLLECTION_NAME).has(doc_key): delete_document(db, doc_key) if key1 and db.collection(COLLECTION_NAME).has(key1): delete_document(db, key1) if key2 and db.collection(COLLECTION_NAME).has(key2): delete_document(db, key2) if key3 and db.collection(COLLECTION_NAME).has(key3): delete_document(db, key3) ``` -------------------------------- ### Automate Release Workflow with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Details a complex multi-step workflow for automating software releases, including version bumping, changelog updates, committing, and tagging, all managed by Claude Code. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project\n\nFollow these steps: 1. Update the version in package.json to 2.5.0. 2. Add a new section to CHANGELOG.md for version 2.5.0 with the heading '### Added' and list 'New feature X'. 3. Stage package.json and CHANGELOG.md. 4. Commit with message 'release: version 2.5.0'. 5. Push the commit. 6. Create and push a git tag v2.5.0." ``` -------------------------------- ### Create File with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Demonstrates creating a new file with specific content using Claude Code. This involves file system operations and writing data to a file. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project\n\nCreate a new file named 'config.yml' in the 'app/settings' directory with the following content:\nport: 8080\ndatabase: main_db" ``` -------------------------------- ### Validate Logging Utilities Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the logging utilities module in `core/utils/log_utils.py`. This includes environment setup, updating imports, removing mock code, testing logging functionality with real data, and verifying that the output matches the expected format. ```Python import os import subprocess def validate_log_utils(): project_dir = "/path/to/project" # Replace with actual project path os.chdir(project_dir) venv_activate_script = os.path.join(project_dir, ".venv", "bin", "activate") subprocess.run(f"source {venv_activate_script}", shell=True, executable='/bin/bash') print("Updating imports...") print("Removing mock code...") print("Testing logging with real data...") print("Verifying output matches expected format...") print("Logging utilities validation complete.") # Example usage: # validate_log_utils() ``` -------------------------------- ### Validate Embedding Utilities Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the embedding utilities module in `core/utils/embedding_utils.py`. This includes environment setup, import updates, removal of mock code, testing with real data, and verifying JSON and rich table outputs against expected schemas. ```Python import os import subprocess def validate_embedding_utils(): project_dir = "/path/to/project" # Replace with actual project path os.chdir(project_dir) venv_activate_script = os.path.join(project_dir, ".venv", "bin", "activate") subprocess.run(f"source {venv_activate_script}", shell=True, executable='/bin/bash') print("Updating imports...") print("Removing mock code...") print("Testing embedding generation with real data...") print("Verifying JSON output schema...") print("Verifying rich table output...") print("Embedding utilities validation complete.") # Example usage: # validate_embedding_utils() ``` -------------------------------- ### Validate Memory Commands in Python Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the memory commands functionality in Python. This includes environment setup, updating imports, removing mock code, testing commands with real data, and verifying JSON and rich table outputs. ```Python import os import subprocess def validate_memory_commands(): # Change directory to project and activate .venv project_dir = "/path/to/project" venv_path = os.path.join(project_dir, ".venv", "bin", "activate") os.chdir(project_dir) # Note: Activating venv in a script is complex and often done via subprocess or environment variables. # Update imports to reflect new structure print("Updating imports...") # Remove any mock code print("Removing mock code...") # Test commands with real data print("Testing commands with real data...") # Example: subprocess.run(["python", "core/memory/memory_commands.py", "--test-data"]) # Verify JSON output matches expected schema print("Verifying JSON output schema...") # Verify rich table outputs correct data print("Verifying rich table output...") print("Memory Commands validation complete.") # Example usage: # validate_memory_commands() ``` -------------------------------- ### Git Operations with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Demonstrates performing common Git operations such as staging, committing, and pushing changes using Claude Code. This integrates version control into the AI's workflow. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project\n\n1. Stage the file 'src/main.java'.\n2. Commit the changes with the message 'feat: Implement user authentication'.\n3. Push the commit to the 'develop' branch on origin." ``` -------------------------------- ### Validate Cross-Encoder Reranking in Python Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the cross-encoder reranking functionality in Python. This involves environment setup, updating imports, removing mock code, testing reranking with real data, and verifying JSON and rich table outputs. ```Python import os import subprocess def validate_cross_encoder_reranking(): # Change directory to project and activate .venv project_dir = "/path/to/project" venv_path = os.path.join(project_dir, ".venv", "bin", "activate") os.chdir(project_dir) # Note: Activating venv in a script is complex and often done via subprocess or environment variables. # Update imports to reflect new structure print("Updating imports...") # Remove any mock code print("Removing mock code...") # Test reranking with real data print("Testing reranking with real data...") # Example: subprocess.run(["python", "core/search/cross_encoder_reranking.py", "--test-data"]) # Verify JSON output matches expected schema print("Verifying JSON output schema...") # Verify rich table outputs correct data print("Verifying rich table output...") print("Cross-Encoder Reranking validation complete.") # Example usage: # validate_cross_encoder_reranking() ``` -------------------------------- ### Executable JSON for Task Execution Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Illustrates the final JSON output that can be directly executed by the 'claude_code' tool. Each object in the array represents a task with a specific prompt and working directory. ```json [ { "tool": "claude_code", "arguments": { "prompt": "cd /home/user/project && python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt", "workFolder": "/home/user/project" } } ] ``` -------------------------------- ### Validate RAG Classifier Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the RAG classifier module in `core/utils/rag_classifier.py`. This includes environment setup, updating imports, removing mock code, testing classification with real data, and verifying JSON output schema and rich table data. ```Python import os import subprocess def validate_rag_classifier(): project_dir = "/path/to/project" # Replace with actual project path os.chdir(project_dir) venv_activate_script = os.path.join(project_dir, ".venv", "bin", "activate") subprocess.run(f"source {venv_activate_script}", shell=True, executable='/bin/bash') print("Updating imports...") print("Removing mock code...") print("Testing classification with real data...") print("Verifying JSON output schema...") print("Verifying rich table output...") print("RAG classifier validation complete.") # Example usage: # validate_rag_classifier() ``` -------------------------------- ### Create GitHub Pull Request with Claude Code Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/README.md Shows how to create a GitHub Pull Request using Claude Code, specifying source and target branches, title, and body. This integrates with GitHub workflows. ```Shell # Prompt example for Claude Code: # "Your work folder is /Users/steipete/my_project\n\nCreate a GitHub Pull Request in the repository 'owner/repo' from the 'feature-branch' to the 'main' branch. Title: 'feat: Implement new login flow'. Body: 'This PR adds a new and improved login experience for users.'" ``` -------------------------------- ### Validate Enhanced Relationships Source: https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/docs/011_db_operations_validation.md Validates the enhanced relationships module in `core/graph/enhanced_relationships.py`. This includes environment setup, import updates, removal of mock code, testing with real data, and ensuring JSON and rich table outputs conform to expected schemas. ```Python import os import subprocess def validate_enhanced_relationships(): project_dir = "/path/to/project" # Replace with actual project path os.chdir(project_dir) venv_activate_script = os.path.join(project_dir, ".venv", "bin", "activate") subprocess.run(f"source {venv_activate_script}", shell=True, executable='/bin/bash') print("Updating imports...") print("Removing mock code...") print("Testing relationship enhancement with real data...") print("Verifying JSON output schema...") print("Verifying rich table output...") print("Enhanced relationships validation complete.") # Example usage: # validate_enhanced_relationships() ```