Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

Repository files navigation

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

ITSM API

Auth

  • Username: admin
  • Password: pswd123

Endpoints

  • GET /tickets
  • GET /tickets/{id}
  • POST /tickets
  • PUT /tickets/{id}
  • DELETE /tickets/{id}

Curl Examples

Get all tickets:

curl -u admin:pswd123 http://127.0.0.1:8080/tickets

Get ticket by id:

curl -u admin:pswd123 http://127.0.0.1:8080/tickets/1

Create 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/1

MCP + Chatbot

MCP HTTP Server

python3 mcp_server.py

Test 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":{}}'

MCP gRPC Server

python3 /itsm_mcp_grpc_server.py

Streamlit Chatbot (MCP Client)

streamlit run chatbot_ui.py

Default MCP URL: http://127.0.0.1:9000/mcp
Default model: llama3

How Files Connect

  • /api.py

    • FastAPI service that reads/writes /data/itsm_tickets.csv.
    • This is the core ITSM API the rest of the stack calls.
  • /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.

Logs

All API call logs are written to:

  • logs/api.log
  • logs/mcp.log
  • logs/ollama.log

You can view these logs in the Streamlit logs UI:

streamlit run logs_ui.py

Each log entry is JSON with consistent fields so entries are easier to scan:

  • timestamp: UTC timestamp.
  • operation: logical action name (for example health-ping, jsonrpc, generate).
  • source: caller component (for example chatbot_ui, mcp_server, llm_interpreter).
  • status_code: HTTP-like numeric status (or 0 for transport errors).
  • status_class: derived class such as 2xx, 4xx, none.
  • success: normalized success flag.
  • latency_ms: measured elapsed time.
  • error and error_type: present when a request fails.

Running Tests

Use these commands from the project root.

  1. Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run all tests:
python3 -m unittest discover -s tests -p 'test_*.py' -q
  1. Optional verbose mode (shows each test name):
python3 -m unittest discover -s tests -p 'test_*.py' -v

About

(❌) proof of concept for itsm chatbot utilizing api & mcp server

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages