Skip to content

enh: Add MCP documentation #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion fern/docs/pages/airdrop/initial-domain-mapping.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ The initial domain mapping is installed with your snap-in.
On each snap-in version update, function to upload these mappings to the Airdrop
system is triggered.

## Approaches

You can create initial domain mappings using two methods:

1. **Chef-cli UI**: Interactive web interface for comprehensive mapping creation
2. **Model Context Protocol (MCP)**: AI-assisted mapping creation for developers (experimental)

Choose the chef-cli UI for manual control or use MCP for rapid prototyping with AI assistance.
MCP is an experimental feature and works locally without requiring a sync to be created.

<Info>
For AI-assisted mapping creation, see the [Model Context Protocol integration guide](./mcp.mdx).
</Info>

## Chef-cli initial domain mapping setup

### Prerequisites
Expand Down Expand Up @@ -95,7 +109,7 @@ After the blueprint of the test import is completed, the *Install in this org* b

By repeating this process (run a new import, create a different configuration, merge to the initial mappings), you can create an initial mapping that contains multiple options for the user to choose from.

Finally, the Export button allows you to retrieve the `initial_domain_mapping.json`.
Finally, when all the fields are mapped without deficiencies and the blueprint is installed, the Export button allows you to retrieve the `initial_domain_mapping.json`.

<Tip>
You can also provide a local metadata file to the command using the `-m` flag, for example:
Expand Down
83 changes: 83 additions & 0 deletions fern/docs/pages/airdrop/mcp.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
The Model Context Protocol (MCP) is an open protocol that enables large language models to interact with applications through standardized interfaces.

Chef-cli provides MCP integration through the `chef-cli mcp initial-mapping` subcommand.
This integration allows AI assistants to programmatically edit and test initial domain mapping files.

## Limitations

<Warning>
MCP integration is experimental. Functionality may vary across different AI models and MCP clients.
</Warning>

Testing shows good results with Cursor and Claude Code. The AI can prepare initial mappings with significant autonomy, though developer oversight remains essential.

## Prerequisites

- Chef-cli installed and configured
- MCP-compatible client (Cursor, Claude Code, etc.)
- External domain metadata file
- Empty or partially populated initial domain mapping file

## Configuration

Create a `.mcp.json` file with the following content:

```json
{
"mcpServers": {
"airdrop": {
"command": "chef-cli",
"args": [
"mcp initial-mapping"
]
}
}
}
```

### Cursor setup

1. Provide `.cursor/mcp.json` in your project root.
2. Using the editor Agent mode point the AI to the initial domain mapping file.
3. Use the editor to guide the AI to create the initial domain mappings.
4. Use `initial-mapping check` to test the initial domain mappings against the local domain metadata file.

### Claude Code setup

1. Provide `.mcp.json` in your project root.
2. Using the editor point the AI to the initial domain mapping file.
3. Use the editor to guide the AI to create the initial domain mappings.
4. Use `initial-mapping check` to test the initial domain mappings against the local domain metadata file.

### Other IDEs

You can use the same `.mcp.json` file in other IDEs that support MCP.

## Usage guidelines

To guide the AI tool, provide the following instructions to your AI assistant:

```markdown
When asked to perform airdrop initial mapping:

- Refer to the `metadata.json` for the external domain metadata.
- Use `mappings.json` as your initial domain mapping file.
- Call 'use_mapping' to test out how the initial mapping behaves on the current metadata
- Use MCP tools to manipulate the initial mapping when adding and removing record type mappings, or unmapping fields or mapping simple fields.
For more complex field mappings you may edit the mapping file directly.
Refer to the `initial_mappings_schema.yaml` for its proper format.
- If doing so, always use 'use_mapping' to verify the mapping file is still valid.
```

Adjust file paths according to your project structure.

## Available operations

The MCP server provides tools for:

- Testing mappings against metadata
- Adding and removing record type mappings
- Field mapping and unmapping operations
- Validation of mapping file structure
- Testing initial domain mapping files against local metadata files

3 changes: 3 additions & 0 deletions fern/versions/public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ navigation:
- page: "Publish to the marketplace"
slug: publish-to-marketplace
path: ../docs/pages/airdrop/publish-to-marketplace.mdx
- page: "MCP integration"
slug: mcp
path: ../docs/pages/airdrop/mcp.mdx
- page: "Common issues"
slug: faq
path: ../docs/pages/airdrop/faq.mdx
Expand Down
Loading