Connect Cursor to Kojen over MCP
Add Kojen's MCP server to Cursor with a few lines of mcp.json, sign in with OAuth or use an API key, and let Cursor's agent train and evaluate your AI agents.
- 1Add the server. Add a kojen entry with url https://kojen.ai/api/mcp to ~/.cursor/mcp.json or the project's .cursor/mcp.json.
- 2Sign in. Open Cursor Settings → MCP (Tools & Integrations), find kojen and click to log in. Sign in to Kojen and allow the connection.
- 3Use it. In Agent mode, ask Cursor to work with your Kojen projects. It asks before running tools.
Add Kojen and sign in
{
"mcpServers": {
"kojen": { "url": "https://kojen.ai/api/mcp" }
}
}Put it in ~/.cursor/mcp.json for every project, or .cursor/mcp.json for one. Cursor shows the server under its MCP settings with a prompt to log in; that opens the Kojen sign-in, and after you allow the connection the tools appear in Agent mode.
With an API key instead
If you'd rather not use OAuth, send an account key (Settings → API Keys & MCP) as a header. Don't commit a key in a project file.
// ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project)
{
"mcpServers": {
"kojen": {
"url": "https://kojen.ai/api/mcp",
"headers": { "Authorization": "Bearer kojen_…" }
}
}
}Sign-in, keys and scopes
- Kojen's MCP server is streamable HTTP at
https://kojen.ai/api/mcp. Clients that support MCP authorization need only that URL: they open a Kojen sign-in and ask you to allow the connection. Kojen is the OAuth authorization server, with discovery at/.well-known/oauth-protected-resource/api/mcp, dynamic client registration and Client ID Metadata Documents. - An OAuth connection gets the
readandwritescopes. Starting paid GPU runs or buying credits needs an API key with thebillingscope. - Clients without sign-in support send
Authorization: Bearer kojen_…: create a key under Settings → API Keys & MCP. Keys expire (90 days by default) and can be revoked any time. - Disconnect an OAuth client under Settings → Connected apps. Its tokens stop working at once.
- Paid or destructive tools (deploy_model, start_training_run, delete_record, …) need
confirmed: true, which the agent should only set after you approve that exact action.
Things to ask once it's connected
- “Summarise my Kojen workspace.” (get_workspace_summary)
- “Create a dataset from these 20 support tickets and tune a prompt that classifies them.” (create_dataset, train_model, wait_for_run)
- “Evaluate the tuned model and tell me its trust score.” (evaluate_model)
- “Red-team my support agent for prompt injection.” (run_simulation)
- “Deploy the best version and give me the endpoint URL.” (deploy_model, which asks you to confirm first)
The full tool list, with each tool's inputs, is on the developer docs.
Get an API key
Kojen is free to start, no card needed. Train and evaluate an agent, deploy it behind an OpenAI-compatible endpoint, and connect your tools over MCP.