How do I give Claude Code a key that can only work inside one Tares project?
Tares lets you create a project key under Settings, Keys in the project, and Claude Code connects with it over MCP using an Authorization Bearer header. The key reads that one project and records findings in it, and any other call answers 403. The instance must be started with auth so keys are checked.
How it works
A project key is scoped to a single Tares project. When Claude Code connects with it, Tares treats every call as belonging to that project.
- The key reads the project’s sources and records findings in the project. Any other call answers 403.
- The project is implied, so the MCP tools need no
projectargument. - You name the key after the agent that holds it, for example
claude-code. Every finding the agent records carries that name, so you can tell outside findings from those of Tares agents. - The secret is shown once, when you create the key.
- Keys are only checked when the instance runs with auth. On an open instance there are no keys, so you skip the key step and name the project in your prompts instead.
The full walkthrough is in Connect an outside agent to a project. If you do not have a project with sources and a trigger yet, the demo in AI SRE gives you one.
Set it up
-
Start Tares with auth, either with the
--authoption ontares upor withTARES_AUTH_TOKENset. Without auth, keys are not checked. -
Start the MCP endpoint. It serves
http://127.0.0.1:8788/mcp.tares mcp -
Open the project, go to Settings → Keys, and choose New key.
-
Name the key after the agent, such as
claude-code. Every finding it records carries this name. -
Copy the secret now. It is shown once.
-
Connect Claude Code with the key as an Authorization Bearer header:
claude mcp add --transport http tares http://localhost:8788/mcp \ --header "Authorization: Bearer <project key>" -
Check the connection in a Claude Code session by asking:
Use tares: which project can you work in?
Claude Code calls
list_projectsand names the one project the key belongs to.
If you prefer stdio, start tares-mcp with TARES_AUTH_TOKEN set to the project key in its environment instead of using the HTTP header.
The same steps work for other MCP clients such as Codex and Cursor. Only the connect command differs, and Connecting agents lists each one.
What you get
- Claude Code works inside one project and nowhere else. A call outside that project answers 403.
- It reads the project’s sources, follows the project’s skills with
list_skillsandget_skill, and sees what the Tares agents already found throughlist_findingsandproject_timeline. - It uses
statsto see which values moved andreadto get an entity’s timeline across the project’s sources. - It records its own conclusions with
record_finding. You give it an entity, a markdown finding and a one-word lowercase verdict such asrca. - Each finding appears as a card under What the agents found on the project’s Overview, under the key’s name. It is also a thread of its own in Activity under Advanced setup, marked as recorded from outside Tares.
- Each finding lands on the entity’s timeline in Explore, so the next Tares agent that reads that entity starts from it.
- You can cut the agent off at any time by revoking the key under Settings → Keys.
When something else fits
- If an agent runs on its own, such as a service with a webhook, it can join the project with
join_project(url)so every trigger firing is sent to it. Connect an outside agent to a project covers this optional step. - On an open instance with no auth, there are no keys. Skip the key step and name the project in your prompts instead.
Related
Still stuck? Get help