Back to Home
angrysky56 icon

ast-mcp-server

Verified Safe

by angrysky56

Overview

Provides an MCP (Model Context Protocol) server for code structure and semantic analysis using ASTs and ASGs, integrated with external AI clients like Claude Desktop.

Installation

Run Command
uv run ast-mcp-server

Environment Variables

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

Security Notes

The project uses `subprocess.run` to execute the `ast-grep` CLI tool for code transformation. This is handled by passing arguments as a list (not `shell=True`), which mitigates direct shell injection risks. However, executing external binaries with user-provided patterns/replacements inherently carries a risk, which depends on the trustworthiness of the `ast-grep` tool itself and the sanitization of user input by the client. Neo4j and OpenRouter API keys are correctly managed via environment variables. Multiple development-related scripts utilize `sys.path.insert(0, os.getcwd())`, a practice that can introduce path-based vulnerabilities if the current working directory is untrusted, though in a local development context, this is less critical.

Similar Servers

Stats

Interest Score41
Security Score8
Cost ClassMedium
Avg Tokens3000
Stars26
Forks6
Last Update2026-01-19

Tags

ASTASGCode AnalysisSemantic AnalysisTree-sitterMCPAI