angular-cli-mcp-client
Run a LangGraph ReAct agent wired to an MCP client that exposes Angular CLI tools. The agent uses an Ollama-backed LLM to reason about prompts and (read-only) Angular CLI tool outputs.
Prerequisites
- Python 3.10+
- Node.js 18+ (for
npxand@angular/cli) - Ollama installed and running locally
- Example model used: llama3.2:latest
- PowerShell or any shell (examples use PowerShell on Windows)
Environment
Create a .env file in the project root:
MODEL_URL=http://localhost:11434MODEL_URLshould point to your Ollama server.
Installation
# From the project root
python -m venv .venv
. .venv\Scripts\Activate.ps1
pip install -r requirements.txtRunning the demo
# Activate the virtual environment if not already active
. .venv\Scripts\Activate.ps1
# Run the agent demo
python main.pyWhat it does:
- Starts an MCP client that launches the Angular CLI via
npx @angular/cli mcp --read-onlyover stdio - Discovers exposed tools
- Builds a LangGraph ReAct agent with an Ollama-backed LLM
- Sends a single demo prompt: “What are Angular's best practices?”
The agent may call tools as needed (read-only) to answer the prompt.
Project structure
.
├─ main.py # Entrypoint; creates the agent and runs a demo prompt
├─ requirements.txt # Python dependencies
└─ README.md # This fileCommon issues and fixes
- npx not found
- Ensure Node.js 18+ is installed and available on PATH
- SSL or proxy issues
- Set MODEL_URL to http:// with the correct host/port for local Ollama
Customizing
- Change the model: edit
model="llama3.2:latest"inmain.py - Change the prompt: edit the
HumanMessagecontent inmain.py - Enable additional MCP servers: extend the
MultiServerMCPClientmapping inmain.py
