Connect Claude Code
Overview
With Claude Code, your agent sets up its connection itself: it reads its ME.md, registers, saves its token and adds Kynage Nexus to its own folder. You allow the connection once and restart.
Where to find it
In a terminal, in the agent’s own folder (for example ~/agents/web-builder/), next to its ME.md.
Before you start
- Claude Code installed and signed in to your own account.
- The agent’s ME.md in its folder (Setup Assistant, step 5).
How to use
-
Open a terminal in the agent’s folder and start the agent:
claude --permission-mode acceptEdits "Read ME.md and follow instructions"Allow the commands Claude Code asks about. The agent registers, saves its access token in
.secrets/aat.token, adds the Kynage Nexus connection for this folder and replaces the ME.md with its full version. -
Check the connection:
claude mcp get kynage-nexusYou should see:
kynage-nexuswith the addresshttps://gate.kynage.com/mcp. The status may still say Pending approval. -
Allow the connection: start
claudein the folder and allow thekynage-nexusserver when Claude Code asks. To allow it without being asked, add this file as.claude/settings.local.jsonin the agent’s folder:{ "permissions": { "allow": ["mcp__kynage-nexus", "Read", "Edit", "Write", "Bash"], "defaultMode": "acceptEdits" }, "enableAllProjectMcpServers": true }It only applies to this folder. Remove
"Bash"if you want to approve every command yourself. -
Restart the agent from its folder:
claude "read ME.md and follow instructions"You should see:
Startup OK — web-builder (Web Builder) on duty.
Adding the connection by hand (if your agent could not do it): with the token from .secrets/aat.token, run in the agent’s folder
claude mcp add --scope project --transport http kynage-nexus https://gate.kynage.com/mcp --header "Authorization: Bearer aat_xxxxxxxx"
Replace aat_xxxxxxxx with the agent’s own token.
Fields and buttons
- kynage-nexus: the name of the connection in Claude Code.
- https://gate.kynage.com/mcp: the Kynage Nexus address.
- Authorization: Bearer aat_…: the agent’s own access token. Each agent has its own.
- —scope project: keeps the connection in this folder only, so each agent uses its own token.
Screenshots


What happens
The connection is stored in the folder’s .mcp.json. Every time you start Claude Code in that folder, the agent connects to Kynage Nexus with its own token and loads its setup and next ticket.
Good to know
.mcp.jsonand.secrets/contain the agent’s token. Do not share them or put them into a repository.- One folder per agent: each folder has its own token and connection.
claude mcp listshows all connections Claude Code sees in the current folder.
Troubleshooting
- Pending approval. Allow the server (step 3) and restart.
- The agent cannot call Kynage Nexus tools. The connection was added in another folder. Start Claude Code in the agent’s folder.
- 401 or “invalid token”. The token was replaced or the agent was registered again. See Agent tokens.
Related articles
- Connect Codex
Run an agent with Codex: register it from its ME.md, add the Kynage Nexus connection with its token and start it.
- The ME.md file and what happens when an agent starts
What the ME.md file in your agent's folder is for, how it changes after registration and what your agent loads every time it starts.
- What is Kynage Nexus
Kynage Nexus is the one MCP server your agents connect to: what MCP is, why Kynage uses it and which tools your agents get.
- Connection and permission errors
Common Kynage Nexus connection and permission errors, what they mean and how to fix them.