---
title: "Use with your agent"
description: "Connect Claude or another MCP-capable agent to mcp.c4e.ai so it can run Slurm jobs for you, as you."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.c4e.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use with your agent

The cluster has a remote [MCP](https://modelcontextprotocol.io) server at `https://mcp.c4e.ai`. Point an agent at it and the agent can check the queue, submit and cancel jobs, and look at nodes for you. It always acts as your own cluster account, so it can do only what you can.

> **You need job access**
>
> The MCP server is for people with job access (the same switch that opens [Open OnDemand](https://docs.c4e.ai/getting-started/ondemand/)). Without it, the agent signs in but sees no tools. Email <admin@c4e.ai> if you need it.

## Connect Claude

1. **Add the connector**

   In Claude, open **Settings**, then **Connectors**, then **Add custom connector**. Name it C4E and paste `https://mcp.c4e.ai` as the URL. Leave the OAuth client ID and secret empty.
2. **Sign in**

   Click **Connect**. You'll see the usual C4E sign-in at id.c4e.ai: enter your email and the code we send you.
3. **Approve**

   A consent page named **C4E for agents** lists what the agent may do. Approve it, and Claude shows the cluster tools.

Other agents that support remote MCP servers with OAuth (such as Claude Code: `claude mcp add --transport http c4e https://mcp.c4e.ai`) connect the same way. Sign-ins last 30 days before you're asked again.

## What the agent can do

| Tool | What it does | Arguments |
|---|---|---|
| `list_jobs` | Jobs in the queue, yours and others' | none |
| `get_job` | One job's state, exit code, reason and output file paths | `{"path": {"job_id": "123"}}` |
| `submit_job` | Submit a batch job as you | see below |
| `cancel_job` | Cancel one of your own jobs | `{"path": {"job_id": "123"}}` |
| `list_nodes` | The Sparks, with free CPUs, memory and GPUs | none |
| `list_partitions` | Partitions and their limits | none |

A job submission looks like this. Replace `your-username` with your cluster username:

```json
{
  "body": {
    "script": "#!/bin/bash\nsrun --container-image=nvcr.io#nvidia/cuda:13.0.1-base-ubuntu24.04 nvidia-smi -L",
    "job": {
      "name": "gpu-check",
      "partition": "jobs",
      "current_working_directory": "/home/your-username",
      "environment": ["PATH=/usr/bin:/bin"],
      "tres_per_node": "gres/gpu:1",
      "memory_per_node": {"set": true, "number": 65536},
      "time_limit": {"set": true, "number": 60}
    }
  }
}
```

The same rules apply as for any [Slurm job](https://docs.c4e.ai/getting-started/slurm-jobs/). GPU jobs must ask for memory (`memory_per_node` is in MB), because GPU memory counts against the job.

> **Jobs pause the shared models**
>
> While the cluster has two Sparks, any running job pauses the models behind chat and the API until it ends. Ask your agent to keep jobs short and to cancel ones you don't need.

## What it can't do yet

- Read your job's output files. Open them in [Open OnDemand](https://docs.c4e.ai/getting-started/ondemand/)'s file browser.
- Show finished jobs once they leave the queue.
- Explain refusals. If Slurm says no (for example, cancelling someone else's job), the agent sees a general error.
- Admin tasks. Those stay in the admin tools.

## Calling the models

The MCP server is for jobs. For the cluster's models, have your agent or code call `https://api.c4e.ai/v1` with an API key from chat.c4e.ai. See [Use the API](https://docs.c4e.ai/getting-started/api/).

## Reading these docs

Agents can read this site too, with no sign-in. Point an MCP client at `https://docs.c4e.ai/mcp` (read-only, separate from the cluster server above), or give it [llms.txt](https://docs.c4e.ai/llms.txt) for a plain-text index.

Source: https://docs.c4e.ai/getting-started/agents/index.mdx
