brew install pyenv
pyenv install 3.11.8
pyenv local 3.11.8
pip install --upgrade pip setuptools wheel
pip install langchain langchain-ollama langchain-chroma pandas
python -m venv .lc-env
source .lc-env/bin/activate
pip install --upgrade pip setuptools wheel
pip install langchain langchain-ollama langchain-chroma pandas
ollama pull mxbai-embed-large tinyllama- Username:
admin - Password:
pswd123
GET /ticketsGET /tickets/{id}POST /ticketsPUT /tickets/{id}DELETE /tickets/{id}
Get all tickets:
curl -u admin:pswd123 http://127.0.0.1:8080/ticketsGet ticket by id:
curl -u admin:pswd123 http://127.0.0.1:8080/tickets/1Create ticket:
curl -u admin:pswd123 -X POST http://127.0.0.1:8080/tickets \
-H "Content-Type: application/json" \
-d '{"title":"Printer down","description":"3rd floor printer not working","priority":"high","category":"hardware","requester":"jules.k"}'Update ticket:
curl -u admin:pswd123 -X PUT http://127.0.0.1:8080/tickets/1 \
-H "Content-Type: application/json" \
-d '{"status":"in_progress","assigned_to":"riley.t"}'Delete ticket:
curl -u admin:pswd123 -X DELETE http://127.0.0.1:8080/tickets/1python3 mcp_server.pyTest MCP (tools/list):
curl -s http://127.0.0.1:9000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'python3 /itsm_mcp_grpc_server.pystreamlit run chatbot_ui.pyDefault MCP URL: http://127.0.0.1:9000/mcp
Default model: llama3
-
/api.py- FastAPI service that reads/writes
/data/itsm_tickets.csv. - This is the core ITSM API the rest of the stack calls.
- FastAPI service that reads/writes
-
/itsm_tickets.csv- CSV data store used by the API.
-
/itsm_ui.py- Streamlit UI that talks directly to the FastAPI service for create/update/delete/list.
-
/mcp_server.py- MCP HTTP server that exposes the ITSM API as MCP tools.
- It calls the FastAPI service at
http://127.0.0.1:8080.
-
/chatbot_ui.py- Streamlit chatbot that uses MCP HTTP tools for natural-language ticket actions.
-
/helpers/- Shared modules used by entry files to keep main files small and readable.
- Includes config/env utilities, logging utilities, API service helpers, and UI helper modules.
All API call logs are written to:
logs/api.loglogs/mcp.loglogs/ollama.log
You can view these logs in the Streamlit logs UI:
streamlit run logs_ui.pyEach log entry is JSON with consistent fields so entries are easier to scan:
timestamp: UTC timestamp.operation: logical action name (for examplehealth-ping,jsonrpc,generate).source: caller component (for examplechatbot_ui,mcp_server,llm_interpreter).status_code: HTTP-like numeric status (or0for transport errors).status_class: derived class such as2xx,4xx,none.success: normalized success flag.latency_ms: measured elapsed time.erroranderror_type: present when a request fails.
Use these commands from the project root.
- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run all tests:
python3 -m unittest discover -s tests -p 'test_*.py' -q- Optional verbose mode (shows each test name):
python3 -m unittest discover -s tests -p 'test_*.py' -v