Coding with AI
This guide explains how to configure AI coding assistants such as Cursor, GitHub Copilot, and Claude Code for development with the Maps SDK for Flutter. AI assistants do not have built-in knowledge of the SDK API and may generate references to nonexistent classes and methods. Connecting the assistant to the documentation and adding a rules file prevents most of these errors.
What you need:
- An AI coding assistant with MCP server support, such as Cursor, Claude Code, VS Code with GitHub Copilot, or Windsurf
- A Flutter project using
magiclane_maps_flutter
Step 1: Connect the Context7 MCP server
Context7 is a documentation search service that indexes the Maps SDK for Flutter documentation. Once configured, the assistant searches the documentation automatically when generating SDK code.
Add the server to the assistant's MCP configuration:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
For complete details regarding Context7 setup on all platforms please check their configuration guide.
Restart the assistant to load the new server configuration. MCP configuration formats may change between versions; see the tool's documentation for current details. Context7 works without an account at a limited request rate. A free API key from the Context7 dashboard raises the rate limits.
To request a documentation lookup explicitly in a prompt:
Search all relevant APIs in the Magic Lane docs with Context7 before answering.
Context7 is a third-party service. Its index may lag behind a new SDK release. When an answer does not match the current API, reference the documentation pages directly as described below.
Step 2: Use the llms.txt files
Two files are generated with every documentation build and published alongside the docs:
| File | Contents | URL |
|---|---|---|
| llms-full.txt | Developer guides, explanations, and code examples | developer.magiclane.com/docs/flutter/llms-full.txt |
| llms.txt | Concise API overview and page index | developer.magiclane.com/docs/flutter/llms.txt |
These files follow the llms.txt standard and contain detailed concept explanations, code examples, documentation references, and source file locations for verification. The llms.txt index lists every documentation page with its plain-text .md URL, so an assistant can locate and fetch the pages relevant to a task.
Download both files and place them in your project. Each tool reads them differently - follow the setup for the one you use.
- Cursor
- GitHub Copilot
- JetBrains AI Assistant
- Windsurf
- Claude Desktop / Claude Code
- Create a
.cursordirectory in your project root. - Place
llms-full.txtandllms.txtinside it. - Open Cursor Settings → Rules and add a new rule with type Apply Intelligently.
- Set the description to: Use this rule whenever a question is asked about Magic Lane Maps SDK for Flutter.
- Reference the files in the rule body. Cursor will automatically use them when relevant.
- Create a
.copilotdirectory in your project root. - Place
llms-full.txtandllms.txtinside it. - In Copilot Chat, reference the files by stating:
Please use the context from the llms.txt files in the .copilot directorywhen answering questions about the Magic Lane Maps SDK.
- Create a
.idea/aidirectory in your project root. - Place
llms-full.txtandllms.txtinside it. - Reference the files in AI Assistant chat when asking about the SDK.
- Create a
.windsurfdirectory in your project root. - Place
llms-full.txtandllms.txtinside it. - Reference the files in chat for context-aware responses.
Pass the llms-full.txt URL directly in your prompt:
Use https://developer.magiclane.com/docs/flutter/llms-full.txt as context
for the following question about the Magic Lane Maps SDK for Flutter:
[YOUR QUESTION HERE]Step 3: Add a rules file
A rules file provides the assistant with SDK-specific instructions that apply to every request. Add the following section to the AGENTS.md file in the project root, or create the file with this content if it does not exist:
## Magic Lane Maps SDK for Flutter
This project uses the `magiclane_maps_flutter` package. Do not write SDK code
from memory: the API is large, and guessed names are usually wrong.
Working method: find the guide page for the feature in the `llms.txt` index,
fetch it, then start from its code example and adapt it. Copy SDK class names,
method names, parameter names, and callback signatures exactly as they appear
in the example. If the example does not cover something, fetch another page
from the index or verify the name in the API reference before using it.
Resources:
- `llms.txt` is the documentation index: every guide and example page with a
one-line description and its plain-text `.md` URL. Read it from this project
if the file is present, otherwise fetch
https://developer.magiclane.com/docs/flutter/llms.txt
Page URLs in the index are relative to https://developer.magiclane.com
- `llms-full.txt` is the complete documentation in a single file (large, about
1.8 MB). Read it from this project if present, or fetch
https://developer.magiclane.com/docs/flutter/llms-full.txt
only when broad context is needed; for a single feature, prefer fetching the
specific pages listed in `llms.txt`.
- If a Context7 MCP server is configured, search it for API details with this specific project: [Magic Lane Maps SDK for Flutter Documentation
](https://context7.com/magiclane/magiclane-maps-sdk-for-flutter-docs-context7)
- API reference: https://pub.dev/documentation/magiclane_maps_flutter/latest/
Rules:
- Use these two imports (guide code snippets may omit them). The SDK exports
`Route`, `Path` and `Orientation` classes that collide with Flutter's; after
hiding them, refer to the SDK types by their plain names, without a prefix:
`import 'package:flutter/material.dart' hide Route, Path, Orientation;`
`import 'package:magiclane_maps_flutter/magiclane_maps_flutter.dart';`
- After changing code, run `flutter analyze` and fix every reported issue
before finishing.
Rules file support by tool
Cursor, GitHub Copilot, Windsurf, and JetBrains Junie read AGENTS.md from the project root automatically. Two tools require an extra step:
| Tool | Configuration |
|---|---|
| Claude Code | Create a CLAUDE.md file containing the single line @AGENTS.md |
| Gemini CLI | Create a GEMINI.md file with the same content, or set context.fileName in settings.json |
Rules file support may change between tool versions; see the tool's documentation for current details. See agents.md for the file format and the list of supporting tools.
Troubleshooting
| Problem | Solution |
|---|---|
| Generated code uses a class or method that does not exist | Request a Context7 lookup, or paste the .md link of the relevant guide and ask for the code again using only names from that page. |
| Generated code does not compile | Paste the complete compiler error into the conversation. Verify that AGENTS.md is in the project root. |
| Generated code matches an older SDK version | Paste the .md link of the current guide page, together with the migration guide for the target version. |
| The map renders blank | Verify the API token and the platform setup. Usually caused by configuration, not by generated code. |
What's next?
- Magic Lane MCP server - Provides AI agents with runtime location search, routing, and map rendering. This server extends applications with location intelligence; it is not a coding assistance tool.
- API reference - Verify generated class and method names.
- Create your first application - Build a working map app to test the configuration.