A comprehensive MCP server demonstration with multiple Gradio-based services for code analysis, sentiment analysis, security scanning, and git operations
This server provides 8 tools with complete function signatures and detailed docstrings, but exhibits inconsistent schema quality and several definition issues. Tool naming is action-oriented (sentiment_analysis, calculate_code_complexity, retrieve_url, load_local_file, analyze_sql_injection, analyze_command_injection, git_status, git_add), following verb-noun convention well. Descriptions are comprehensive (190-420 characters), exceeding the baseline average of 194 chars. However, input schemas are visible only for the first 4 tools in the code sample; the remaining 4 tools' parameter definitions are inferred from docstrings rather than explicit schema registration. No output schemas are documented for any tool. Parameter descriptions exist but some lack granularity on constraints (e.g., 'file_path' lacks path traversal warnings despite security sensitivity). Risk annotations (READ_ONLY, WRITE) are present but do not map to current MCP tool annotations (readOnlyHint, destructiveHint). Overall: strong foundation undermined by incomplete schema visibility, missing output documentation, and lack of structured error guidance.
Analyze Python source code for command injection vulnerabilities and security risks. This function performs static code analysis to detect potential command injection vulnerabilities in Python code. It scans for dangerous patterns that could allow arbitrary command execution, such as using user input directly in system commands, shell execution functions, or subprocess calls without proper sanitization.
Analyze Python source code for SQL injection vulnerabilities and security risks. This function performs static code analysis to detect potential SQL injection vulnerabilities in Python code. It scans for common patterns that could lead to SQL injection attacks, such as dynamic SQL query construction with user input, string concatenation in SQL statements, and unsafe formatting methods.
Calculate cyclomatic complexity and structural metrics for Python source code. This function analyzes Python source code to determine its complexity using cyclomatic complexity, which measures the number of linearly independent paths through the code. It also counts functions and classes to provide structural insights. The analysis uses Python's Abstract Syntax Tree (AST) for accurate parsing and metric calculation.
Add a file to the git staging area for the next commit. This function stages a file in the git repository, preparing it for the next commit. It adds the specified file to the git index, which means the changes to that file will be included in the next commit operation.
Output schemas are not documented for any of the 8 tools. Callers cannot predict the structure of responses, forcing LLMs to parse unstructured results.
Input schemas for tools 5 - 8 (analyze_sql_injection, analyze_command_injection, git_status, git_add) are not visible in the provided code sample; parameter definitions are inferred from docstrings only. This violates explicit schema registration and makes parameter validation opaque.
No error handling guidance provided. Tools like retrieve_url, load_local_file, git_* lack documented error scenarios or recovery paths. For example, 'file not found', 'permission denied', 'network timeout', the LLM receives no hint on how to recover.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-21 | D | 52 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 47 | - | v1 |
Get the git status and version control information for a specific file. This function analyzes the git status of a file within a git repository, providing detailed information about its current state in version control. It determines whether the file is tracked, modified, staged, untracked, or has other git status. The function also retrieves information about the last commit that affected the file.
Load content from a local file on the server filesystem. This function reads the contents of a file from the local filesystem and returns it along with metadata about the file. It's designed to work with text-based files and handles various file system scenarios including missing files, permission issues, and encoding problems.
Retrieve content from a URL and return it with metadata. This function fetches the content of a web resource from the provided URL. It handles various HTTP scenarios including redirects, timeouts, and errors. The function is designed to work with text-based content (HTML, JSON, XML, plain text, code files, etc.) and automatically handles encoding.
Analyze the sentiment of the given text using natural language processing. This function performs sentiment analysis on text input using the TextBlob library. It evaluates the emotional tone and subjectivity of the text, providing both numerical scores and categorical assessments. The analysis is based on machine learning models trained on large text corpora.
Path traversal and security validation not documented. load_local_file and git_* tools accept file paths as strings with no stated constraints. An LLM could be tricked into accessing /etc/passwd or other sensitive files via prompt injection.
Risk annotations (READ_ONLY, WRITE) are present but do not correspond to current MCP tool annotation scheme (readOnlyHint, destructiveHint, idempotentHint). These custom risk labels will not be understood by spec-compliant clients.
Parameter constraints not formally declared. For example, 'code' and 'text' parameters lack minLength/maxLength/pattern constraints in JSON Schema. Constraints are buried in prose descriptions, which LLMs do not reliably parse.
No pagination support documented. retrieve_url and git_* operations may return large results (e.g., full file contents or large diffs) without limit or offset parameters, risking context window exhaustion.