Skip to main content

Put your AI assistant to work on your account

Last updated: December 2, 2026 | 30 minutes read

The Magic Lane MCP DevKit Server gives an AI assistant tools for what you manage in the Magic Lane developer portal: your Magic Lane Studio styles, your projects and their API keys, and the offline maps your apps use. This page shows how to install the server, connect it to your AI client and use its tools.

Core capabilities​

The server offers 20 tools in three groups. Each group is a toolset that you can turn on or off (see Toolsets):

  • Styles - List the Magic Lane Studio styles of your account and the shared templates, read a style's full JSON, create a style from a template or from a document, save new content, and edit the name, description, tags and purposes
  • Style validation - Check a style document against the style schema on your computer, with every problem listed by its place in the JSON
  • Style downloads - Get a style as JSON, or as the .style file your app loads with the Magic Lane Maps SDK
  • Style reference - Read the style editing essentials and the full style format pages, so the assistant edits with the format in front of it
  • Projects - List, read, create and update developer portal projects: name, description, allowed web origins and settings
  • API keys - List, read, create and rename the API keys of a project, masked unless you ask to see one on a local server
  • Offline maps - List the map versions an SDK can read, browse the catalog of a version, and download map files, with downloads that resume and are checked against the catalog

Getting started​

Prerequisites​

  • Node.js 22.12+ (Download here)
  • For the style and project tools: a Magic Lane secret key, created in the developer portal under CLI & Access, as Create a secret key shows. It starts with mlsk_
  • For the offline maps tools: an application's API token and its secret for the Offline Maps API. To get them, contact Magic Lane through Contact us. They are separate from the secret key, which is used for the portal only
  • An MCP-compatible client that can start a local server, such as Claude Code, Claude Desktop, Grok Build (formerly Cursor), VS Code with GitHub Copilot, Windsurf, a JetBrains IDE with AI Assistant, OpenAI Codex CLI or Gemini CLI (see Client configuration)

When you create the secret key, you choose a level for each category. The levels decide what the assistant may do:

CategoryReadRead & write adds
StudioThe tools that list, read and download styles, and validate_style given a style idcreate_style, update_style, edit_style_details
Projectslist_projects, get_projectcreate_project, update_project
API keyslist_api_keys, get_api_keycreate_api_key, rename_api_key

A tool whose level the key lacks answers insufficient_scope and names the level to add. get_style_reference, and validate_style given a document or a file, do not read your account, so they need no level.

warning

A secret key is not an API key. API keys are what your apps use with the Magic Lane SDKs and APIs; a secret key lets a tool work on your account. Keep it to yourself, since the assistant acts as you, and give it only the levels you need.

Installation​

Run the server directly without installation:

export MAGICLANE_SECRET_KEY="mlsk_your_secret_key"
npx -y -p @magiclane/mcp-devkit-server magiclane-devkit-mcp

Most of the time you do not run this yourself: your AI client starts the server with the same command (see Client configuration).

Configuration​

The server takes its settings from environment variables:

VariableRequiredDefaultPurpose
MAGICLANE_SECRET_KEYfor styles and projects-Your secret key (mlsk_...), with the levels you need. Used for the portal only: styles, projects and API keys. Without it, the server offers the offline maps tools alone
MAGICLANE_OFFLINE_MAPS_API_KEYno-An application's API token, for the offline maps tools only. Magic Lane support gives you the token and its secret. Set it together with the secret below, or neither
MAGICLANE_OFFLINE_MAPS_SECRETno-The secret of that application
MAGICLANE_TOOLSETSnoallThe groups of tools to offer: styles, projects, offline_maps, separated by commas
MAGICLANE_FILES_DIRno-The one folder the tools may read and write files in, on a local server: style files, downloads, key files and offline maps. A relative path is taken from it, and a path outside it is refused, also through a link. The folder must exist. Unset, any path on your computer is allowed
HTTP_TIMEOUT_SECONDSno30Timeout for one outgoing request. Whatever it is set to, a request with its retry and waits ends within 50 seconds, so a tool call answers before AI clients give up on it (often after 60 seconds). A map download is the exception: it runs until the file is complete, and stops only when no data comes for 60 seconds
VERBOSEnofalsePrint a line for every tool call and its result to the server's log. Warnings and errors are always printed
  • Keys are never tool inputs. They come from the environment only, so the assistant never needs them and never asks for them.
  • The server reads no .env file. An AI client starts it in a folder of its own choosing, often your project, so give the server its variables in the client's configuration.
  • A key that cannot work stops the server at startup, with a message that names the variable: a secret key that does not start with mlsk_, or any key with a space, a line break or a character outside plain ASCII in it. Paste it again as one line.

Toolsets​

Every tool's name, description and input schema is sent to the model in every conversation, whether the tool is used or not. MAGICLANE_TOOLSETS keeps the server to the tools you need:

ToolsetToolsNeeds
styleslist_styles, list_templates, get_style, download_style, create_style, update_style, edit_style_details, validate_style, get_style_referenceMAGICLANE_SECRET_KEY, with Studio levels
projectslist_projects, get_project, create_project, update_project, list_api_keys, get_api_key, create_api_key, rename_api_keyMAGICLANE_SECRET_KEY, with Projects and API keys levels
offline_mapslist_offline_map_versions, list_offline_maps, download_offline_mapMAGICLANE_OFFLINE_MAPS_API_KEY and MAGICLANE_OFFLINE_MAPS_SECRET
  • Unset, empty or all offers every toolset: 20 tools with the offline maps token and secret set, 17 without them, because offline_maps is then left out.
  • A toolset that is off is not offered at all, whatever the secret key allows: a server with styles only cannot create projects or API keys.
  • Without a secret key, styles and projects are left out, and the server offers the offline maps tools alone.
  • A mistake stops the server at startup with a message that says what to fix: an unknown name, styles or projects named without a secret key, neither a secret key nor the offline maps token and secret, offline_maps named without its token and secret, or only one of the two set.

For example, to offer the style tools only:

"env": {
"MAGICLANE_SECRET_KEY": "mlsk_...",
"MAGICLANE_TOOLSETS": "styles"
}

Client configuration​

Every client below starts the server on your own computer and gives it your secret key in its configuration. Put your key in place of mlsk_..., and add the other variables of Configuration next to it when you need them.

Run this in a terminal, with your key in place of mlsk_.... It adds the server for all your projects:

claude mcp add --scope user --env MAGICLANE_SECRET_KEY=mlsk_... --transport stdio magiclane-devkit -- npx -y -p @magiclane/mcp-devkit-server magiclane-devkit-mcp

Run claude mcp list to check that the server is connected.

For a local build, use the command node with the absolute path to dist/devkit-server.esm.js in place of npx and its arguments.

The repository has setup guides for these clients:

Running the server over HTTP​

The stdio server above is for MCP-native clients, which start it on your own computer. For web applications, remote agents and clients that cannot start a process, run the Streamable HTTP server:

export MAGICLANE_SECRET_KEY="mlsk_your_secret_key"
npx -y -p @magiclane/mcp-devkit-server magiclane-devkit-mcp-http

It listens on http://127.0.0.1:3000/mcp.

  • Every request presents the server's access key, in the magiclane-access-key header or as Authorization: Bearer. Unless you set a token, the access key is the secret key itself, which is allowed only for clients on your own computer: the server must listen on 127.0.0.1, localhost or ::1, and each request must be addressed to one of those names and carry no Forwarded, X-Forwarded-For, X-Forwarded-Host or X-Real-IP header. Any other request is refused with 403.
  • On any other address the server needs MCP_AUTH_TOKEN, a token of at least 32 characters, at least 8 of them different, and does not start without it. A server for the offline maps tools alone has no secret key, so it needs the token on your own computer too. Clients then present the token and never hold the secret key, which stays on the server. Put the server behind TLS before other machines can reach it.
  • A reverse proxy needs MCP_AUTH_TOKEN, also one on the same computer. A proxy can hide that a request came through it, so the check above cannot be relied on behind one. Also set MCP_TRUST_PROXY to the number of proxies in front of the server, usually 1. The server then counts each client by the address the proxy writes in the X-Forwarded-For header; without it, every client counts as the proxy, and they share one rate limit. The proxy must write that header itself, or add the client's address to it.
  • Browser apps need ALLOWED_ORIGINS. A request from a web page carries an Origin header, and the server refuses it unless ALLOWED_ORIGINS lists that origin, such as https://app.example.com. MCP_HOST and MCP_PORT set the address and the port the server listens on.
  • No tool reads or writes a file. Over HTTP a path would name a file on the server, so the tools have no path or tokenPath input and download_offline_map is not offered. download_style returns the download in the result.
  • No full API key is shown. get_api_key and create_api_key have no revealToken input over HTTP, so a client that runs read-only tools without asking cannot put a key into the conversation. See the full key in the developer portal.
  • A request body is limited to 40 MiB (MCP_MAX_BODY_BYTES) and 1,000,000 JSON values.

Each client presents the access key in the magiclane-access-key header: the token, or the secret key when the server has no token. Clients write the entry differently. In each snippet, replace the address with your server's.

Grok Build, formerly Cursor, still reads the Cursor files. Put this in ~/.cursor/mcp.json, or in .cursor/mcp.json for one project:

{
"mcpServers": {
"magiclane-devkit": {
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"magiclane-access-key": "<the token, or the secret key when the server has no token>"
}
}
}
}

See the HTTP Server Setup Guide for complete documentation.

Available tools​

warning

Style, template, project and API key names, descriptions and tags, and the style reference pages, are written by other people with access to the account or the website, and the model reads them in tool results. Such a text can be written to look like an instruction. The server tells the model to treat it as data, never as instructions, and removes control and bidirectional characters from it. Every tool declares readOnlyHint and destructiveHint: keep your client asking before it runs a tool that changes something, above all update_project, the style saves and create_api_key, so that no such text can make a change or reveal a key without you seeing it.

1. Styles​

Read and change the styles of your account, the ones you edit in Magic Lane Studio. The secret key needs Studio: Read, and Studio: Read & write for the tools that change a style.

ToolWhat it does
list_stylesLists your styles, newest first
list_templatesLists the shared templates a new style can start from
get_styleReads one style or template, with its JSON and version
download_styleDownloads a style as JSON, or as the .style file your app loads
create_styleCreates a style from a template, a document or a file
update_styleReplaces the whole content of a style
edit_style_detailsChanges the name, description, tags and purposes
validate_styleChecks a style document on your computer against the style schema and the rules the schema cannot express; given a style id, it reads that style first
get_style_referenceReads the style format documentation

The usual way to change a style:

  1. get_style reads the JSON and its version.
  2. The assistant edits the JSON, then validate_style checks it.
  3. update_style saves it, with that version as baseVersion. It checks the document against the style schema again before sending it, and sends nothing if the check finds a problem.
  4. If the save returns warnings, the assistant fixes them and saves again.

Keep in mind:

  • Problems stop a save, warnings do not. A problem is something the style schema refuses, listed with its place in the JSON. A warning is something to fix before you finish: a filter with an empty condition list, which Studio shows as Filter unreadable, or a break of a rule the schema cannot express, such as layer ids that do not go down to 1, a group or image that a layer names but the style does not have, minzoom above maxzoom, or an image over Studio's 400 KB. Each warning names the layer, group, image or font. It comes with a fix that does not change the map, asks you to decide when every fix would change it, or says how the assistant fixes it, as for layer ids. validate_style, create_style and update_style all return them. Some shared templates have warnings, so a style made from one starts with them. Paint that Studio does not offer for a layer's type is only a note: Studio hides it, and it can stay.
  • Versions protect your work. A style's version changes on each save, by the server or in Studio. If the style was saved since the assistant read it, the save is refused with a conflict, nothing changes, and the assistant reads the style again.
  • A save only saves. Publishing, reverting and deleting a style are done in Studio.
  • A style can stay in a file. A style is 170 to 190 KB of JSON. On a local server, download_style writes it to a file whose name ends in .json (a .style file's name ends in .style), the assistant edits only the lines it needs, and validate_style and update_style read it from that file.
  • The assistant reads the format before it edits. get_style_reference returns the style editing essentials, and the full style file format, map data sources and layer types reference pages of this documentation.

The same reference is also offered as MCP resources, for clients that read them:

ResourceWhat it holds
magiclane://docs/style-essentialsThe style editing essentials, built into the server
magiclane://docs/style-file-formatThe style file format page
magiclane://docs/map-data-sourcesThe map data sources page
magiclane://docs/layer-types-referenceThe layer types reference page
magiclane://schemas/engine-styleThe style JSON Schema that validate_style applies
magiclane://studio/templatesThe template list, the same data as list_templates

Example Prompts:

  • "List my Studio styles. Which of them have never been published?"
  • "Create a style called Night mode from the Basic 1 Modern template and tag it night."
  • "Make the water in my Night mode style darker and save it."
  • "Validate the style file styles/night.json and list what is wrong."
  • "Download the .style file of my Night mode style into my app's assets folder."
  • "How are colours stored in a style file?"

2. Projects and API keys​

Manage the projects of your account and the API keys inside them, the ones the Get Started guide creates by hand in Create a project and Create an API Key. Each tool needs its own level on the secret key:

ToolWhat it doesSecret key level
list_projectsLists your projectsProjects: Read
get_projectReads one projectProjects: Read
create_projectCreates a projectProjects: Read & write
update_projectChanges a project's settingsProjects: Read & write
list_api_keysLists a project's API keys, maskedAPI keys: Read
get_api_keyReads one API keyAPI keys: Read
create_api_keyCreates an API key in a projectAPI keys: Read & write
rename_api_keyRenames an API keyAPI keys: Read & write

Keep in mind:

  • API keys are secrets. A key is shown masked, as its last 4 characters, unless you ask to see it on a local server. The HTTP server never shows the full key: see it in the developer portal.
  • A key can go to a file. On a local server, ask the assistant to save the key to a file: the full key is written there and never enters the conversation. An existing file is replaced only when you ask for it.
  • A key expires. A new key is valid for 6 months unless you ask for another date, which can be at most 10 years ahead.
  • A project created here has no API key until you ask for one.
  • Nothing is deleted here. Disabling or deleting a project or an API key is done in the developer portal.

Example Prompts:

  • "List my Magic Lane projects."
  • "Create a project called Fleet tracker for our delivery web app on https://fleet.example.com."
  • "Add https://app.example.com to the origins of my Fleet tracker project."
  • "Create a key Production for my Fleet tracker project, valid until the end of 2027, and save it to keys/fleet-production.txt."
  • "Are any keys of my Fleet tracker project expired or about to expire?"
  • "Rename the key Web staging of my Fleet tracker project to Web testing."

3. Offline maps​

Find and download the map files an app uses without a connection, using the Magic Lane Offline Maps API. These tools need MAGICLANE_OFFLINE_MAPS_API_KEY and MAGICLANE_OFFLINE_MAPS_SECRET; without them they are not offered. To get the API token and its secret, contact Magic Lane through Contact us.

ToolWhat it does
list_offline_map_versionsLists the map versions an SDK can read, newest first
list_offline_mapsLists the downloadable maps of one version: the world basemap and the maps of countries and states, with their sizes
download_offline_mapDownloads one map file to disk. Local server only

The usual way to get maps:

  1. list_offline_map_versions to pick a version.
  2. list_offline_maps, with a filter such as a continent or a country, to find the maps.
  3. download_offline_map for the basemap, then for each map.

Keep in mind:

  • Name the map capability of your SDK. Without it the tools use the latest, which may list versions an older SDK cannot read.
  • One map version on a device. Every map must have the same map version as its basemap. When you upgrade, download the new basemap first, then every regional map again.
  • One catalog on a device. All maps on a device must come from the same catalog. An account with a custom catalog gets it automatically; ask for the standard catalog if you need the standard Magic Lane one.
  • Downloads are resumable and checked. Maps are large: the basemap is about 190 MB, a country up to several GB. A download that is cancelled or breaks off continues on the next call, and the finished file is checked against the size and checksum of the catalog before it gets its name.
  • Large downloads report their progress. A client that asks for progress gets progress notifications while a map downloads. A country can take longer than your client waits for a tool call: if the client gives up, what was downloaded is kept, and asking for the same map again continues it.
  • One download at a time for a file. A second request to download to the same path is refused while the first is running. Downloads to other paths run at the same time.
  • An existing file is never replaced unless you ask for it.

Example Prompts:

  • "Which offline map versions can an SDK with capability 15 use?"
  • "List the offline maps of Europe in the latest map version, with their sizes."
  • "Download the world basemap and the Netherlands map of version 7.546 into ./maps."

For the parameters of every tool, see the README of the repository.

Troubleshooting​

Every tool error says what went wrong in a sentence and carries a code:

ErrorSolution
key_invalid, key_expiredThe secret key is unknown, revoked or expired. Check it under CLI & Access in the developer portal, and regenerate it or create a new one: see Regenerate or revoke a secret key
insufficient_scopeThe secret key lacks the level the tool needs. The message names the level to add
account_inactiveThe account that owns the secret key is not active. Contact Magic Lane
studio_not_allowedMagic Lane Studio is not enabled for your account, so the style tools cannot be used. The project tools still work
too_many_failed_attemptsToo many requests with a missing, invalid or revoked key came from your address. A valid key is never refused by this limit, so fix the key rather than wait
style_not_found, project_not_found, api_key_not_foundThe id does not exist in your account. Ask the assistant to list the items again
conflictThe style was saved since the assistant read it. Ask it to read the style again before saving
template_read_onlyTemplates cannot be changed. Create a style from the template, then change that style
template_not_foundA new style starts from a template in the template list, not from one of your styles. To copy a style, ask the assistant to read it and create a style from its JSON
invalid_styleThe style document does not match the style schema, found by the check on your computer or by the portal. The error lists what is wrong, and nothing was saved
payload_too_largeThe style is larger than the portal accepts. The message gives the limit
build_failed, build_timeoutThe portal could not build the .style file. The message says what it reported: fix the style, or try again later
name_takenThe name is already used. Project names are unique in your account, and API key names in their project
project_limit_reached, api_key_limit_reachedYour plan allows no more projects, or the project has too many API keys. Disabling projects and keys is done in the developer portal
api_key_not_createdThe key service could not create the key. Try again later, or create it in the developer portal
offline_maps_not_allowedYour account has no offline maps, so a project cannot be given an offline maps key
rate_limitedToo many requests in a minute. Wait the time the error gives
validation, invalid_parameterA tool input is not valid. Check the format of what you asked for
configThe offline maps API token or its secret is missing. Set MAGICLANE_OFFLINE_MAPS_API_KEY and MAGICLANE_OFFLINE_MAPS_SECRET. A wrong one answers key_invalid
integrityA downloaded map did not match the catalog's checksum and was deleted. Download it again
cancelledA map download was cancelled. What was downloaded is kept, and the same request continues it
result_mismatchThe call completed, but its result was not in the expected form. If the tool changes something, the change was made: do not repeat it
network, timeout, non_jsonThe service could not be reached, or did not answer as expected. Try again later. For a create, read the note below first
HTTP 403The HTTP server has no MCP_AUTH_TOKEN, and the request did not come straight from this computer: it was addressed to a name other than 127.0.0.1, localhost or ::1, or carried a proxy forwarding header. Set MCP_AUTH_TOKEN and give clients the token. A 403 from /health on a server that has a token means the same about the name: a server that listens on your own computer answers /health only as 127.0.0.1, localhost or ::1, unless MCP_TRUST_PROXY is set
HTTP 413The request body is larger than MCP_MAX_BODY_BYTES (40 MiB by default) or holds more than 1,000,000 JSON values
internal_errorThe portal hit an error of its own. The error carries a request_id: quote it to Magic Lane support
not_foundThe portal has no such address, usually because an id is not in the right form. Ask the assistant to list the items again

When the answer to create_style, create_project or create_api_key is lost, the tool does not send the request again, since the API cannot delete what a second request would create. It looks the new item up in your account instead and says what it found (create_style reads your style list before it creates, and takes a style as the new one only if it has the name, was not in that list and is not published): the item was created, it was probably not created, or the outcome is not known because the account could not be read either. In the last two cases, ask the assistant to list the items and look for the name before creating it again.

If something else is wrong:

  • The server does not start: check that node --version shows 22.12 or newer, and read the message in your client's MCP log. It names the setting to fix: a secret key that is misspelled or missing for the style and project tools, a MAGICLANE_FILES_DIR that names no folder, an unknown toolset, or only one of the two offline maps variables.
  • Tools are missing: a toolset left out of MAGICLANE_TOOLSETS is not offered, and the offline maps tools need their token and secret. download_offline_map and the file inputs exist on the local server only.
  • You need more detail: set VERBOSE=true to see a line for every tool call and its result in your client's MCP log, with the request ids to quote to support.

For detailed troubleshooting and complete parameter documentation, visit the GitHub repository.

Data usage & privacy​

The server works on your own Magic Lane account, and contacts Magic Lane services only:

  • Your Account Data - The styles, projects and API keys you read, create or change are sent to and stored by the developer portal, as they are when you use the portal or Studio yourself
  • Keys Stay in the Environment - The secret key is sent only to the portal, and the offline maps token and secret only to the Offline Maps API. They are never tool inputs and are never written to the server's logs
  • No Database - Requests are made only when a tool is called. The server keeps the style reference pages and an offline maps catalog in memory for a short time, and nothing else
  • Files Only Where You Say - The server writes a file to your computer only when a tool is given a path: a downloaded style, an API key or an offline map. With MAGICLANE_FILES_DIR set, only inside that folder
  • Your AI Client Sees the Conversation - Tool inputs and results pass through your AI client and its model provider, under their own terms. API keys are masked in results unless you ask to see one on a local server

For details, review our Terms of Service and Privacy Policy.

Resources​