Skip to content
Connect an agent (MCP)

Connect an agent (MCP)

The portal is an MCP server: an agent connected to it manages a project the way you do in the portal. It lists and creates machines, suspends, resumes and deletes them, takes and restores checkpoints and sends messages to the agents inside. It also stores artifacts and shares them, manages web portal domains, reads alerts and reports bugs. Ask it things like “resume dev and tell me why it was suspended”, or “put this report on a page I can send the team”.

  • Endpoint: https://app.agent-spaces.eu/mcp (streamable HTTP).
  • Credentials: an API key as a bearer token. The agent acts as you, in one project, with your role there. A read-only key gets the read tools only.
  • Project: a key that reaches one project works there. For a key that reaches several, the X-Space-Project header names the project (its slug); without it the server refuses the connection and lists the key’s projects.

Make a key for the agent in Account → API keys, ideally one per agent with Only selected projects and the one project it manages: then it needs no project header. Put the key in the environment where the agent runs, so it never sits in the agent’s config:

export AGENTSPACES_API_KEY=<key>

Mistral Vibe

In ~/.vibe/config.toml (or .vibe/config.toml in a project):

[[mcp_servers]]
name = "agentspaces"
transport = "streamable-http"
url = "https://app.agent-spaces.eu/mcp"

[mcp_servers.auth]
type = "static"
api_key_env = "AGENTSPACES_API_KEY"
api_key_header = "Authorization"
api_key_format = "Bearer {token}"

Claude Code

claude mcp add --transport http agentspaces https://app.agent-spaces.eu/mcp \
  --header "Authorization: Bearer $AGENTSPACES_API_KEY"

Claude Code stores the header with the value it had when you ran this. For a key that reaches several projects, add --header "X-Space-Project: web".

Codex

In ~/.codex/config.toml:

[mcp_servers.agentspaces]
url = "https://app.agent-spaces.eu/mcp"
bearer_token_env_var = "AGENTSPACES_API_KEY"
# For a key that reaches several projects:
# http_headers = { "X-Space-Project" = "web" }

What the agent can and can’t do

The first call an agent should make is whoami: who it acts as, the project, whether the key is read-only, the quota. Every other tool works in that project. Machine commands answer at once (creating, stopping, waking); the agent polls get_machine for the result.

Artifacts: an agent with a shell gets an upload URL (create_artifact_upload) and curl -Ts the file. One without a shell, like a hosted chat, passes up to 1 MiB of content in the call (put_artifact). share_artifact stores a page and shares it with your organization in one step.

Some things stay in the portal, signed in: API keys, projects, members and invitations, creating or changing web portals, your SSH keys (they reach every project), and making a share public. An agent can make a public share private again.

Every change an agent makes is in the organization’s audit log as yours, marked as made through MCP with the key’s prefix. Revoke the key to cut the agent off at once.

Last updated on