agent-mcp-cars
agent-mcp-cars is a Python library designed for processing and analyzing automotive-related data. Users can efficiently manage vehicle information and perform various automation tasks. It is particularly focused on data collection, transformation, and analysis, making it a valuable tool for developers.
GitHub Stars
0
User Rating
Not Rated
Favorites
0
Views
17
Forks
0
Issues
0
๐ AGENT MCP CARS
An interactive CLI agent that communicates with an MCP server to query a car database.
The goal is to build an AI agent that decides when to send requests to the MCP server โ which then queries the database and returns the results.
Agent โโโถ MCP Server โโโถ Database
โโโโโโโโโโโโโโโโโโโโโโโโ
Project structure
โโโ cars.db # SQLite database, create with the seed script
โโโ main.py # Main entry point
โโโ pyproject.toml
โโโ README.md
โโโ requirements.txt
โโโ scripts
โย ย โโโ read_db.py # Look at every entry in the database
โย ย โโโ start_mcp_server.py # Run the MCP server
โโโ src
โย ย โโโ app
โย ย โโโ agent
โย ย โย ย โโโ agent_llm.py
โย ย โย ย โโโ tools.py
โย ย โโโ cli
โย ย โย ย โโโ interface.py
โย ย โโโ database
โย ย โย ย โโโ config.py
โย ย โย ย โโโ seed.py
โย ย โย ย โโโ session.py
โย ย โโโ mcp
โย ย โย ย โโโ client.py
โย ย โย ย โโโ server.py
โย ย โโโ models
โย ย โย ย โโโ car.py
โย ย โโโ runner.py # Run the CLI with commands
โโโ tests
โย ย โโโ test_agent.py
โโโ uv.lock
๐ฆ Running the Project
This guide explains how to run the complete system โ including the MCP server, CLI interface, and database.
1. Clone the Repository
git clone https://github.com/vtigo/agent-mcp-cars.git
cd agent-mcp-cars
2. Set Up Environment Variables
Create a .env file in the root of the project:
DATABASE_URL=sqlite:///./cars.db
TOGETHER_API_KEY=sk-<your-together-api-key>
MCP_HOST=127.0.0.1
MCP_PORT=3333
๐ก If do not have a together api key, check out the next section.
2.1 ๐ก Using the Together API (skip if you already have a together api key)
This project requires access to a language model via Together.ai. If you do not already have an API key, follow these steps:
- Go to https://api.together.xyz
- Sign up for an account
- Navigate to the API section and generate your API key
- Add the key to your
.envfile as:
TOGETHER_API_KEY=sk-<your-together-api-key>
3. Install Dependencies
โ
Option A: Using uv (recommended)
uv sync
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
โ
Option B: Using pip
python -m venv .venv
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
pip install -r requirements.txt
๐ง Command Reference
All commands are run from the project root using either:
uv run main.py <command>
# OR (if not using uv)
python main.py <command>
๐
seed-db
Populate the database with fake car entries.
It also creates the database if it doesn't exist.
python main.py seed-db
๐ก Optional flag:
--reseedโ Drops and recreates all tables before seeding.
Example:
python main.py seed-db --reseed
๐ง mcp
Start the local MCP server.
python main.py mcp
Expected output:
MCP server running at 127.0.0.1:3333 ...
๐ฌ prompt
Starts an interactive CLI where you can ask the agent questions.
The agent will decide when to query the MCP server to fetch data.
python main.py prompt
โ
check-db
Check that the database connection is functional and print a status report.
python main.py check-db
๐งช Example Workflow
Follow this step-by-step to run everything:
1. Seed the Database
python main.py seed-db --reseed
2. Start the MCP Server
python main.py mcp
3. Start the Interactive CLI Agent (in another terminal)
python main.py prompt
๐ Notes
- All commands assume you're in the project root
- The database file (
cars.db) is created automatically when seeding