Files
nomad_mcp/QUICK_START.md
2025-02-26 15:25:39 +07:00

122 lines
2.7 KiB
Markdown

# Nomad MCP - Quick Start Guide
This guide will help you quickly set up and start using the Nomad MCP service for managing Nomad jobs.
## 1. Installation
### Clone the Repository
```bash
git clone https://github.com/your-org/nomad-mcp.git
cd nomad-mcp
```
### Install Dependencies
```bash
pip install -r requirements.txt
```
## 2. Configuration
### Set Up Environment Variables
Create a `.env` file in the project root:
```
# Nomad connection settings
NOMAD_ADDR=http://your-nomad-server:4646
NOMAD_TOKEN=your-nomad-token
NOMAD_NAMESPACE=development
NOMAD_SKIP_VERIFY=true
# API settings
PORT=8000
HOST=0.0.0.0
# Logging level
LOG_LEVEL=INFO
```
Replace `your-nomad-server` and `your-nomad-token` with your actual Nomad server address and token.
## 3. Start the Service
```bash
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
```
The service will be available at `http://localhost:8000`.
## 4. Access the Web UI
Open your browser and navigate to:
```
http://localhost:8000
```
You should see the Nomad Job Manager UI with a list of jobs in your default namespace.
## 5. Basic Operations
### View Jobs
1. Select a namespace from the dropdown in the header
2. Browse the list of jobs with their statuses
### Manage a Job
1. Click the "View" button next to a job to see its details
2. Use the "Restart" button to restart a job
3. Use the "Stop" button to stop a job
### View Logs
1. Select a job to view its details
2. Scroll down to the "Logs" section
3. Switch between stdout and stderr using the tabs
## 6. API Usage
### List Jobs
```bash
curl http://localhost:8000/api/claude/list-jobs?namespace=development
```
### Get Job Status
```bash
curl -X POST http://localhost:8000/api/claude/jobs \
-H "Content-Type: application/json" \
-d '{"job_id": "example-job", "action": "status", "namespace": "development"}'
```
### Stop a Job
```bash
curl -X POST http://localhost:8000/api/claude/jobs \
-H "Content-Type: application/json" \
-d '{"job_id": "example-job", "action": "stop", "namespace": "development", "purge": false}'
```
## 7. Claude AI Integration
To set up Claude AI integration:
1. Configure Claude with the provided `claude_nomad_tool.json` file
2. Update the URLs in the configuration to point to your Nomad MCP service
3. Use natural language to ask Claude to manage your Nomad jobs
Example prompt for Claude:
```
Please list all jobs in the development namespace using the Nomad MCP service.
```
## Next Steps
- Read the full [README.md](README.md) for detailed information
- Check out the [User Guide](USER_GUIDE.md) for the web UI
- Explore the [Claude API Integration Documentation](CLAUDE_API_INTEGRATION.md) for AI integration
- Review the API documentation at `http://localhost:8000/docs`