Add Claude Code integration with SSE support

- Add Server-Sent Events (SSE) endpoint for Claude Code MCP integration
- Create MCP configuration for Claude Code CLI
- Update tool configuration to support modern OpenAPI format
- Add documentation for Claude Code integration options
- Create CLAUDE.md guide for AI coding agents

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-03-29 12:52:21 +07:00
parent afae299e9c
commit 403fa50b4f
5 changed files with 1188 additions and 548 deletions

View File

@ -1,71 +1,159 @@
{
"tools": [
{
"name": "nomad_mcp",
"description": "Manage Nomad jobs through the MCP service",
"api_endpoints": [
{
"name": "list_jobs",
"description": "List all jobs in a namespace",
"method": "GET",
"url": "http://127.0.0.1:8000/api/claude/list-jobs",
"params": [
{
"name": "namespace",
"type": "string",
"description": "Nomad namespace",
"required": false,
"default": "development"
}
]
},
{
"name": "manage_job",
"description": "Manage a job (status, stop, restart)",
"method": "POST",
"url": "http://127.0.0.1:8000/api/claude/jobs",
"body": {
"job_id": "string",
"action": "string",
"namespace": "string",
"purge": "boolean"
}
},
{
"name": "create_job",
"description": "Create a new job",
"method": "POST",
"url": "http://127.0.0.1:8000/api/claude/create-job",
"body": {
"job_id": "string",
"name": "string",
"type": "string",
"datacenters": "array",
"namespace": "string",
"docker_image": "string",
"count": "integer",
"cpu": "integer",
"memory": "integer",
"ports": "array",
"env_vars": "object"
}
},
{
"name": "get_job_logs",
"description": "Get logs for a job",
"method": "GET",
"url": "http://127.0.0.1:8000/api/claude/job-logs/{job_id}",
"params": [
{
"name": "namespace",
"type": "string",
"description": "Nomad namespace",
"required": false,
"default": "development"
}
]
}
]
}
]
{
"schema_version": "v1",
"name": "nomad_mcp",
"description": "Manage Nomad jobs through the MCP service",
"authentication": {
"type": "none"
},
"api": {
"type": "openapi",
"url": "",
"endpoints": [
{
"path": "/api/claude/list-jobs",
"method": "GET",
"description": "List all jobs in a namespace",
"parameters": [
{
"name": "namespace",
"in": "query",
"description": "Nomad namespace",
"required": false,
"schema": {
"type": "string",
"default": "development"
}
}
]
},
{
"path": "/api/claude/jobs",
"method": "POST",
"description": "Manage a job (status, stop, restart)",
"request_body": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["job_id", "action"],
"properties": {
"job_id": {
"type": "string",
"description": "ID of the job to manage"
},
"action": {
"type": "string",
"description": "Action to perform: status, stop, or restart"
},
"namespace": {
"type": "string",
"description": "Nomad namespace"
},
"purge": {
"type": "boolean",
"description": "Whether to purge the job when stopping"
}
}
}
}
}
}
},
{
"path": "/api/claude/create-job",
"method": "POST",
"description": "Create a new job",
"request_body": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["job_id", "name", "type", "docker_image"],
"properties": {
"job_id": {
"type": "string",
"description": "Unique ID for the job"
},
"name": {
"type": "string",
"description": "Display name for the job"
},
"type": {
"type": "string",
"description": "Job type (service, batch, etc.)"
},
"datacenters": {
"type": "array",
"description": "List of datacenters to run the job in",
"items": {
"type": "string"
}
},
"namespace": {
"type": "string",
"description": "Nomad namespace"
},
"docker_image": {
"type": "string",
"description": "Docker image to run"
},
"count": {
"type": "integer",
"description": "Number of instances to run"
},
"cpu": {
"type": "integer",
"description": "CPU allocation in MHz"
},
"memory": {
"type": "integer",
"description": "Memory allocation in MB"
},
"ports": {
"type": "array",
"description": "Port mappings",
"items": {
"type": "object"
}
},
"env_vars": {
"type": "object",
"description": "Environment variables for the container"
}
}
}
}
}
}
},
{
"path": "/api/claude/job-logs/{job_id}",
"method": "GET",
"description": "Get logs for a job",
"parameters": [
{
"name": "job_id",
"in": "path",
"description": "ID of the job to get logs for",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "namespace",
"in": "query",
"description": "Nomad namespace",
"required": false,
"schema": {
"type": "string",
"default": "development"
}
}
]
}
]
}
}