Back to Home
jayyprajapati icon

Chatbot-the-MCP-way

by jayyprajapati

Overview

Interactive command-line chat application enabling AI model interaction with document retrieval and extensible command execution via the Model Control Protocol (MCP).

Installation

Run Command
uv run main.py

Environment Variables

  • LLAMA_MODEL
  • OLLAMA_BASE_URL
  • USE_UV

Security Notes

The `MCPClient` in `mcp_client.py` is designed to execute arbitrary commands (`command` and `args`). While the `doc_client` in `main.py` uses fixed, safe commands for `mcp_server.py`, the application also iterates through `sys.argv[1:]` to launch additional `MCPClient` instances with `uv run server_script`. This allows any script passed as a command-line argument to `main.py` to be executed. This poses a significant command injection risk if `main.py` is ever invoked with untrusted arguments, as no input validation or whitelisting is evident for these additional server scripts. Document content editing via `edit_document` also presents a minor data integrity risk if the LLM is unconstrained.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassHigh
Avg Tokens1500
Stars0
Forks0
Last Update2025-12-03

Tags

AI ChatbotCLIDocument RetrievalOllamaMCP