A lesson is completed when you tick it, when you watch its video to the end or when you score 80% on its quiz. The certificate is issued online after the final assessment, from a score of 32 out of 40.
Lesson 34, module 9: Code agents and the terminal The Nexus API and MCP server Hugo wants the tasks in his spreadsheet. Does it all have to be copied by hand?
Two doors: a session's bridge, or the remote server with a key. [Diagram: A session's bridge or the server] A session's bridge The remote MCP server Both apply the same rights. Only the remote server needs a key. The key is created in Settings › API and MCP, named after the tool. Read-only if the tool doesn't write An expiry date, or never Revocable instantly First call: who am I? Request: curl -H "Authorization: Bearer $NEXUS_CLE" https://api.nexus-engine.eu/api/v1/auth/me Response: A member object: your name, your role, your company. The key works. Without a valid key, the response is 401 "Non authentifié". One key, its rights: those of the person who created it. [Diagram: A call, from script to response] 1. The key 2. The header 3. The rights 4. The response The key replays the rights of the person who created it: no more, no less. Claude Code, Codex, claude.ai: each one connects differently. claude mcp add --transport http ~/.codex/config.toml and a variable claude.ai and ChatGPT: OAuth, nothing to copy A 403 is a Nexus rule, not a fault. [Diagram: Reading an API response] Green: It responds Orange: Fix the call Red: Don't work around it The error message is in French; a 400 names the faulty field. In the exercise, you prepare the key and the first call for Hugo's dashboard. Your turn: The key and the first call for Hugo's dashboard The written course, the corrected exercise and the quiz are below the video.
Lesson 34 of 48 · module 9, coding agents and the terminal
The Nexus API and MCP server
A key created in Settings › API and MCP opens the API’s 1,182 routes and the MCP server’s 146 tools, with your exact permissions. You learn to create a read-only key, try it with curl, connect Claude Code, Codex or claude.ai to Nexus, and read errors and limits.
20 min of reading
1 min 55 of video
7 diagrams
1 demande to copy
3 exemples pratiques
4 exercices answerss
5 questions
1 ressource
By the end of this lesson, you will know how to
Create an API key suited to a tool, read-only when it doesn’t write, and store it outside the code
Call the API and the MCP server with curl, then connect an assistant outside Nexus
Read a failed response (401, 403, 404, 429) and respect the limits
What’s covered
Two ways in, the same rights
Create the right key
Call the API with curl
Connect an assistant to the MCP server
Read errors and respect the limits
3 worked examples, followed from start to finish
Exercise with answers · The key and the first call for Hugo’s dashboard
3 practice exercises, from guided to demanding cases
The quiz
Key points
The API is Nexus itself: a key replays the exact rights of the person who created it.
One key per tool, in its name, read-only when it doesn’t write, with an expiry date where possible.
The key lives in the vault and in an environment variable, never in the code, a spreadsheet or a chat.
A session opened in Nexus already has its MCP bridge without a key; the remote server is for tools outside Nexus.
401: the key; 403: a rule; 404: not found or belongs to another company; 429: wait.
Hugo, manager of the Chartrons studio, keeps a management spreadsheet. Every Monday, he copies in the overdue tasks from each project by hand. Malik offers him something better: a small script that reads the tasks in Nexus and fills in the spreadsheet. For an external tool to read Nexus, it needs a way in and a key. The API is not a copy of Nexus, it is Nexus: the desktop application uses the same routes, with the same checks, and a key can do nothing more than the person who created it.
A session’s bridge or the server
A session’s bridge
Declared automatically in a session opened in Nexus
No key and no network
Knows the project, its access, the preview, the acceptance testing
Nothing to configure
The remote MCP server
For a tool outside Nexus: claude.ai, ChatGPT, an editor, a script
A nexus_… key or an OAuth connection
146 tools recorded on 15 November 2026
300 calls per minute per key
Both apply the same permissions. Only the remote server asks for a key.
Two ways in, the same rights
An agent session opened in Nexus already gets a local MCP server, declared automatically, with no key and no network: it knows the project, its access credentials, the verification browser, the acceptance-testing findings, the connectors, the Drive and the Figma mock-ups. Malik has nothing to configure in his sessions. The remote server is the other door, for a tool that is not in Nexus: claude.ai, ChatGPT, an editor such as Cursor, or Hugo’s script. On 15 November 2026, the documentation lists 1,182 routes in 47 families and 146 MCP tools.
API essentials (checked on 15 November 2026)
Item
Value
API address
https://api.nexus-engine.eu/api/v1
MCP server address
https://api.nexus-engine.eu/api/v1/mcp (POST, JSON-RPC 2.0, Streamable HTTP sans état)
Authentication
Authorization header: Bearer nexus_…
Format
JSON, UTF-8, ISO 8601 dates, opaque identifiers returned by the lists
Ceilings
300 requests per minute per IP address (API), 300 calls per minute per key (MCP), 30 secret reveals per hour per member, 25 MB per request
Inventory
GET /endpoints: filter, offset, limit (30 by default, 33 at most)
Create the right key
Create an API key
Open Settings, then the API and MCP tab.
Click “Create a key”.
Name it after the tool that will use it (“Hugo’s dashboard”), not after yourself.
Choose whether it can write: for a dashboard, no.
Choose an expiry date, or never. Save.
In the list, the key stays hidden: the eye icon shows it, a click copies it. Button labels may vary slightly depending on your version of Nexus.
A key has no permissions of its own: it replays those of its creator, same company, same role, same assignments. A user assigned to three projects sees three through their key; an administrator sees everything. Created as read-only, it passes on every GET and is refused every POST, PUT, PATCH and DELETE before even reaching the route, MCP tools included. It never touches account security (second factor, password, other keys) and survives neither its revocation nor the deactivation of its creator. Its creation, its revocation and every reveal are logged.
Which key for which tool
1Does the tool need to write (create a task, edit a record)?
No A read-only key: every POST, PUT, PATCH and DELETE is refused.
2Does the tool run under your responsibility, with your rights?
No A key created by the person whose permissions are right, not yours.
3Is an end date known (an assignment, an internship, a trial)?
No With no expiry date, plan its revocation in the project record.
Yes to allA key named after the tool, with write access and an expiry date, stored in the vault.
One key per tool, named after the tool: revoking it breaks nothing else.
Call the API with curl
Check the key, then read the projectsTerminal
# la clé vient du coffre, posée dans une variable du shell (jamais écrite dans un fichier poussé)
export NEXUS_CLE="[votre-clé]"
# qui suis-je ? un objet membre, et la clé fonctionne
curl -s -H "Authorization: Bearer $NEXUS_CLE" https://api.nexus-engine.eu/api/v1/auth/me
# les projets que je vois
curl -s -H "Authorization: Bearer $NEXUS_CLE" https://api.nexus-engine.eu/api/v1/projects
# les routes d'une famille, par tranches de 30
curl -s -H "Authorization: Bearer $NEXUS_CLE" "https://api.nexus-engine.eu/api/v1/endpoints?filter=Tâches"
Routes taken from the documentation on 15 November 2026. Without a key, /auth/me returns 401 “Not authenticated” (observed the same day).
Writing goes through the same routes. The documentation gives the example of a task created with POST /tasks using projectId, title, priority and dueAt: the response is the task as the whole team sees it in the application. With a read-only key, the same call returns 403. That is intentional: give a tool write access only if it needs it. And never call a route the inventory doesn’t show: identifiers come from the lists, never from a guess.
One call, from script to response
1The key
Created in Settings › API and MCP, stored in an environment variable.
2The header
Authorization: Bearer followed by the key, on every request.
3Rights
Same company, same role, same assignments as its creator.
4The answer
The resource as the application displays it, or a 401, 403, 404 or 429 code.
The key replays the rights of the person who created it: no more, no less.
Connect an assistant to the MCP server
Claude Code, Codex and a check callTerminal
# Claude Code : ajouter le serveur MCP de Nexus (la clé lue dans la variable du shell)
claude mcp add --transport http nexus https://api.nexus-engine.eu/api/v1/mcp --header "Authorization: Bearer $NEXUS_CLE"
# Codex : dans ~/.codex/config.toml, la clé posée dans la variable NEXUS_API_KEY
# [mcp_servers.nexus]
# url = "https://api.nexus-engine.eu/api/v1/mcp"
# bearer_token_env_var = "NEXUS_API_KEY"
# vérifier : une liste d'outils, et la connexion fonctionne
curl -s -X POST https://api.nexus-engine.eu/api/v1/mcp \
-H "Authorization: Bearer $NEXUS_CLE" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Commands copied from the “Connect your assistants with MCP” page on 15 November 2026. A GET on /mcp returns 405: the server only handles POST.
For claude.ai and ChatGPT, there is nothing to copy: add a custom MCP connector with the server address. The connector opens a Nexus page (OAuth 2.1), you sign in to your account and choose what the application can do, everything or read-only. The linked application then appears in Settings › API and MCP, where you can remove it in one click. For Cursor, VS Code or Windsurf, a mcpServers block with the address and the header; for a client without native HTTP such as Claude Desktop, the mcp-remote gateway launched with npx.
What an assistant connected to Nexus can do
Using the Nexus MCP server, list the tasks in the [project name] project that are overdue or due this week, with their assignee and status. Don’t change anything. If a tool returns a 403, tell me which one and why, without looking for another way round.
Roughly what you should get
What to expect: the assistant calls the read tools for the project and its tasks, then returns a table (task, assignee, status, due date). During the handshake, Nexus gave it the ground rules: announce what will change before any write, and treat a 403 as a rule, not a fault.
Tools that delete are marked destructive: an MCP client can ask for confirmation before running them.
Read errors and respect the limits
Read an API response
It responds
200: the resource, as the application displays it
Fix the call
400: a field was rejected, and the message names it
404: not found, or belongs to another company
429: limit reached, wait for the stated delay
Don’t work around it
401: key missing, invalid, expired or revoked
403: valid key, action refused by a rule
The error message is in French; a 400 names the faulty field.
Mistakes to avoid
Writing the API key in the script, in a pushed configuration file, or in a shared spreadsheet.
Anyone who reads the file has the key creator’s permissions, write access included, until it is revoked.
Store the key in the vault and set it as an environment variable on the machine; the code only reads the variable’s name.
Giving a tool your own administrator key “so it can see everything”.
The tool can then change everything, and the log can no longer tell the tool from the person.
One key per tool, named after it, read-only when it doesn’t write.
Getting round a 403 by looking for another route that does the same thing.
A 403 is a Nexus rule (role, read-only, restricted route), not a fault: working around it defeats the intended control.
Read the message, and ask the person who has the right to take the action, or to grant the permissions needed.
Set up a key in a session opened in Nexus to give it access to tasks.
The session already has the local MCP bridge, with no key; an extra key serves no purpose and ends up lying around in a file.
Keep the key for tools outside Nexus: claude.ai, ChatGPT, an editor, a script.
3 SME situations followed from start to finish: the prompts exactly as they were written, the model answer to aim for, and what was checked before sending.
Example 1
A read-only dashboard for a manager
Nathalie runs a twelve-person communications agency in Bordeaux. On the meeting-room screen, she wants the list of tasks in review across all projects, updated every hour. Her developer, Yanis, writes the script.
The meeting room screen
1Read-only key
Created by the managing director, in the screen’s name.
2Vault
The key stored, access given to the developer.
3Script
Routes read from the inventory, codes handled.
4Screen
Tasks in review, every hour.
Request 1
Nathalie’s action in Settings › API and MCP: “Create a key”, name “Meeting room screen”, no write access, expires in one year.
Model answer
The key appears hidden in the list. Nathalie copies it and stores it in the agency vault, type “API key”, linked to the internal project. She does not send it by email.
Yanis gets access to the vault, not the key in a message.
Request 2
In the internal project session: Write a Python script that reads the key from the NEXUS_CLE variable, checks /auth/me, then reads the tasks of every project and keeps only those in review. On 401 or 403, it stops with a clear message; on 429, it waits for the stated delay. Read the inventory of routes in the Tasks family first, so you don’t guess a path.
Model answer
What to expect: the agent reads the inventory, names the route it uses, then returns a short script that uses httpx, the Authorization header and the environment variable, and handles the three codes. No key written in the file.
Yanis checks that no key is in the file before pushing it.
What was checked before sending
The key: read-only, in the tool’s name, with an expiry date.
The secret: in the vault and in a variable, never in the script.
The routes: taken from the inventory, not guessed.
For scale: one hour of work, once, instead of twenty minutes of copying at every meeting.
Example 2
An editor connected to Nexus
Lucas is a developer at a fifteen-person software publisher in Bègles. He codes in Cursor and wants his editor’s assistant to know the projects’ tasks and conventions without going through the Nexus window.
With or without the MCP server
None
Conventions copied by hand
Tasks created in another window
The assistant doesn’t know the project
With
Conventions read in Nexus
The task announced, then created
Lucas’s permissions, logged
Request 1
Configuration added by Lucas in Cursor: an mcpServers block “nexus”, type http, address https://api.nexus-engine.eu/api/v1/mcp, header Authorization: Bearer followed by his key, read from a variable on his workstation.
Model answer
Cursor’s assistant lists the Nexus tools. Lucas also checks with curl: the tools/list method returns a list of tools.
He creates a key in his own name, with write access, since he wants the assistant to create tasks.
Request 2
Read the conventions for the [project name] project in Nexus, then create a task “Add tests for the CSV export”, high priority, due Friday. Show me the task before you create it.
Model answer
What to expect: the conventions summarised, then the task announced (title, priority, due date, project) and created only once Lucas agrees, with its link.
The assistant announces before writing: that is the ground rule Nexus gives it during the handshake.
What was checked before sending
The way in: the remote server, since Cursor is not in Nexus.
The write: announced, then approved by Lucas.
The permissions: Lucas’s, no more, no less.
For scale: a task created in one sentence from the editor, instead of three window switches.
Example 3
A leaked key
Mathilde is a project manager at a seven-person web agency in Pessac. An intern has pushed a configuration file to GitHub containing his Nexus API key, with write access. She notices on a Friday at 6pm.
A key published by mistake
14 hPushed file
The key in a configuration file.
18 hLeak spotted
Mathilde sees the file on GitHub.
18 h 05Key revoked
Every call returns 401.
18 h 30Log read
No outside writes, new read-only key.
Request 1
The intern’s action in Settings › API and MCP: key revoked. Mathilde, an administrator, checks in the company’s list of keys that it no longer responds.
Model answer
The key stops responding immediately: any call using it returns 401.
Revocation comes before everything else, even before cleaning the repository.
Request 2
An API key belonging to the intern was published on GitHub this afternoon, then revoked at 6:05pm. Read the company log and tell me what was done with this key between its publication and its revocation: calls, writes, secrets revealed.
Model answer
What to expect: what the log shows for this key over the period, especially secret reveals and writes. If no operations appear other than the intern’s, the assistant says so without concluding that there is no risk.
No outside writes. Mathilde still has someone who knows git remove the file from the repository history, and creates a new read-only key for the intern’s tool.
What was checked before sending
Revocation: done before anything else.
The log: read over the exposure period.
Next: a new read-only key, in the vault.
For scale: exposure limited to a few hours, instead of a key with write access readable on GitHub for weeks.
Hugo wants his spreadsheet to fill itself every Monday with the tasks from all projects. Malik will write the script. Hugo suggests: “Take my key, I’m an administrator, so you’ll see everything, and put it in the script, it’s simpler.” Say which key to create, by whom, with which settings, where to store it, and write the first two calls of the script.
Say who creates the key and why.
Give its settings: name, write access, expiry.
Say where it lives, and where it must never be.
Write the call that checks the key and the call that reads the projects.
Say what the script must do on a 401, a 403 and a 429.
See the answers
Hugo creates the key, since the dashboard needs to see every project and only his administrator rights allow that. But not “his” everyday key: a dedicated key, named “Monday dashboard”, read-only, with an expiry date (for example in one year, to be renewed). If the script leaks, Hugo revokes it without breaking anything else.
Stored in the internal project’s vault, type “API key”, Production environment.
Set as an environment variable on the machine that runs the script: NEXUS_CLE.
Never in the script, the spreadsheet, a repository, or a chat with an agent.
The first two callsTerminal
# 1. la clé fonctionne-t-elle ? (un objet membre attendu, celui d'Hugo)
curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $NEXUS_CLE" https://api.nexus-engine.eu/api/v1/auth/me
# 2. les projets visibles avec cette clé
curl -s -H "Authorization: Bearer $NEXUS_CLE" https://api.nexus-engine.eu/api/v1/projects
Reply
What the script does
401
Stops and writes “key missing, invalid, expired or revoked”: Hugo renews it.
403
Stops: a write was attempted with a read-only key. The script is at fault.
429
Waits for the delay given in the response, then resumes.
For tasks, Malik first reads the inventory (GET /endpoints?filter=Tâches) instead of guessing a route. He then has Hugo approve the list of spreadsheet columns before writing the rest of the script.
Practise
Three more exercises, from the most guided to the most demanding. The material is provided in full: copy it into your tool, then check your work against the criteria before opening the answers.
Level 1 · guided10 min
Read four responses
Here are four responses received by Hugo’s script. For each one, say what it means and what the script does.
The material to work on
1. {"statusCode":401,"error":"Unauthorized","message":"Non authentifié."}
2. {"statusCode":403,"error":"Forbidden","message":"[message de refus]"} sur un POST /tasks
3. {"statusCode":404,"error":"Not Found","message":"[introuvable]"} sur GET /projects/[identifiant copié d'un autre espace]
4. Une réponse 429 avec le délai à attendre
Check your work
1: key missing, invalid, expired or revoked.
2: valid key, write refused (read-only, role or restricted route).
3: not found, or belongs to another company.
4: limit reached, wait for the stated delay.
See the answers
Reply
Meaning
Action
401
No valid key
Check the NEXUS_CLE variable, then the key in Settings › API and MCP
403
A Nexus rule
Don’t look for another route: the read-only key must not write
Malik wants to use Codex, outside Nexus, on a personal project, with read-only access to the studio’s tasks. Write the configuration and the check, without any key appearing in a file.
The material to work on
Documentation checked on 15 November 2026:
Codex: in ~/.codex/config.toml, with the key set in the NEXUS_API_KEY environment variable:
[mcp_servers.nexus]
url = "https://api.nexus-engine.eu/api/v1/mcp"
bearer_token_env_var = "NEXUS_API_KEY"
Check your work
The key is created read-only, in the tool’s name.
The config.toml file contains only the variable name.
The variable is set in the shell profile or by the workstation’s secrets manager.
The check uses tools/list.
See the answers
~/.codex/config.tomlTOML
# le serveur MCP de Nexus pour Codex ; la clé n'est jamais écrite ici
[mcp_servers.nexus]
url = "https://api.nexus-engine.eu/api/v1/mcp"
bearer_token_env_var = "NEXUS_API_KEY"
Set the variable and checkTerminal
# la clé copiée depuis le coffre, posée pour la session du shell
export NEXUS_API_KEY="[votre-clé]"
curl -s -X POST https://api.nexus-engine.eu/api/v1/mcp \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Level 3 · demanding case30 min
Designing an agency’s keys
The Chartrons studio wants to connect four tools to Nexus. For each one, say who creates the key, with or without write access, with what expiry, where it lives, and the question to ask before creating it. Then write the request to an agent that checks no key has been left in the repository code.
The material to work on
1. Hugo's Monday dashboard (reads tasks from every project).
2. Malik's Cursor assistant (reads conventions, creates tasks in his projects).
3. A script of Théo's that reads the deployment log for the monthly client report.
4. A freelance contractor who wants “full API access for three weeks” for an integration.
Check your work
The dashboard: Hugo’s key, read-only.
Cursor: Malik’s key, with write access.
Théo’s script: read-only, and the question of his assignments.
The freelancer: no member’s key; an invitation with a limited role, then their own key, expiring in three weeks.
The check request doesn’t ask for any value to be displayed.
See the answers
Tool
Created by
Writing
Due date
Monday dashboard
Hugo (administrator)
No
One year, to be renewed
Malik’s Cursor
Malik
Yes
None, revoked when they leave
Théo’s monthly report
Théo’s, if he is assigned to the projects concerned
No
One year
Freelancer
The freelancer, invited as a User assigned only to the project
As needed
Three weeks
The freelancer never receives a studio member’s key: it would carry that member’s rights, and the log would mix the two. They are invited, assigned only to the integration project, and create their own key, expiring at the end of the assignment.
Check the repository
Search the whole repository, git history included, for a string that looks like a Nexus API key (prefix nexus_) or any other key or password written in plain text. Don’t display any values: give only the file, the line and the commit. If you find one, don’t fix anything yourself: tell me who needs to revoke it.
Roughly what you should get
What to expect: a list of files and commits, with no values displayed, or “no key found” with the method used. A key that is found is revoked first, before the history is cleaned.
Every request to the project agent written in the course, including model answers, worked examples and practice exercises, sorted by module and lesson, with filters to find the right one.
For each lesson, the main exercise and the three graded practice exercises with their materials, to do on paper or alongside Nexus; all model answers are gathered at the end.
The course’s worked examples, from the first project to production: the situation, the request as it was written, the agent’s typical answer and what was checked before approving.
All the lessons in a single PDF: objectives, written course with its diagrams, tables and requests, common mistakes, exercise and key takeaways. The practice exercises and answers are in the workbook, the examples in the collection.
Your notes stay on this device; they are not sent anywhere.
A question for the tutor
A result that doesn’t match the model answer, a prompt that gets you nowhere, a case specific to your business: write to us with your prompt and the response you got. A Bonbay Académie trainer replies within 24 working hours, on your case.