|
| 1 | +The Model Context Protocol (MCP) is an open protocol that enables large language models to interact with applications through standardized interfaces. |
| 2 | + |
| 3 | +Chef-cli provides MCP integration through the `chef-cli mcp initial-mapping` subcommand. |
| 4 | +This integration allows AI assistants to programmatically edit and test initial domain mapping files. |
| 5 | + |
| 6 | +## Limitations |
| 7 | + |
| 8 | +<Warning> |
| 9 | +MCP integration is experimental. Functionality may vary across different AI models and MCP clients. |
| 10 | +</Warning> |
| 11 | + |
| 12 | +Testing shows good results with Cursor and Claude Code. The AI can prepare initial mappings with significant autonomy, though developer oversight remains essential. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- Chef-cli installed and configured |
| 17 | +- MCP-compatible client (Cursor, Claude Code, etc.) |
| 18 | +- External domain metadata file |
| 19 | +- Empty or partially populated initial domain mapping file |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +Create a `.mcp.json` file with the following content: |
| 24 | + |
| 25 | +```json |
| 26 | +{ |
| 27 | + "mcpServers": { |
| 28 | + "airdrop": { |
| 29 | + "command": "chef-cli", |
| 30 | + "args": [ |
| 31 | + "mcp initial-mapping" |
| 32 | + ] |
| 33 | + } |
| 34 | + } |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +### Cursor setup |
| 39 | + |
| 40 | +1. Provide `.cursor/mcp.json` in your project root. |
| 41 | +2. Using the editor Agent mode point the AI to the initial domain mapping file. |
| 42 | +3. Use the editor to guide the AI to create the initial domain mappings. |
| 43 | +4. Use `initial-mapping check` to test the initial domain mappings against the local domain metadata file. |
| 44 | + |
| 45 | +### Claude Code setup |
| 46 | + |
| 47 | +1. Provide `.mcp.json` in your project root. |
| 48 | +2. Using the editor point the AI to the initial domain mapping file. |
| 49 | +3. Use the editor to guide the AI to create the initial domain mappings. |
| 50 | +4. Use `initial-mapping check` to test the initial domain mappings against the local domain metadata file. |
| 51 | + |
| 52 | +### Other IDEs |
| 53 | + |
| 54 | +You can use the same `.mcp.json` file in other IDEs that support MCP. |
| 55 | + |
| 56 | +## Usage guidelines |
| 57 | + |
| 58 | +To guide the AI tool, provide the following instructions to your AI assistant: |
| 59 | + |
| 60 | +```markdown |
| 61 | +When asked to perform airdrop initial mapping: |
| 62 | + |
| 63 | +- Refer to the `metadata.json` for the external domain metadata. |
| 64 | +- Use `mappings.json` as your initial domain mapping file. |
| 65 | +- Call 'use_mapping' to test out how the initial mapping behaves on the current metadata |
| 66 | +- Use MCP tools to manipulate the initial mapping when adding and removing record type mappings, or unmapping fields or mapping simple fields. |
| 67 | + For more complex field mappings you may edit the mapping file directly. |
| 68 | + Refer to the `initial_mappings_schema.yaml` for its proper format. |
| 69 | + - If doing so, always use 'use_mapping' to verify the mapping file is still valid. |
| 70 | +``` |
| 71 | + |
| 72 | +Adjust file paths according to your project structure. |
| 73 | + |
| 74 | +## Available operations |
| 75 | + |
| 76 | +The MCP server provides tools for: |
| 77 | + |
| 78 | +- Testing mappings against metadata |
| 79 | +- Adding and removing record type mappings |
| 80 | +- Field mapping and unmapping operations |
| 81 | +- Validation of mapping file structure |
| 82 | +- Testing initial domain mapping files against local metadata files |
| 83 | + |
0 commit comments