Back to Home
angrysky56 icon

ast-mcp-server

Verified Safe

by angrysky56

Overview

Provides a Model Context Protocol (MCP) server for deep code analysis, offering Abstract Syntax Tree (AST) and Abstract Semantic Graph (ASG) generation, code structure analysis, and transformation capabilities, primarily for integration with AI agents like Claude Desktop.

Installation

Run Command
uv run ast-mcp-server

Environment Variables

  • OPENROUTER_API_KEY
  • OPENROUTER_CHAT_MODEL
  • OPENROUTER_EMBED_MODEL
  • NEO4J_URI
  • NEO4J_USER
  • NEO4J_PASSWORD
  • NEO4J_DB
  • AST_CACHE_SIZE

Security Notes

The server uses `subprocess.run` to execute the `ast-grep` CLI tool. The developers acknowledge this and implement mitigations by avoiding `shell=True`, passing arguments as a list, and resolving absolute paths, which reduces the risk of shell injection (as noted by `trunk-ignore(bandit/B603)`). Sensitive credentials like API keys (OpenRouter) and Neo4j database access are handled using environment variables, which is a secure practice. No `eval` or other direct code execution vulnerabilities from untrusted input were identified.

Similar Servers

Stats

Interest Score41
Security Score8
Cost ClassMedium
Avg Tokens750
Stars25
Forks6
Last Update2025-12-13

Tags

code analysisASTASGcode transformationMCP