MCP Setup
Legend Prime offers two MCP servers: a local server (recommended) that runs on your machine with full signing capabilities, and a remote server for read-only or shared access.Local MCP Server (recommended)
The local server runs vialegend-cli mcp serve and includes all tools plus local-only capabilities like plan_and_execute (create + sign + execute in one tool call).
The
legend-cli binary installation paths below are planned but may not yet be available. Check legend.xyz for the latest.Claude Code
Cursor
Add to your MCP settings (.cursor/mcp.json or Settings > MCP):
legend-cli login in your terminal to authenticate.
Team Projects (.mcp.json)
Share the local MCP config with your team:
legend-cli login once to authenticate with their own Google account.
Remote MCP Server
The remote server athttps://prime-api.legend.xyz/mcp is best for read-only operations or when you don’t need local signing.
- Claude Code (OAuth)
- Claude Code (Query Key)
- Cursor
- OpenAI Responses API
No API key needed — authenticate with your Google account.Then in Claude Code:Select “legend-remote” > “Authenticate” > sign in with Google. A Prime Account is created automatically if you don’t have one.
Local vs Remote: When to Use Which
| Local MCP | Remote MCP | |
|---|---|---|
| Signing | Built-in — plan_and_execute does everything | Requires separate CLI Bash call for signing |
| Auth | legend-cli login (Google SSO, 30-day JWT) | OAuth or query key |
| Setup | Install CLI + claude mcp add | Just claude mcp add |
| Team sharing | Each person runs their own | Shared via query key |
| Best for | Agents that execute transactions | Read-only dashboards, shared team access |
Setting Up Signing
To execute plans (move funds), you need a P256 signing key. This is only needed if your agent will create and execute transactions — read-only operations work without it.With Local MCP (easiest)
The agent can create a signing key directly via thecreate_account tool:
“Create a new Legend account with keygen”The
create_account tool generates a P256 key in Secure Enclave and creates the account in one step. Then plan_and_execute handles signing automatically.
With CLI
- Generates a P256 key in your Mac’s Secure Enclave (non-exportable)
- Sends the public key to Legend to create a Turnkey-backed sub-account
- Saves the account details to a local profile
Sign Plan Digests (remote MCP only)
When using the remote MCP server, the agent creates a plan via MCP and gets back adigest. To execute:
Add a CLAUDE.md Snippet
For Claude Code, add this to your project’sCLAUDE.md to help the agent use Legend tools effectively:
Troubleshooting
| Issue | Fix |
|---|---|
| ”401 Unauthorized” | Run legend-cli login or check your query key |
| Tools not appearing | Run /mcp to check server status |
| ”Account not found” on tool call | Use list_accounts to get valid account IDs |
| Plan expired | Plans last 2 minutes — create a new one and execute promptly |
| ”No profile found” on sign | Run legend-cli login then legend-cli accounts create --keygen |
| Local MCP not connecting | Verify legend-cli mcp serve runs without errors in your terminal |