Guides
Add an AI API to your app from your editor
Use the Scalaix MCP server and the add_scalaix_endpoint prompt to draft, test, publish and call an endpoint without leaving your editor.
With the Scalaix MCP server connected, your coding assistant can build an endpoint in Scalaix and wire it into the code you have open. This guide adds a support-ticket classifier to an app, start to finish.
1. Connect the server
In Claude Code:
claude mcp add --transport http scalaix https://www.scalaix.com/mcpRun /mcp, choose scalaix → Authenticate, and approve access in the browser. Leave Build and test endpoints and Publish versions ticked. Tick Manage API keys too if you want the assistant to create the key for you. Other clients: see Connect.
2. Run the prompt
The server ships a prompt, add_scalaix_endpoint. In Claude Code it's a slash command:
/mcp__scalaix__add_scalaix_endpoint "classify support tickets into billing, bug or other with a priority from 1 to 5"In other clients, pick Add a Scalaix endpoint from the prompts menu, or just ask: "Use Scalaix to add an endpoint that classifies support tickets…".
3. What the assistant does
The prompt has it work in this order, telling you what it's doing:
- Reads your code to see the language, the HTTP client, how configuration is loaded and what data the call will have.
- Picks a project and collection (
list_projects,list_collections), or asks you. - Drafts the endpoint with
draft_endpoint: inputs named after the data your code has, and an output schema with exactly the fields your code needs. Nothing is saved yet. - Tests it with
test_endpointand realistic inputs from your code, and adjusts the prompt or schema until the output is right. - Saves and publishes with
create_endpointandpublish_collection. It asks first if the collection is already live. - Writes the call with
get_integration_codein your language. TypeScript, Python, Go, Java and C# get typed request and response models generated from the endpoint, so the compiler checks the fields you use. - Handles the key: the code reads
SCALAIX_API_KEYfrom the environment. With your OK it callscreate_keyand puts the key in your git-ignored.env(andSCALAIX_API_KEY=in.env.example), never in source code. - Wires it in and adds a test that mocks the HTTP call.
4. Check the result
- The endpoint is in the console under the collection you chose, with the version it published and its docs at
www.scalaix.com/<project>/<collection>. - Calls from your app show up in the project's Usage and in the developer pane's Logs.
- To change the endpoint later, ask the assistant: it uses
update_endpoint, tests, and publishes a new version. Pin a version with?version=in your code if you want changes to be opt-in.