{"id":106,"date":"2025-11-04T13:16:37","date_gmt":"2025-11-04T13:16:37","guid":{"rendered":"https:\/\/magendoo.ro\/insights\/?p=106"},"modified":"2025-11-04T13:17:03","modified_gmt":"2025-11-04T13:17:03","slug":"supercharge-magento-2-ai-development-with-mcp-servers-rest-api-graphql-documentation-at-your-fingertips","status":"publish","type":"post","link":"https:\/\/magendoo.ro\/insights\/supercharge-magento-2-ai-development-with-mcp-servers-rest-api-graphql-documentation-at-your-fingertips\/","title":{"rendered":"Supercharge Magento 2 AI Development with MCP Servers: REST API &amp; GraphQL Documentation at Your Fingertips"},"content":{"rendered":"<h2 id=\"introduction-the-dawn-of-ai-powered-e-commerce-development\">Introduction: The Dawn of AI-Powered E-Commerce Development<\/h2>\n<p>Picture this: You&#8217;re building a complex Magento 2 integration\u2014maybe a custom checkout flow, an advanced product import system, or a sophisticated order management dashboard. Traditionally, this means hours of browsing documentation, cross-referencing REST and GraphQL APIs, and constantly switching between browser tabs and your IDE. But what if an AI agent could access the entire Magento documentation instantly, understand your requirements, and generate production-ready code in minutes?<\/p>\n<p>Welcome to the world of <strong>agentic development for Magento 2<\/strong>, where AI agents augmented with Model Context Protocol (MCP) servers transform how we build e-commerce applications. Today, I&#8217;m excited to introduce two powerful open-source MCP servers that bring the complete Magento 2 REST API and GraphQL documentation directly to AI agents like Claude, enabling unprecedented development speed and accuracy.<\/p>\n<p>These aren&#8217;t just documentation search tools\u2014they&#8217;re intelligent bridges between AI agents and Magento&#8217;s vast API ecosystem, covering 594 REST endpoints, 350+ GraphQL documentation pages, and nearly 1,000 working code examples. Whether you&#8217;re implementing authentication flows, building product catalogs, or creating complex B2B integrations, these MCP servers provide instant, structured access to everything an AI agent needs to generate correct, production-ready code.<\/p>\n<p>In this comprehensive guide, we&#8217;ll explore how these MCP servers work, why they matter for Magento 2 AI development, and how you can start using them today to build intelligent applications faster than ever before.<\/p>\n<hr \/>\n<h2 id=\"understanding-model-context-protocol-for-ai-development\">Understanding Model Context Protocol for AI Development<\/h2>\n<h3 id=\"what-is-model-context-protocol-\">What is Model Context Protocol?<\/h3>\n<p>Model Context Protocol (MCP), developed by Anthropic, is a standardized communication protocol that enables AI agents to interact with external tools and data sources. Think of it as USB for AI\u2014a universal interface that lets AI models &#8220;plug into&#8221; different capabilities without custom integrations for each tool.<\/p>\n<p>At its core, MCP creates a <strong>client-server architecture<\/strong> where:<\/p>\n<ul>\n<li><strong>MCP Clients<\/strong> are AI applications (like Claude Desktop, custom AI agents, or development tools)<\/li>\n<li><strong>MCP Servers<\/strong> are specialized tools that expose specific capabilities (documentation search, database access, API integrations)<\/li>\n<li><strong>Communication<\/strong> happens over STDIO (standard input\/output), making it simple, fast, and language-agnostic<\/li>\n<\/ul>\n<h3 id=\"why-mcp-matters-for-documentation-access\">Why MCP Matters for Documentation Access<\/h3>\n<p>Traditional approaches to giving AI agents documentation access have significant limitations:<\/p>\n<p><strong>Web Scraping:<\/strong> Slow (30-60 seconds startup), requires network access, parsing HTML is error-prone, and results are unstructured.<\/p>\n<p><strong>Direct API Calls:<\/strong> Limited by rate limits, network latency, and often lacks comprehensive documentation coverage.<\/p>\n<p><strong>Manual Copy-Paste:<\/strong> Doesn&#8217;t scale, introduces human error, and can&#8217;t keep up with AI agent speed.<\/p>\n<p>MCP solves these problems by providing:<\/p>\n<p>\u2705 <strong>Offline Operation<\/strong> &#8211; No network dependency, works anywhere<br \/>\n\u2705 <strong>Lightning-Fast Search<\/strong> &#8211; Millisecond response times with FTS5 indexes<br \/>\n\u2705 <strong>Structured Data<\/strong> &#8211; Properly formatted schemas, parameters, and responses<br \/>\n\u2705 <strong>Context-Aware<\/strong> &#8211; AI agents can explore documentation relationships<br \/>\n\u2705 <strong>Always Current<\/strong> &#8211; Local documentation ensures consistency<\/p>\n<p>For Magento 2 development specifically, MCP enables AI agents to:<\/p>\n<ul>\n<li>Search 594 REST endpoints in &lt;100ms<\/li>\n<li>Find GraphQL queries and mutations instantly (5.5ms average)<\/li>\n<li>Access 963 code examples with surrounding context<\/li>\n<li>Explore 13 step-by-step tutorials for complex workflows<\/li>\n<li>Understand data schemas and type definitions completely<\/li>\n<\/ul>\n<p>This transforms AI from &#8220;helpful assistant with occasional hallucinations&#8221; to &#8220;expert developer with perfect memory of every Magento API.&#8221;<\/p>\n<hr \/>\n<h2 id=\"two-powerful-mcp-servers-for-magento-2-development\">Two Powerful MCP Servers for Magento 2 Development<\/h2>\n<p>The Magento 2 ecosystem now has two complementary MCP servers, each optimized for different aspects of API development:<\/p>\n<h3 id=\"magento-rest-api-mcp-server\">Magento REST API MCP Server<\/h3>\n<p><strong>GitHub Repository:<\/strong> <a href=\"https:\/\/github.com\/florinel-chis\/magento-api-mcp\">github.com\/florinel-chis\/magento-api-mcp<\/a><\/p>\n<p>This server provides complete access to Magento 2&#8217;s REST API through OpenAPI 3.0 specifications. It parses the official swagger.json file (70,000+ lines) and creates an intelligent, searchable index of every REST endpoint, parameter, schema, and response code.<\/p>\n<p><strong>Key Capabilities:<\/strong><\/p>\n<ul>\n<li><strong>594 REST Endpoints<\/strong> &#8211; Complete coverage of Magento REST API<\/li>\n<li><strong>497 Data Schemas<\/strong> &#8211; Full OpenAPI schema definitions<\/li>\n<li><strong>825+ Parameters<\/strong> &#8211; Every path, query, and header parameter documented<\/li>\n<li><strong>5 Specialized Tools<\/strong> &#8211; Search, browse, and explore the REST API<\/li>\n<li><strong>OpenAPI Native<\/strong> &#8211; Leverages structured OpenAPI format for accuracy<\/li>\n<\/ul>\n<p><strong>Best For:<\/strong> REST API integrations, CRUD operations, traditional API clients, and scenarios requiring precise schema definitions.<\/p>\n<h3 id=\"magento-graphql-documentation-mcp-server\">Magento GraphQL Documentation MCP Server<\/h3>\n<p><strong>GitHub Repository:<\/strong> <a href=\"https:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\">github.com\/florinel-chis\/magento-graphql-docs-mcp<\/a><\/p>\n<p>This server provides access to Magento 2&#8217;s narrative GraphQL documentation from Adobe&#8217;s official docs. Unlike raw API specs, this includes tutorials, guides, explanations, and 963 working code examples.<\/p>\n<p><strong>Key Capabilities:<\/strong><\/p>\n<ul>\n<li><strong>350 Documentation Pages<\/strong> &#8211; Comprehensive GraphQL coverage<\/li>\n<li><strong>963 Code Examples<\/strong> &#8211; GraphQL (537), JSON (363), PHP (18), JavaScript, Bash<\/li>\n<li><strong>51 GraphQL Elements<\/strong> &#8211; Queries, mutations, types, and interfaces<\/li>\n<li><strong>13 Complete Tutorials<\/strong> &#8211; Including 12-step checkout workflow<\/li>\n<li><strong>8 Specialized Tools<\/strong> &#8211; Search, explore, learn, and implement<\/li>\n<li><strong>Context-Rich<\/strong> &#8211; Includes explanations, best practices, and use cases<\/li>\n<\/ul>\n<p><strong>Best For:<\/strong> GraphQL development, learning complex workflows, finding working examples, and understanding &#8220;why&#8221; not just &#8220;what.&#8221;<\/p>\n<h3 id=\"side-by-side-comparison\">Side-by-Side Comparison<\/h3>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>REST API MCP<\/th>\n<th>GraphQL Docs MCP<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Data Source<\/strong><\/td>\n<td>OpenAPI 3.0 (swagger.json)<\/td>\n<td>Markdown files (350+)<\/td>\n<\/tr>\n<tr>\n<td><strong>Content Type<\/strong><\/td>\n<td>Structured API specs<\/td>\n<td>Narrative docs + tutorials<\/td>\n<\/tr>\n<tr>\n<td><strong>Endpoints\/Docs<\/strong><\/td>\n<td>594 REST endpoints<\/td>\n<td>350 documents<\/td>\n<\/tr>\n<tr>\n<td><strong>Code Examples<\/strong><\/td>\n<td>OpenAPI examples<\/td>\n<td>963 code blocks<\/td>\n<\/tr>\n<tr>\n<td><strong>Schema Info<\/strong><\/td>\n<td>497 data models<\/td>\n<td>51 GraphQL elements<\/td>\n<\/tr>\n<tr>\n<td><strong>Startup Time<\/strong><\/td>\n<td>3-5 seconds<\/td>\n<td>0.87-5 seconds<\/td>\n<\/tr>\n<tr>\n<td><strong>Search Speed<\/strong><\/td>\n<td>&lt;100ms<\/td>\n<td>5.5ms average (18x faster)<\/td>\n<\/tr>\n<tr>\n<td><strong>MCP Tools<\/strong><\/td>\n<td>5 tools<\/td>\n<td>8 tools<\/td>\n<\/tr>\n<tr>\n<td><strong>Offline<\/strong><\/td>\n<td>\u2705 Yes<\/td>\n<td>\u2705 Yes<\/td>\n<\/tr>\n<tr>\n<td><strong>Database<\/strong><\/td>\n<td>SQLite + FTS5<\/td>\n<td>SQLite + FTS5<\/td>\n<\/tr>\n<tr>\n<td><strong>Best For<\/strong><\/td>\n<td>REST integration<\/td>\n<td>GraphQL + learning<\/td>\n<\/tr>\n<tr>\n<td><strong>Tutorial Support<\/strong><\/td>\n<td>\u274c No<\/td>\n<td>\u2705 13 tutorials<\/td>\n<\/tr>\n<tr>\n<td><strong>Working Examples<\/strong><\/td>\n<td>Limited<\/td>\n<td>963 examples<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>The Power of Both Together:<\/strong><\/p>\n<p>Many Magento 2 projects use both REST and GraphQL APIs. With both MCP servers running simultaneously, AI agents can:<\/p>\n<ul>\n<li>Compare REST vs GraphQL approaches for the same functionality<\/li>\n<li>Use REST for simple CRUD, GraphQL for complex queries<\/li>\n<li>Learn from GraphQL tutorials, implement with either API<\/li>\n<li>Access the complete Magento API ecosystem<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"magento-rest-api-mcp-server-complete-api-reference-at-your-fingertips\">Magento REST API MCP Server: Complete API Reference at Your Fingertips<\/h2>\n<h3 id=\"architecture-capabilities\">Architecture &amp; Capabilities<\/h3>\n<p>The REST API MCP Server is built on a three-layer architecture optimized for speed and accuracy:<\/p>\n<p><strong>1. Parser Layer<\/strong><br \/>\nUses Pydantic models to parse the 70,000-line OpenAPI 3.0 swagger.json file, extracting endpoints, parameters, request bodies, response schemas, and metadata. Every element is validated and type-checked during parsing.<\/p>\n<p><strong>2. Ingestion Layer<\/strong><br \/>\nCreates a SQLite database with FTS5 (Full-Text Search 5) indexes on endpoint paths, descriptions, tags, and parameters. File modification time tracking ensures the database only rebuilds when swagger.json changes\u2014subsequent startups take just 2-3 seconds.<\/p>\n<p><strong>3. Server Layer<\/strong><br \/>\nFastMCP framework exposes 5 specialized tools over STDIO, formatting responses as structured markdown with tables, code blocks, and expandable schemas.<\/p>\n<h3 id=\"the-5-mcp-tools-in-action\">The 5 MCP Tools in Action<\/h3>\n<h4 id=\"1-search_endpoints-find-rest-endpoints-instantly\">1. <code>search_endpoints<\/code> &#8211; Find REST Endpoints Instantly<\/h4>\n<p>Search all 594 endpoints using keywords, with optional filters by HTTP method or category tag.<\/p>\n<p><strong>Example Query:<\/strong><\/p>\n<pre><code class=\"lang-python\">search_endpoints(\n    queries=<span class=\"hljs-string\">[\"cart operations\"]<\/span>,\n    filter_by_method=<span class=\"hljs-string\">\"<span class=\"hljs-keyword\">GET<\/span>\"<\/span>,\n    filter_by_tag=<span class=\"hljs-string\">\"carts\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code><span class=\"hljs-comment\">### GET \/V1\/carts\/mine<\/span>\n**Category:** carts\/mine\n**Summary:** Return information <span class=\"hljs-keyword\">for<\/span> <span class=\"hljs-keyword\">the<\/span> cart <span class=\"hljs-keyword\">for<\/span> <span class=\"hljs-keyword\">a<\/span> specified customer\n\n<span class=\"hljs-comment\">### GET \/V1\/carts\/{cartId}<\/span>\n**Category:** carts\n**Summary:** Return information <span class=\"hljs-keyword\">for<\/span> <span class=\"hljs-keyword\">a<\/span> specified cart\n<\/code><\/pre>\n<p><strong>Use Case:<\/strong> An AI agent building a cart display component can instantly find all GET endpoints related to carts, understand their purposes, and choose the right one.<\/p>\n<h4 id=\"2-get_endpoint_details-complete-endpoint-documentation\">2. <code>get_endpoint_details<\/code> &#8211; Complete Endpoint Documentation<\/h4>\n<p>Retrieve full documentation for any endpoint, including parameters, request body schemas, and response definitions.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\">get_endpoint_details(\n    path=<span class=\"hljs-string\">\"\/V1\/products\"<\/span>,\n    method=<span class=\"hljs-string\">\"<span class=\"hljs-keyword\">POST<\/span>\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<ul>\n<li>Complete parameter list with types and descriptions<\/li>\n<li>Request body schema with all required\/optional fields<\/li>\n<li>Response schema for each status code (200, 400, 401, etc.)<\/li>\n<li>Examples and references<\/li>\n<\/ul>\n<p><strong>Use Case:<\/strong> When generating product import code, the AI agent gets the exact schema structure needed, including field types, validation rules, and response handling.<\/p>\n<h4 id=\"3-list_tags-browse-api-by-category\">3. <code>list_tags<\/code> &#8211; Browse API by Category<\/h4>\n<p>Get a hierarchical view of all endpoint categories with document counts.<\/p>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code>## carts (24 endpoints)\n  -<span class=\"ruby\"> carts\/<span class=\"hljs-symbol\">mine:<\/span> <span class=\"hljs-number\">12<\/span> endpoints\n<\/span>  -<span class=\"ruby\"> carts\/<span class=\"hljs-symbol\">guest:<\/span> <span class=\"hljs-number\">8<\/span> endpoints\n<\/span>\n## customers (36 endpoints)\n  -<span class=\"ruby\"> customers\/<span class=\"hljs-symbol\">me:<\/span> <span class=\"hljs-number\">14<\/span> endpoints\n<\/span>  -<span class=\"ruby\"> customers\/<span class=\"hljs-symbol\">addresses:<\/span> <span class=\"hljs-number\">10<\/span> endpoints<\/span>\n<\/code><\/pre>\n<p><strong>Use Case:<\/strong> Explore the API structure to understand what&#8217;s available before diving into specific endpoints.<\/p>\n<h4 id=\"4-search_schemas-find-data-models\">4. <code>search_schemas<\/code> &#8211; Find Data Models<\/h4>\n<p>Search through 497 schema definitions to find the right data model.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-function\"><span class=\"hljs-title\">search_schemas<\/span><span class=\"hljs-params\">(query=<span class=\"hljs-string\">\"customer address\"<\/span>)<\/span><\/span>\n<\/code><\/pre>\n<p><strong>Returns matching schemas:<\/strong><\/p>\n<ul>\n<li><code>customer-data-address-interface<\/code><\/li>\n<li><code>customer-data-region-interface<\/code><\/li>\n<li><code>directory-data-region-information-interface<\/code><\/li>\n<\/ul>\n<h4 id=\"5-get_schema-view-complete-schema-definitions\">5. <code>get_schema<\/code> &#8211; View Complete Schema Definitions<\/h4>\n<p>Retrieve full schema details with all properties, types, and descriptions.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-function\"><span class=\"hljs-title\">get_schema<\/span><span class=\"hljs-params\">(name=<span class=\"hljs-string\">\"catalog-data-product-interface\"<\/span>)<\/span><\/span>\n<\/code><\/pre>\n<p><strong>Returns:<\/strong> JSON object with every product property, its type, whether it&#8217;s required, and its description\u2014everything needed to construct valid API requests.<\/p>\n<h3 id=\"real-world-use-case-building-a-product-import-tool\">Real-World Use Case: Building a Product Import Tool<\/h3>\n<p>Let&#8217;s see how an AI agent uses the REST API MCP Server to build a production-ready product import tool:<\/p>\n<p><strong>Step 1: Discovery<\/strong><\/p>\n<pre><code><span class=\"hljs-string\">Agent:<\/span> search_endpoints(queries=[<span class=\"hljs-string\">\"product import\"<\/span>, <span class=\"hljs-string\">\"create product\"<\/span>])\n\u2192 Finds POST <span class=\"hljs-regexp\">\/V1\/<\/span>products endpoint\n<\/code><\/pre>\n<p><strong>Step 2: Understanding<\/strong><\/p>\n<pre><code>Agent: get_endpoint_details(path=<span class=\"hljs-string\">\"\/V1\/products\"<\/span>, method=<span class=\"hljs-string\">\"<span class=\"hljs-keyword\">POST<\/span>\"<\/span>)\n\u2192 Gets request schema: catalog-data-product-interface\n\u2192 Understands required fields: sku, name, price, attribute_set_id, status\n<\/code><\/pre>\n<p><strong>Step 3: Schema Exploration<\/strong><\/p>\n<pre><code>Agent: get_schema(<span class=\"hljs-keyword\">name<\/span>=<span class=\"hljs-string\">\"catalog-data-product-interface\"<\/span>)\n\u2192 Sees <span class=\"hljs-built_in\">all<\/span> <span class=\"hljs-number\">50<\/span>+ <span class=\"hljs-built_in\">product<\/span> properties\n\u2192 Understands nested structures (custom_attributes, extension_attributes)\n\u2192 Identifies <span class=\"hljs-keyword\">optional<\/span> vs required fields\n<\/code><\/pre>\n<p><strong>Step 4: Code Generation<\/strong><br \/>\nThe AI agent generates:<\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">import<\/span> requests\n<span class=\"hljs-keyword\">import<\/span> json\n\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">import_product<\/span><span class=\"hljs-params\">(product_data, api_token, base_url)<\/span>:<\/span>\n    <span class=\"hljs-string\">\"\"\"\n    Import a product to Magento 2 via REST API\n\n    Schema: catalog-data-product-interface\n    Endpoint: POST \/V1\/products\n    \"\"\"<\/span>\n    endpoint = f<span class=\"hljs-string\">\"{base_url}\/rest\/V1\/products\"<\/span>\n\n    headers = {\n        <span class=\"hljs-string\">\"Authorization\"<\/span>: f<span class=\"hljs-string\">\"Bearer {api_token}\"<\/span>,\n        <span class=\"hljs-string\">\"Content-Type\"<\/span>: <span class=\"hljs-string\">\"application\/json\"<\/span>\n    }\n\n    payload = {\n        <span class=\"hljs-string\">\"product\"<\/span>: {\n            <span class=\"hljs-string\">\"sku\"<\/span>: product_data[<span class=\"hljs-string\">\"sku\"<\/span>],\n            <span class=\"hljs-string\">\"name\"<\/span>: product_data[<span class=\"hljs-string\">\"name\"<\/span>],\n            <span class=\"hljs-string\">\"price\"<\/span>: product_data[<span class=\"hljs-string\">\"price\"<\/span>],\n            <span class=\"hljs-string\">\"attribute_set_id\"<\/span>: product_data.get(<span class=\"hljs-string\">\"attribute_set_id\"<\/span>, <span class=\"hljs-number\">4<\/span>),\n            <span class=\"hljs-string\">\"status\"<\/span>: product_data.get(<span class=\"hljs-string\">\"status\"<\/span>, <span class=\"hljs-number\">1<\/span>),\n            <span class=\"hljs-string\">\"visibility\"<\/span>: product_data.get(<span class=\"hljs-string\">\"visibility\"<\/span>, <span class=\"hljs-number\">4<\/span>),\n            <span class=\"hljs-string\">\"type_id\"<\/span>: product_data.get(<span class=\"hljs-string\">\"type_id\"<\/span>, <span class=\"hljs-string\">\"simple\"<\/span>),\n            <span class=\"hljs-string\">\"weight\"<\/span>: product_data.get(<span class=\"hljs-string\">\"weight\"<\/span>, <span class=\"hljs-number\">1.0<\/span>),\n            <span class=\"hljs-comment\"># ... all other required\/optional fields<\/span>\n        }\n    }\n\n    response = requests.post(endpoint, json=payload, headers=headers)\n\n    <span class=\"hljs-keyword\">if<\/span> response.status_code == <span class=\"hljs-number\">200<\/span>:\n        <span class=\"hljs-keyword\">return<\/span> {<span class=\"hljs-string\">\"success\"<\/span>: <span class=\"hljs-keyword\">True<\/span>, <span class=\"hljs-string\">\"product\"<\/span>: response.json()}\n    <span class=\"hljs-keyword\">else<\/span>:\n        <span class=\"hljs-keyword\">return<\/span> {\n            <span class=\"hljs-string\">\"success\"<\/span>: <span class=\"hljs-keyword\">False<\/span>,\n            <span class=\"hljs-string\">\"error\"<\/span>: response.json(),\n            <span class=\"hljs-string\">\"status_code\"<\/span>: response.status_code\n        }\n<\/code><\/pre>\n<p><strong>Total Time:<\/strong> Under 30 seconds from &#8220;build me a product import tool&#8221; to production-ready code with error handling.<\/p>\n<h3 id=\"installation-setup\">Installation &amp; Setup<\/h3>\n<pre><code class=\"lang-bash\"><span class=\"hljs-comment\"># Clone the repository<\/span>\ngit <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/florinel-chis\/magento-api-mcp\n<span class=\"hljs-built_in\">cd<\/span> magento-api-mcp\n\n<span class=\"hljs-comment\"># Install dependencies<\/span>\npip install <span class=\"hljs-_\">-e<\/span> .\n\n<span class=\"hljs-comment\"># Run the server<\/span>\nmagento-api-mcp\n\n<span class=\"hljs-comment\"># Verify it's working<\/span>\npython3 tests\/verify_server.py\n<\/code><\/pre>\n<p><strong>Configure with Claude Desktop:<\/strong><\/p>\n<p>Edit <code>~\/Library\/Application Support\/Claude\/claude_desktop_config.json<\/code> (macOS):<\/p>\n<pre><code class=\"lang-json\">{\n  <span class=\"hljs-attr\">\"mcpServers\"<\/span>: {\n    <span class=\"hljs-attr\">\"magento-api\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-api-mcp\"<\/span>\n    }\n  }\n}\n<\/code><\/pre>\n<p>Restart Claude Desktop, and the REST API tools are immediately available.<\/p>\n<hr \/>\n<h2 id=\"magento-graphql-documentation-mcp-server-learning-and-implementation-combined\">Magento GraphQL Documentation MCP Server: Learning and Implementation Combined<\/h2>\n<h3 id=\"architecture-capabilities\">Architecture &amp; Capabilities<\/h3>\n<p>While the REST API server focuses on structured specifications, the GraphQL Documentation MCP Server brings narrative documentation, tutorials, and working examples to AI agents.<\/p>\n<p><strong>Three-Layer Architecture:<\/strong><\/p>\n<p><strong>1. Parser Layer<\/strong><br \/>\nParses 350 markdown files with YAML frontmatter, extracting metadata (title, description, keywords), document structure (headers, code blocks), and GraphQL schema elements (queries, mutations, types, interfaces). Uses regex-based GraphQL element detection to identify 51 schema elements across the documentation.<\/p>\n<p><strong>2. Ingestion Layer<\/strong><br \/>\nCreates a sophisticated SQLite database with:<\/p>\n<ul>\n<li><strong>documents table:<\/strong> 350 pages with FTS5 index on combined searchable text<\/li>\n<li><strong>code_blocks table:<\/strong> 963 examples with language tags and context<\/li>\n<li><strong>graphql_elements table:<\/strong> 51 elements with FTS5 index<\/li>\n<li><strong>metadata table:<\/strong> Tracks file modification times for intelligent re-ingestion<\/li>\n<\/ul>\n<p>File modification time checking means subsequent startups take just 0.87 seconds\u2014dramatically faster than the REST API server.<\/p>\n<p><strong>3. Server Layer<\/strong><br \/>\nEight specialized MCP tools provide comprehensive access to documentation, tutorials, examples, and schema exploration.<\/p>\n<h3 id=\"the-8-mcp-tools-complete-graphql-coverage\">The 8 MCP Tools: Complete GraphQL Coverage<\/h3>\n<h4 id=\"1-search_documentation-find-documentation-pages\">1. <code>search_documentation<\/code> &#8211; Find Documentation Pages<\/h4>\n<p>Full-text search with sophisticated filtering by category, subcategory, and content type.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\">search_documentation(\n    <span class=\"hljs-name\">queries=<\/span>[<span class=\"hljs-string\">\"checkout flow\"<\/span>],\n    category=<span class=\"hljs-string\">\"tutorials\"<\/span>,\n    content_type=<span class=\"hljs-string\">\"tutorial\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code><span class=\"hljs-section\">### GraphQL checkout tutorial<\/span>\n<span class=\"hljs-strong\">**Path:**<\/span> tutorials\/checkout\/index.md\n<span class=\"hljs-strong\">**Category:**<\/span> tutorials\/checkout\n<span class=\"hljs-strong\">**Type:**<\/span> tutorial\n<span class=\"hljs-strong\">**Description:**<\/span> Learn how to implement a complete checkout flow with GraphQL\n<\/code><\/pre>\n<p><strong>Advanced Features:<\/strong><\/p>\n<ul>\n<li>Multi-keyword queries with OR logic<\/li>\n<li>Category filtering (schema, tutorials, develop, usage)<\/li>\n<li>Content type filtering (guide, reference, tutorial, schema)<\/li>\n<li>Returns top 5 results with relevance scoring<\/li>\n<\/ul>\n<h4 id=\"2-get_document-retrieve-complete-documentation\">2. <code>get_document<\/code> &#8211; Retrieve Complete Documentation<\/h4>\n<p>Get the full markdown content of any documentation page, including frontmatter metadata.<\/p>\n<p><strong>Returns:<\/strong><\/p>\n<ul>\n<li>Complete YAML frontmatter (title, description, keywords)<\/li>\n<li>Category and subcategory<\/li>\n<li>Full markdown content with preserved formatting<\/li>\n<li>Related document suggestions<\/li>\n<\/ul>\n<h4 id=\"3-search_graphql_elements-find-queries-mutations-types\">3. <code>search_graphql_elements<\/code> &#8211; Find Queries, Mutations, Types<\/h4>\n<p>Search the 51 extracted GraphQL schema elements with optional type filtering.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\">search_graphql_elements(\n    <span class=\"hljs-name\">query=<\/span><span class=\"hljs-string\">\"customer\"<\/span>,\n    element_type=<span class=\"hljs-string\">\"mutation\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code>### `mutation` **createCustomer**\n**Source:** usage\/index.md\n**Fields:** customer, input, firstname, lastname, email\n**Parameters:** CustomerInput\n<\/code><\/pre>\n<h4 id=\"4-get_element_details-complete-element-information\">4. <code>get_element_details<\/code> &#8211; Complete Element Information<\/h4>\n<p>Retrieve full details about any GraphQL element, including fields, parameters, source documentation, and up to 3 code examples.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\">get_element_details(\n    <span class=\"hljs-name\">element_name=<\/span><span class=\"hljs-string\">\"ProductInterface\"<\/span>,\n    element_type=<span class=\"hljs-string\">\"interface\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<ul>\n<li>All fields (name, sku, price, description, etc.)<\/li>\n<li>Parameters if applicable<\/li>\n<li>Return type<\/li>\n<li>Source document reference<\/li>\n<li>Working GraphQL code examples<\/li>\n<\/ul>\n<h4 id=\"5-list_categories-browse-documentation-hierarchy\">5. <code>list_categories<\/code> &#8211; Browse Documentation Hierarchy<\/h4>\n<p>Get a complete tree view of all documentation categories with document counts.<\/p>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code>## schema (285 documents)\n  -<span class=\"ruby\"> <span class=\"hljs-symbol\">products:<\/span> <span class=\"hljs-number\">32<\/span> documents\n<\/span>  -<span class=\"ruby\"> <span class=\"hljs-symbol\">cart:<\/span> <span class=\"hljs-number\">18<\/span> documents\n<\/span>  -<span class=\"ruby\"> <span class=\"hljs-symbol\">customer:<\/span> <span class=\"hljs-number\">24<\/span> documents\n<\/span>\n## tutorials (13 documents)\n  -<span class=\"ruby\"> <span class=\"hljs-symbol\">checkout:<\/span> <span class=\"hljs-number\">12<\/span> documents\n<\/span>\n## develop (8 documents)\n<\/code><\/pre>\n<p><strong>Use Case:<\/strong> Understand the documentation structure before diving into specific areas.<\/p>\n<h4 id=\"6-get_tutorial-sequential-tutorial-steps\">6. <code>get_tutorial<\/code> &#8211; Sequential Tutorial Steps<\/h4>\n<p>Retrieve complete tutorials with all steps in order, including code examples.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-function\"><span class=\"hljs-title\">get_tutorial<\/span><span class=\"hljs-params\">(tutorial_name=<span class=\"hljs-string\">\"checkout\"<\/span>)<\/span><\/span>\n<\/code><\/pre>\n<p><strong>Returns:<\/strong> The complete 12-step checkout tutorial:<\/p>\n<ol>\n<li>Create empty cart<\/li>\n<li>Add products to cart<\/li>\n<li>Get cart details<\/li>\n<li>Set shipping address<\/li>\n<li>Set billing address<\/li>\n<li>Set shipping method<\/li>\n<li>Set payment method<\/li>\n<li>Apply coupon (optional)<\/li>\n<li>Place order<\/li>\n<li>Get order details<\/li>\n<li>Handle errors<\/li>\n<li>Complete workflow<\/li>\n<\/ol>\n<p>Each step includes GraphQL queries\/mutations and expected responses.<\/p>\n<h4 id=\"7-search_examples-find-working-code\">7. <code>search_examples<\/code> &#8211; Find Working Code<\/h4>\n<p>Search through 963 code blocks by content and language.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"lang-python\">search_examples(\n    <span class=\"hljs-name\">query=<\/span><span class=\"hljs-string\">\"add to cart\"<\/span>,\n    language=<span class=\"hljs-string\">\"graphql\"<\/span>\n)\n<\/code><\/pre>\n<p><strong>Returns:<\/strong><\/p>\n<pre><code class=\"lang-graphql\"><span class=\"hljs-class\">mutation <\/span>{\n  addProductsToCart(\n<span class=\"hljs-symbol\">    cartId:<\/span> <span class=\"hljs-string\">\"{ CART_ID }\"<\/span>\n<span class=\"hljs-symbol\">    cartItems:<\/span> [\n      {\n<span class=\"hljs-symbol\">        quantity:<\/span> <span class=\"hljs-number\">1<\/span>\n<span class=\"hljs-symbol\">        sku:<\/span> <span class=\"hljs-string\">\"24-MB01\"<\/span>\n      }\n    ]\n  ) {\n    <span class=\"hljs-class\">cart <\/span>{\n      <span class=\"hljs-class\">items <\/span>{\n        id\n        <span class=\"hljs-class\">product <\/span>{\n          name\n          sku\n        }\n        quantity\n      }\n    }\n  }\n}\n<\/code><\/pre>\n<p><strong>Context included:<\/strong> The surrounding explanation from the documentation, making examples immediately understandable.<\/p>\n<h4 id=\"8-get_related_documents-discover-related-content\">8. <code>get_related_documents<\/code> &#8211; Discover Related Content<\/h4>\n<p>Find documents related to a specified page based on category and keywords.<\/p>\n<p><strong>Use Case:<\/strong> After reading about product queries, AI agent discovers related documentation on product filters, pagination, and sorting\u2014enabling comprehensive implementation.<\/p>\n<h3 id=\"real-world-use-case-implementing-graphql-checkout-flow\">Real-World Use Case: Implementing GraphQL Checkout Flow<\/h3>\n<p>Let&#8217;s watch an AI agent use the GraphQL Documentation MCP Server to implement a complete checkout flow:<\/p>\n<p><strong>Step 1: Tutorial Discovery<\/strong><\/p>\n<pre><code><span class=\"hljs-built_in\">Agent<\/span>: get_tutorial(tutorial_name=<span class=\"hljs-string\">\"checkout\"<\/span>)\n\u2192 Receives <span class=\"hljs-number\">12<\/span>-<span class=\"hljs-built_in\">step<\/span> workflow\n\u2192 Understands createEmptyCart \u2192 addProductsToCart \u2192 ... \u2192 placeOrder\n<\/code><\/pre>\n<p><strong>Step 2: Mutation Exploration<\/strong><\/p>\n<pre><code>Agent: search_graphql_elements(<span class=\"hljs-keyword\">query<\/span>=<span class=\"hljs-string\">\"cart\"<\/span>, element_type=<span class=\"hljs-string\">\"mutation\"<\/span>)\n\u2192 Finds all cart-related mutations\n\u2192 Identifies createEmptyCart, addProductsToCart, setShippingAddressesOnCart, etc.\n<\/code><\/pre>\n<p><strong>Step 3: Working Examples<\/strong><\/p>\n<pre><code>Agent: search_examples(<span class=\"hljs-keyword\">query<\/span>=<span class=\"hljs-string\">\"addProductsToCart\"<\/span>, language=<span class=\"hljs-string\">\"graphql\"<\/span>)\n\u2192 Gets actual working GraphQL <span class=\"hljs-keyword\">query<\/span>\n\u2192 Sees expected response structure\n\u2192 Understands <span class=\"hljs-keyword\">error<\/span> handling\n<\/code><\/pre>\n<p><strong>Step 4: Related Documentation<\/strong><\/p>\n<pre><code>Agent: get_related_documents(file_path=<span class=\"hljs-string\">\"tutorials\/checkout\/add-product-to-cart.md\"<\/span>)\n\u2192 Discovers cart validation documentation\n\u2192 Finds <span class=\"hljs-built_in\">error<\/span> handling guides\n\u2192 Locates payment <span class=\"hljs-function\"><span class=\"hljs-keyword\">method<\/span> <span class=\"hljs-title\">configuration<\/span> <span class=\"hljs-title\">docs<\/span><\/span>\n<\/code><\/pre>\n<p><strong>Step 5: Code Generation<\/strong><\/p>\n<p>The AI agent generates a complete TypeScript\/JavaScript implementation:<\/p>\n<pre><code class=\"lang-typescript\">import { ApolloClient, gql } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@apollo\/client'<\/span>;\n\n<span class=\"hljs-keyword\">interface<\/span> <span class=\"hljs-title\">CheckoutFlowParams<\/span> {\n  products: Array&lt;{ sku: <span class=\"hljs-keyword\">string<\/span>; quantity: number }&gt;;\n  shippingAddress: Address;\n  billingAddress: Address;\n  shippingMethod: <span class=\"hljs-keyword\">string<\/span>;\n  paymentMethod: PaymentMethod;\n}\n\n<span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MagentoCheckout<\/span> {\n  <span class=\"hljs-keyword\">private<\/span> client: ApolloClient;\n  <span class=\"hljs-keyword\">private<\/span> cartId: <span class=\"hljs-keyword\">string<\/span> | <span class=\"hljs-literal\">null<\/span> = <span class=\"hljs-literal\">null<\/span>;\n\n  constructor(apiUrl: <span class=\"hljs-keyword\">string<\/span>) {\n    <span class=\"hljs-keyword\">this<\/span>.client = <span class=\"hljs-keyword\">new<\/span> ApolloClient({ uri: apiUrl });\n  }\n\n  <span class=\"hljs-function\"><span class=\"hljs-keyword\">async<\/span> <span class=\"hljs-title\">executeCheckout<\/span>(<span class=\"hljs-params\"><span class=\"hljs-keyword\">params<\/span>: CheckoutFlowParams<\/span>): Promise&lt;OrderResult&gt; <\/span>{\n    <span class=\"hljs-keyword\">try<\/span> {\n      <span class=\"hljs-comment\">\/\/ Step 1: Create empty cart<\/span>\n      <span class=\"hljs-keyword\">this<\/span>.cartId = <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.createCart();\n\n      <span class=\"hljs-comment\">\/\/ Step 2: Add products<\/span>\n      <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.addProducts(<span class=\"hljs-keyword\">params<\/span>.products);\n\n      <span class=\"hljs-comment\">\/\/ Step 3: Set shipping address<\/span>\n      <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.setShippingAddress(<span class=\"hljs-keyword\">params<\/span>.shippingAddress);\n\n      <span class=\"hljs-comment\">\/\/ Step 4: Set billing address<\/span>\n      <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.setBillingAddress(<span class=\"hljs-keyword\">params<\/span>.billingAddress);\n\n      <span class=\"hljs-comment\">\/\/ Step 5: Set shipping method<\/span>\n      <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.setShippingMethod(<span class=\"hljs-keyword\">params<\/span>.shippingMethod);\n\n      <span class=\"hljs-comment\">\/\/ Step 6: Set payment method<\/span>\n      <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.setPaymentMethod(<span class=\"hljs-keyword\">params<\/span>.paymentMethod);\n\n      <span class=\"hljs-comment\">\/\/ Step 7: Place order<\/span>\n      <span class=\"hljs-keyword\">const<\/span> orderId = <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.placeOrder();\n\n      <span class=\"hljs-keyword\">return<\/span> { success: <span class=\"hljs-literal\">true<\/span>, orderId };\n    } <span class=\"hljs-keyword\">catch<\/span> (error) {\n      <span class=\"hljs-keyword\">return<\/span> { success: <span class=\"hljs-literal\">false<\/span>, error: error.message };\n    }\n  }\n\n  <span class=\"hljs-function\"><span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">async<\/span> <span class=\"hljs-title\">createCart<\/span>(): Promise&lt;<span class=\"hljs-keyword\">string<\/span>&gt; <\/span>{\n    <span class=\"hljs-keyword\">const<\/span> CREATE_CART = gql`\n      mutation {\n        createEmptyCart\n      }\n    `;\n\n    <span class=\"hljs-keyword\">const<\/span> { data } = <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.client.mutate({ mutation: CREATE_CART });\n    <span class=\"hljs-keyword\">return<\/span> data.createEmptyCart;\n  }\n\n  <span class=\"hljs-function\"><span class=\"hljs-keyword\">private<\/span> <span class=\"hljs-keyword\">async<\/span> <span class=\"hljs-title\">addProducts<\/span>(<span class=\"hljs-params\">products: Array&lt;{ sku: <span class=\"hljs-keyword\">string<\/span>; quantity: number }&gt;<\/span>): Promise&lt;<span class=\"hljs-keyword\">void<\/span>&gt; <\/span>{\n    <span class=\"hljs-keyword\">const<\/span> ADD_PRODUCTS = gql`\n      mutation($cartId: String!, $cartItems: [CartItemInput!]!) {\n        addProductsToCart(cartId: $cartId, cartItems: $cartItems) {\n          cart {\n            id\n            items {\n              id\n              quantity\n              product {\n                sku\n                name\n              }\n            }\n          }\n        }\n      }\n    `;\n\n    <span class=\"hljs-keyword\">await<\/span> <span class=\"hljs-keyword\">this<\/span>.client.mutate({\n      mutation: ADD_PRODUCTS,\n      variables: {\n        cartId: <span class=\"hljs-keyword\">this<\/span>.cartId,\n        cartItems: products.map(p =&gt; ({\n          sku: p.sku,\n          quantity: p.quantity\n        }))\n      }\n    });\n  }\n\n  <span class=\"hljs-comment\">\/\/ ... additional methods for each checkout step<\/span>\n}\n<\/code><\/pre>\n<p><strong>Total Time:<\/strong> From &#8220;implement checkout flow&#8221; to production-ready TypeScript class: under 2 minutes.<\/p>\n<h3 id=\"unique-advantages-narrative-code-tutorials\">Unique Advantages: Narrative + Code + Tutorials<\/h3>\n<p>The GraphQL Documentation MCP Server&#8217;s real power comes from combining three types of content:<\/p>\n<p><strong>1. Narrative Documentation (&#8220;Why&#8221; and &#8220;How&#8221;)<\/strong><\/p>\n<ul>\n<li>Explains concepts, not just syntax<\/li>\n<li>Provides context and use cases<\/li>\n<li>Includes best practices and recommendations<\/li>\n<\/ul>\n<p><strong>2. Working Code Examples (963 Examples)<\/strong><\/p>\n<ul>\n<li>GraphQL queries and mutations (537)<\/li>\n<li>JSON request\/response examples (363)<\/li>\n<li>PHP implementation examples (18)<\/li>\n<li>JavaScript\/Bash examples<\/li>\n<li>Context surrounding each example<\/li>\n<\/ul>\n<p><strong>3. Step-by-Step Tutorials (13 Complete Tutorials)<\/strong><\/p>\n<ul>\n<li>Checkout workflow (12 steps)<\/li>\n<li>Order creation workflows<\/li>\n<li>Customer authentication flows<\/li>\n<li>Product catalog implementation<\/li>\n<li>Payment integration guides<\/li>\n<\/ul>\n<p><strong>This combination means AI agents don&#8217;t just generate code\u2014they generate <em>correct, production-ready, best-practice<\/em> code based on official documentation.<\/strong><\/p>\n<h3 id=\"installation-setup\">Installation &amp; Setup<\/h3>\n<p>The GraphQL Documentation MCP Server requires access to Adobe&#8217;s official Magento documentation files:<\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-comment\"># Step 1: Clone Adobe Commerce documentation<\/span>\ngit <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/AdobeDocs\/commerce-webapi.git\n\n<span class=\"hljs-comment\"># Step 2: Clone the MCP server<\/span>\ngit <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\n<span class=\"hljs-built_in\">cd<\/span> magento-graphql-docs-mcp\n\n<span class=\"hljs-comment\"># Step 3: Install dependencies<\/span>\npip install <span class=\"hljs-_\">-e<\/span> .\n\n<span class=\"hljs-comment\"># Step 4: Configure documentation path<\/span>\n<span class=\"hljs-built_in\">export<\/span> MAGENTO_GRAPHQL_DOCS_PATH=<span class=\"hljs-string\">\"\/path\/to\/commerce-webapi\/src\/pages\/graphql\"<\/span>\n\n<span class=\"hljs-comment\"># Or create a symlink<\/span>\nln <span class=\"hljs-_\">-s<\/span> \/path\/to\/commerce-webapi\/src\/pages\/graphql data\n\n<span class=\"hljs-comment\"># Step 5: Run verification tests<\/span>\npython3 tests\/verify_parser.py\npython3 tests\/verify_db.py\npython3 tests\/verify_server.py\n\n<span class=\"hljs-comment\"># Step 6: Start the server<\/span>\nmagento-graphql-docs-mcp\n<\/code><\/pre>\n<p><strong>Configure with Claude Desktop:<\/strong><\/p>\n<pre><code class=\"lang-json\">{\n  <span class=\"hljs-attr\">\"mcpServers\"<\/span>: {\n    <span class=\"hljs-attr\">\"magento-graphql-docs\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-graphql-docs-mcp\"<\/span>,\n      <span class=\"hljs-attr\">\"env\"<\/span>: {\n        <span class=\"hljs-attr\">\"MAGENTO_GRAPHQL_DOCS_PATH\"<\/span>: <span class=\"hljs-string\">\"\/absolute\/path\/to\/commerce-webapi\/src\/pages\/graphql\"<\/span>\n      }\n    }\n  }\n}\n<\/code><\/pre>\n<p><strong>Try the Examples:<\/strong><\/p>\n<p>The repository includes three practical examples demonstrating all 8 tools:<\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-keyword\">cd<\/span> examples\n\n# Example <span class=\"hljs-number\">1<\/span>: Product queries <span class=\"hljs-built_in\">and<\/span> catalog\n<span class=\"hljs-keyword\">python3<\/span> example_products.<span class=\"hljs-keyword\">py<\/span>\n\n# Example <span class=\"hljs-number\">2<\/span>: Customer operations <span class=\"hljs-built_in\">and<\/span> authentication\n<span class=\"hljs-keyword\">python3<\/span> example_customer.<span class=\"hljs-keyword\">py<\/span>\n\n# Example <span class=\"hljs-number\">3<\/span>: Complete cart <span class=\"hljs-built_in\">and<\/span> checkout workflow\n<span class=\"hljs-keyword\">python3<\/span> example_cart_checkout.<span class=\"hljs-keyword\">py<\/span>\n\n# Or run <span class=\"hljs-keyword\">all<\/span> at once\nbash run_all_examples.<span class=\"hljs-keyword\">sh<\/span>\n<\/code><\/pre>\n<hr \/>\n<h2 id=\"agentic-development-ai-agents-building-magento-applications\">Agentic Development: AI Agents Building Magento Applications<\/h2>\n<h3 id=\"what-is-agentic-development-\">What is Agentic Development?<\/h3>\n<p>Agentic development represents a paradigm shift in software engineering. Instead of developers writing every line of code manually, AI agents autonomously complete development tasks through:<\/p>\n<p><strong>1. Context Awareness:<\/strong> Understanding requirements, constraints, and goals<br \/>\n<strong>2. Tool Use:<\/strong> Accessing external systems like MCP servers<br \/>\n<strong>3. Iterative Problem-Solving:<\/strong> Breaking complex tasks into steps<br \/>\n<strong>4. Decision Making:<\/strong> Choosing appropriate approaches and APIs<br \/>\n<strong>5. Code Generation:<\/strong> Producing production-ready implementations<\/p>\n<p>With MCP servers, AI agents gain &#8220;superpowers&#8221;\u2014instant access to comprehensive documentation, working examples, and schema definitions. They don&#8217;t hallucinate API endpoints or invent parameter names; they reference actual Magento documentation to generate correct code.<\/p>\n<h3 id=\"complete-agentic-workflow-building-a-custom-checkout-flow\">Complete Agentic Workflow: Building a Custom Checkout Flow<\/h3>\n<p>Let&#8217;s follow an AI agent as it builds a custom checkout flow from scratch, using both MCP servers:<\/p>\n<h4 id=\"phase-1-discovery-planning\">Phase 1: Discovery &amp; Planning<\/h4>\n<p><strong>User Request:<\/strong> &#8220;Build a custom checkout flow that supports guest checkout, validates inventory, applies promotional codes, and handles multiple payment methods.&#8221;<\/p>\n<p><strong>Agent Analysis:<\/strong><\/p>\n<pre><code><span class=\"hljs-built_in\">Agent<\/span> thinks:\n- Need <span class=\"hljs-keyword\">to<\/span> understand Magento checkout workflow\n- Should support both REST <span class=\"hljs-built_in\">and<\/span> GraphQL (REST <span class=\"hljs-keyword\">for<\/span> admin, GraphQL <span class=\"hljs-keyword\">for<\/span> frontend)\n- Requires cart creation, product validation, address handling, payment processing\n- Must handle errors gracefully\n\n<span class=\"hljs-built_in\">Agent<\/span> actions:\n<span class=\"hljs-number\">1<\/span>. get_tutorial(tutorial_name=<span class=\"hljs-string\">\"checkout\"<\/span>) <span class=\"hljs-keyword\">from<\/span> GraphQL MCP\n<span class=\"hljs-number\">2<\/span>. search_endpoints(queries=[<span class=\"hljs-string\">\"checkout\"<\/span>, <span class=\"hljs-string\">\"guest\"<\/span>]) <span class=\"hljs-keyword\">from<\/span> REST MCP\n<span class=\"hljs-number\">3<\/span>. list_categories() <span class=\"hljs-keyword\">from<\/span> both servers <span class=\"hljs-keyword\">to<\/span> understand structure\n<\/code><\/pre>\n<p><strong>Result:<\/strong> Agent understands the complete checkout workflow and identifies required components.<\/p>\n<h4 id=\"phase-2-api-exploration\">Phase 2: API Exploration<\/h4>\n<p><strong>GraphQL Approach:<\/strong><\/p>\n<pre><code>Agent calls:\n-<span class=\"ruby\"> search_graphql_elements(query=<span class=\"hljs-string\">\"cart\"<\/span>, element_type=<span class=\"hljs-string\">\"mutation\"<\/span>)\n<\/span>-<span class=\"ruby\"> get_element_details(element_name=<span class=\"hljs-string\">\"createEmptyCart\"<\/span>)\n<\/span>-<span class=\"ruby\"> get_element_details(element_name=<span class=\"hljs-string\">\"addProductsToCart\"<\/span>)\n<\/span>-<span class=\"ruby\"> search_examples(query=<span class=\"hljs-string\">\"placeOrder\"<\/span>, language=<span class=\"hljs-string\">\"graphql\"<\/span>)<\/span>\n<\/code><\/pre>\n<p><strong>REST Approach:<\/strong><\/p>\n<pre><code>Agent calls:\n- search_endpoints(queries=<span class=\"hljs-string\">[\"cart\"]<\/span>, filter_by_method=<span class=\"hljs-string\">\"<span class=\"hljs-keyword\">POST<\/span>\"<\/span>)\n- get_endpoint_details(path=<span class=\"hljs-string\">\"\/V1\/guest-carts\"<\/span>)\n- get_schema(name=<span class=\"hljs-string\">\"quote-data-cart-interface\"<\/span>)\n<\/code><\/pre>\n<p><strong>Result:<\/strong> Agent compares REST vs GraphQL approaches, decides GraphQL is better for this use case due to reduced over-fetching and cleaner mutations.<\/p>\n<h4 id=\"phase-3-schema-understanding\">Phase 3: Schema Understanding<\/h4>\n<p><strong>Data Structure Exploration:<\/strong><\/p>\n<pre><code>Agent calls:\n-<span class=\"ruby\"> get_element_details(element_name=<span class=\"hljs-string\">\"CartInterface\"<\/span>, element_type=<span class=\"hljs-string\">\"interface\"<\/span>)\n<\/span>-<span class=\"ruby\"> get_element_details(element_name=<span class=\"hljs-string\">\"ShippingAddressInput\"<\/span>, element_type=<span class=\"hljs-string\">\"type\"<\/span>)\n<\/span>-<span class=\"ruby\"> get_element_details(element_name=<span class=\"hljs-string\">\"PaymentMethodInput\"<\/span>, element_type=<span class=\"hljs-string\">\"type\"<\/span>)\n<\/span>-<span class=\"ruby\"> search_examples(query=<span class=\"hljs-string\">\"address validation\"<\/span>, language=<span class=\"hljs-string\">\"json\"<\/span>)<\/span>\n<\/code><\/pre>\n<p><strong>Result:<\/strong> Agent understands:<\/p>\n<ul>\n<li>Cart structure (items, addresses, totals, discounts)<\/li>\n<li>Required vs optional fields<\/li>\n<li>Nested object structures<\/li>\n<li>Error response formats<\/li>\n<\/ul>\n<h4 id=\"phase-4-implementation\">Phase 4: Implementation<\/h4>\n<p>The agent generates a complete React component with TypeScript:<\/p>\n<pre><code class=\"lang-typescript\"><span class=\"hljs-keyword\">import<\/span> React, { useState } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'react'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { useMutation, useQuery } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@apollo\/client'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> {\n  CREATE_EMPTY_CART,\n  ADD_PRODUCTS_TO_CART,\n  SET_SHIPPING_ADDRESS,\n  SET_PAYMENT_METHOD,\n  APPLY_COUPON,\n  PLACE_ORDER\n} <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'.\/graphql\/mutations'<\/span>;\n\ninterface CheckoutFlowProps {\n  <span class=\"hljs-attr\">products<\/span>: Product[];\n  onSuccess: <span class=\"hljs-function\">(<span class=\"hljs-params\">orderId: string<\/span>) =&gt;<\/span> <span class=\"hljs-keyword\">void<\/span>;\n  onError: <span class=\"hljs-function\">(<span class=\"hljs-params\">error: <span class=\"hljs-built_in\">Error<\/span><\/span>) =&gt;<\/span> <span class=\"hljs-keyword\">void<\/span>;\n}\n\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">const<\/span> CheckoutFlow: React.FC&lt;CheckoutFlowProps&gt; = ({\n  products,\n  onSuccess,\n  onError\n}) =&gt; {\n  <span class=\"hljs-keyword\">const<\/span> [cartId, setCartId] = useState&lt;string | <span class=\"hljs-literal\">null<\/span>&gt;(<span class=\"hljs-literal\">null<\/span>);\n  <span class=\"hljs-keyword\">const<\/span> [step, setStep] = useState&lt;number&gt;(<span class=\"hljs-number\">1<\/span>);\n  <span class=\"hljs-keyword\">const<\/span> [shippingAddress, setShippingAddress] = useState&lt;Address | <span class=\"hljs-literal\">null<\/span>&gt;(<span class=\"hljs-literal\">null<\/span>);\n  <span class=\"hljs-keyword\">const<\/span> [paymentMethod, setPaymentMethod] = useState&lt;string | <span class=\"hljs-literal\">null<\/span>&gt;(<span class=\"hljs-literal\">null<\/span>);\n\n  <span class=\"hljs-comment\">\/\/ GraphQL mutations from Magento GraphQL Docs MCP examples<\/span>\n  <span class=\"hljs-keyword\">const<\/span> [createCart] = useMutation(CREATE_EMPTY_CART);\n  <span class=\"hljs-keyword\">const<\/span> [addProducts] = useMutation(ADD_PRODUCTS_TO_CART);\n  <span class=\"hljs-keyword\">const<\/span> [setShipping] = useMutation(SET_SHIPPING_ADDRESS);\n  <span class=\"hljs-keyword\">const<\/span> [setPayment] = useMutation(SET_PAYMENT_METHOD);\n  <span class=\"hljs-keyword\">const<\/span> [applyCoupon] = useMutation(APPLY_COUPON);\n  <span class=\"hljs-keyword\">const<\/span> [placeOrder] = useMutation(PLACE_ORDER);\n\n  <span class=\"hljs-keyword\">const<\/span> handleCreateCart = <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n    <span class=\"hljs-keyword\">try<\/span> {\n      <span class=\"hljs-keyword\">const<\/span> { data } = <span class=\"hljs-keyword\">await<\/span> createCart();\n      setCartId(data.createEmptyCart);\n      <span class=\"hljs-keyword\">await<\/span> handleAddProducts(data.createEmptyCart);\n    } <span class=\"hljs-keyword\">catch<\/span> (err) {\n      onError(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-built_in\">Error<\/span>(<span class=\"hljs-string\">'Failed to create cart: '<\/span> + err.message));\n    }\n  };\n\n  <span class=\"hljs-keyword\">const<\/span> handleAddProducts = <span class=\"hljs-keyword\">async<\/span> (cartId: string) =&gt; {\n    <span class=\"hljs-keyword\">try<\/span> {\n      <span class=\"hljs-keyword\">await<\/span> addProducts({\n        <span class=\"hljs-attr\">variables<\/span>: {\n          cartId,\n          <span class=\"hljs-attr\">cartItems<\/span>: products.map(<span class=\"hljs-function\"><span class=\"hljs-params\">p<\/span> =&gt;<\/span> ({\n            <span class=\"hljs-attr\">sku<\/span>: p.sku,\n            <span class=\"hljs-attr\">quantity<\/span>: p.quantity\n          }))\n        }\n      });\n      setStep(<span class=\"hljs-number\">2<\/span>);\n    } <span class=\"hljs-keyword\">catch<\/span> (err) {\n      onError(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-built_in\">Error<\/span>(<span class=\"hljs-string\">'Failed to add products: '<\/span> + err.message));\n    }\n  };\n\n  <span class=\"hljs-keyword\">const<\/span> handleSetShippingAddress = <span class=\"hljs-keyword\">async<\/span> (address: Address) =&gt; {\n    <span class=\"hljs-keyword\">try<\/span> {\n      <span class=\"hljs-keyword\">await<\/span> setShipping({\n        <span class=\"hljs-attr\">variables<\/span>: {\n          cartId,\n          <span class=\"hljs-attr\">address<\/span>: {\n            <span class=\"hljs-attr\">firstname<\/span>: address.firstname,\n            <span class=\"hljs-attr\">lastname<\/span>: address.lastname,\n            <span class=\"hljs-attr\">street<\/span>: address.street,\n            <span class=\"hljs-attr\">city<\/span>: address.city,\n            <span class=\"hljs-attr\">region<\/span>: address.region,\n            <span class=\"hljs-attr\">postcode<\/span>: address.postcode,\n            <span class=\"hljs-attr\">country_code<\/span>: address.countryCode,\n            <span class=\"hljs-attr\">telephone<\/span>: address.telephone\n          }\n        }\n      });\n      setShippingAddress(address);\n      setStep(<span class=\"hljs-number\">3<\/span>);\n    } <span class=\"hljs-keyword\">catch<\/span> (err) {\n      onError(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-built_in\">Error<\/span>(<span class=\"hljs-string\">'Failed to set shipping address: '<\/span> + err.message));\n    }\n  };\n\n  <span class=\"hljs-keyword\">const<\/span> handlePlaceOrder = <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n    <span class=\"hljs-keyword\">try<\/span> {\n      <span class=\"hljs-keyword\">const<\/span> { data } = <span class=\"hljs-keyword\">await<\/span> placeOrder({\n        <span class=\"hljs-attr\">variables<\/span>: { cartId }\n      });\n      onSuccess(data.placeOrder.order.order_number);\n    } <span class=\"hljs-keyword\">catch<\/span> (err) {\n      onError(<span class=\"hljs-keyword\">new<\/span> <span class=\"hljs-built_in\">Error<\/span>(<span class=\"hljs-string\">'Failed to place order: '<\/span> + err.message));\n    }\n  };\n\n  <span class=\"hljs-comment\">\/\/ ... render checkout steps UI<\/span>\n};\n<\/code><\/pre>\n<p><strong>Result:<\/strong> Production-ready checkout component with proper error handling, type safety, and following Magento best practices.<\/p>\n<h4 id=\"phase-5-testing-validation\">Phase 5: Testing &amp; Validation<\/h4>\n<p><strong>Agent generates tests:<\/strong><\/p>\n<pre><code class=\"lang-typescript\">describe(<span class=\"hljs-string\">'CheckoutFlow'<\/span>, () =&gt; {\n  it(<span class=\"hljs-string\">'should complete guest checkout successfully'<\/span>, <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n    <span class=\"hljs-comment\">\/\/ Test cases generated from GraphQL examples<\/span>\n  });\n\n  it(<span class=\"hljs-string\">'should handle inventory validation errors'<\/span>, <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n    <span class=\"hljs-comment\">\/\/ Error scenarios from documentation<\/span>\n  });\n\n  it(<span class=\"hljs-string\">'should apply discount codes correctly'<\/span>, <span class=\"hljs-keyword\">async<\/span> () =&gt; {\n    <span class=\"hljs-comment\">\/\/ Coupon examples from tutorials<\/span>\n  });\n});\n<\/code><\/pre>\n<p><strong>Total Development Time:<\/strong> From requirements to tested, production-ready code: <strong>Under 5 minutes<\/strong>.<\/p>\n<h3 id=\"benefits-of-mcp-powered-agentic-development\">Benefits of MCP-Powered Agentic Development<\/h3>\n<p><strong>1. Speed: 10-100x Faster Development<\/strong><\/p>\n<ul>\n<li>No manual documentation browsing<\/li>\n<li>Instant API exploration<\/li>\n<li>Automated code generation<\/li>\n<li>Built-in best practices<\/li>\n<\/ul>\n<p><strong>2. Accuracy: Zero Hallucinations<\/strong><\/p>\n<ul>\n<li>AI references real documentation<\/li>\n<li>Correct schema structures<\/li>\n<li>Valid parameter names<\/li>\n<li>Proper error handling<\/li>\n<\/ul>\n<p><strong>3. Completeness: Comprehensive Implementations<\/strong><\/p>\n<ul>\n<li>AI explores related documentation<\/li>\n<li>Discovers edge cases<\/li>\n<li>Includes error handling<\/li>\n<li>Follows Magento conventions<\/li>\n<\/ul>\n<p><strong>4. Learning: Best Practices Built-In<\/strong><\/p>\n<ul>\n<li>Uses official examples<\/li>\n<li>Implements recommended patterns<\/li>\n<li>Includes performance optimizations<\/li>\n<li>Proper security considerations<\/li>\n<\/ul>\n<p><strong>5. Scalability: Works for Any Magento Project<\/strong><\/p>\n<ul>\n<li>Custom extensions<\/li>\n<li>Integrations<\/li>\n<li>Migrations<\/li>\n<li>Testing<\/li>\n<li>Documentation<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"technical-implementation-guide-getting-started-today\">Technical Implementation Guide: Getting Started Today<\/h2>\n<h3 id=\"prerequisites\">Prerequisites<\/h3>\n<p><strong>System Requirements:<\/strong><\/p>\n<ul>\n<li>Python 3.10 or higher<\/li>\n<li>Git<\/li>\n<li>1 GB available disk space<\/li>\n<li>macOS, Linux, or Windows with WSL<\/li>\n<\/ul>\n<p><strong>For GraphQL MCP:<\/strong><\/p>\n<ul>\n<li>Adobe Commerce documentation files (350+ markdown files)<\/li>\n<\/ul>\n<p><strong>For REST API MCP:<\/strong><\/p>\n<ul>\n<li>Magento swagger.json file (included in package)<\/li>\n<\/ul>\n<h3 id=\"step-by-step-setup\">Step-by-Step Setup<\/h3>\n<h4 id=\"setting-up-rest-api-mcp-server\">Setting Up REST API MCP Server<\/h4>\n<p><strong>1. Clone and Install<\/strong><\/p>\n<pre><code class=\"lang-bash\">git <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/florinel-chis\/magento-api-mcp\n<span class=\"hljs-built_in\">cd<\/span> magento-api-mcp\npip install <span class=\"hljs-_\">-e<\/span> .\n<\/code><\/pre>\n<p><strong>2. Verify Installation<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-keyword\">python3<\/span> tests\/verify_parser.<span class=\"hljs-keyword\">py<\/span>\n<span class=\"hljs-keyword\">python3<\/span> tests\/verify_db.<span class=\"hljs-keyword\">py<\/span>\n<span class=\"hljs-keyword\">python3<\/span> tests\/verify_server.<span class=\"hljs-keyword\">py<\/span>\n<\/code><\/pre>\n<p>You should see:<\/p>\n<pre><code>\u2713 Parsed <span class=\"hljs-number\">594<\/span> endpoints\n\u2713 Created database <span class=\"hljs-keyword\">with<\/span> FTS5 indexes\n\u2713 <span class=\"hljs-keyword\">All<\/span> <span class=\"hljs-number\">5<\/span> MCP tools working\n\u2713 Performance: &lt;<span class=\"hljs-number\">100<\/span>ms searches\n<\/code><\/pre>\n<p><strong>3. Configure MCP Client<\/strong><\/p>\n<p>For Claude Desktop, edit <code>~\/Library\/Application Support\/Claude\/claude_desktop_config.json<\/code>:<\/p>\n<pre><code class=\"lang-json\">{\n  <span class=\"hljs-attr\">\"mcpServers\"<\/span>: {\n    <span class=\"hljs-attr\">\"magento-api\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-api-mcp\"<\/span>\n    }\n  }\n}\n<\/code><\/pre>\n<p><strong>4. Restart Claude Desktop<\/strong><\/p>\n<p>The REST API tools are now available. Try: &#8220;Search for cart-related POST endpoints&#8221; and watch Claude use the <code>search_endpoints<\/code> tool.<\/p>\n<h4 id=\"setting-up-graphql-docs-mcp-server\">Setting Up GraphQL Docs MCP Server<\/h4>\n<p><strong>1. Clone Adobe Documentation<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-comment\"># This is the official Magento GraphQL documentation<\/span>\ngit <span class=\"hljs-keyword\">clone<\/span> <span class=\"hljs-title\">https<\/span>:\/\/github.com\/AdobeDocs\/commerce-webapi.git\n<\/code><\/pre>\n<p><strong>2. Clone and Install MCP Server<\/strong><\/p>\n<pre><code class=\"lang-bash\">git <span class=\"hljs-built_in\">clone<\/span> https:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\n<span class=\"hljs-built_in\">cd<\/span> magento-graphql-docs-mcp\npip install <span class=\"hljs-_\">-e<\/span> .\n<\/code><\/pre>\n<p><strong>3. Configure Documentation Path<\/strong><\/p>\n<p>Choose one method:<\/p>\n<p><strong>Method A: Environment Variable<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-built_in\">export<\/span> MAGENTO_GRAPHQL_DOCS_PATH=<span class=\"hljs-string\">\"\/absolute\/path\/to\/commerce-webapi\/src\/pages\/graphql\"<\/span>\n<span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">'export MAGENTO_GRAPHQL_DOCS_PATH=\"\/path\/to\/docs\"'<\/span> &gt;&gt; ~\/.zshrc\n<\/code><\/pre>\n<p><strong>Method B: Symlink (Recommended)<\/strong><\/p>\n<pre><code class=\"lang-bash\">ln -s <span class=\"hljs-meta-keyword\">\/absolute\/<\/span>path<span class=\"hljs-meta-keyword\">\/to\/<\/span>commerce-webapi<span class=\"hljs-meta-keyword\">\/src\/<\/span>pages\/graphql data\nls -la data\/  <span class=\"hljs-meta\"># Verify symlink works<\/span>\n<\/code><\/pre>\n<p><strong>Method C: Sibling Directory<\/strong><\/p>\n<pre><code>parent-directory\/\n\u251c\u2500\u2500 magento-graphql-docs-mcp\/\n\u2514\u2500\u2500 commerce-webapi\/\n    \u2514\u2500\u2500 src<span class=\"hljs-regexp\">\/pages\/graphql\/<\/span>\n<\/code><\/pre>\n<p>Server auto-detects sibling directory.<\/p>\n<p><strong>4. Run Verification Tests<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-keyword\">python3<\/span> tests\/verify_parser.<span class=\"hljs-keyword\">py<\/span>\n<span class=\"hljs-keyword\">python3<\/span> tests\/verify_db.<span class=\"hljs-keyword\">py<\/span>\n<span class=\"hljs-keyword\">python3<\/span> tests\/verify_server.<span class=\"hljs-keyword\">py<\/span>\n<span class=\"hljs-keyword\">python3<\/span> tests\/benchmark_performance.<span class=\"hljs-keyword\">py<\/span>\n<\/code><\/pre>\n<p>Expected output:<\/p>\n<pre><code>\u2713 Parsed<span class=\"hljs-number\"> 350 <\/span>documents\n\u2713 Extracted<span class=\"hljs-number\"> 963 <\/span>code blocks\n\u2713 Found<span class=\"hljs-number\"> 51 <\/span>GraphQL elements\n\u2713 All<span class=\"hljs-number\"> 8 <\/span>MCP tools working\n\u2713 Startup: 0.87s (cached)\n\u2713 Search: 5.5ms average\n<\/code><\/pre>\n<p><strong>5. Configure MCP Client<\/strong><\/p>\n<pre><code class=\"lang-json\">{\n  <span class=\"hljs-attr\">\"mcpServers\"<\/span>: {\n    <span class=\"hljs-attr\">\"magento-graphql-docs\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-graphql-docs-mcp\"<\/span>,\n      <span class=\"hljs-attr\">\"env\"<\/span>: {\n        <span class=\"hljs-attr\">\"MAGENTO_GRAPHQL_DOCS_PATH\"<\/span>: <span class=\"hljs-string\">\"\/absolute\/path\/to\/commerce-webapi\/src\/pages\/graphql\"<\/span>\n      }\n    }\n  }\n}\n<\/code><\/pre>\n<p><strong>Important:<\/strong> Use absolute paths in MCP configuration.<\/p>\n<p><strong>6. Try the Examples<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-keyword\">cd<\/span> examples\n\n# Run product examples\n<span class=\"hljs-keyword\">python3<\/span> example_products.<span class=\"hljs-keyword\">py<\/span>\n\n# Run customer examples\n<span class=\"hljs-keyword\">python3<\/span> example_customer.<span class=\"hljs-keyword\">py<\/span>\n\n# Run cart\/checkout examples\n<span class=\"hljs-keyword\">python3<\/span> example_cart_checkout.<span class=\"hljs-keyword\">py<\/span>\n\n# Or run <span class=\"hljs-keyword\">all<\/span>\nbash run_all_examples.<span class=\"hljs-keyword\">sh<\/span>\n<\/code><\/pre>\n<h4 id=\"running-both-servers-simultaneously\">Running Both Servers Simultaneously<\/h4>\n<p>Configure both in Claude Desktop:<\/p>\n<pre><code class=\"lang-json\">{\n  <span class=\"hljs-attr\">\"mcpServers\"<\/span>: {\n    <span class=\"hljs-attr\">\"magento-api\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-api-mcp\"<\/span>\n    },\n    <span class=\"hljs-attr\">\"magento-graphql-docs\"<\/span>: {\n      <span class=\"hljs-attr\">\"command\"<\/span>: <span class=\"hljs-string\">\"magento-graphql-docs-mcp\"<\/span>,\n      <span class=\"hljs-attr\">\"env\"<\/span>: {\n        <span class=\"hljs-attr\">\"MAGENTO_GRAPHQL_DOCS_PATH\"<\/span>: <span class=\"hljs-string\">\"\/path\/to\/commerce-webapi\/src\/pages\/graphql\"<\/span>\n      }\n    }\n  }\n}\n<\/code><\/pre>\n<p>Now Claude has access to all 13 tools (5 + 8) simultaneously!<\/p>\n<h3 id=\"troubleshooting-common-issues\">Troubleshooting Common Issues<\/h3>\n<p><strong>Issue:<\/strong> <code>FileNotFoundError: Documentation directory not found<\/code><\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre><code class=\"lang-bash\"># Verify path <span class=\"hljs-built_in\">exists<\/span>\n<span class=\"hljs-keyword\">echo<\/span> $MAGENTO_GRAPHQL_DOCS_PATH\n<span class=\"hljs-keyword\">ls<\/span> -<span class=\"hljs-keyword\">la<\/span> $MAGENTO_GRAPHQL_DOCS_PATH\n\n# Check <span class=\"hljs-keyword\">for<\/span> .md <span class=\"hljs-keyword\">files<\/span>\n<span class=\"hljs-keyword\">ls<\/span> $MAGENTO_GRAPHQL_DOCS_PATH\/*.md\n\n# If <span class=\"hljs-built_in\">empty<\/span>, check symlink\n<span class=\"hljs-keyword\">ls<\/span> -<span class=\"hljs-keyword\">la<\/span> data\/\n\n# Re-clone <span class=\"hljs-keyword\">if<\/span> needed\ngit clone http<span class=\"hljs-variable\">s:<\/span>\/\/github.<span class=\"hljs-keyword\">com<\/span>\/AdobeDocs\/commerce-webapi.git\n<\/code><\/pre>\n<p><strong>Issue:<\/strong> <code>ModuleNotFoundError: No module named 'magento_graphql_docs_mcp'<\/code><\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-built_in\">cd<\/span> magento-graphql-docs-mcp\npip install <span class=\"hljs-_\">-e<\/span> .\n<\/code><\/pre>\n<p><strong>Issue:<\/strong> Slow performance on first run<\/p>\n<p><strong>Solution:<\/strong> This is normal! First run parses all documentation (3-5 seconds). Subsequent runs use the cached database (0.87 seconds).<\/p>\n<p><strong>Issue:<\/strong> Database locked error<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<pre><code class=\"lang-bash\"><span class=\"hljs-comment\"># Remove database and recreate<\/span>\nrm ~<span class=\"hljs-regexp\">\/.mcp\/magento<\/span>-graphql-docs\/database.db\nrm ~<span class=\"hljs-regexp\">\/.mcp\/magento<\/span>-api\/database.db\n\n<span class=\"hljs-comment\"># Restart servers (will regenerate databases)<\/span>\nmagento-graphql-docs-mcp\nmagento-api-mcp\n<\/code><\/pre>\n<p><strong>Issue:<\/strong> MCP client shows &#8220;Server not found&#8221;<\/p>\n<p><strong>Solution:<\/strong><\/p>\n<ol>\n<li>Test command directly: <code>which magento-graphql-docs-mcp<\/code><\/li>\n<li>Use absolute paths in config<\/li>\n<li>Check logs: <code>~\/Library\/Logs\/Claude\/<\/code> (macOS)<\/li>\n<li>Verify environment variables are set<\/li>\n<\/ol>\n<hr \/>\n<h2 id=\"performance-scalability-built-for-speed\">Performance &amp; Scalability: Built for Speed<\/h2>\n<h3 id=\"real-world-benchmark-results\">Real-World Benchmark Results<\/h3>\n<p>Both MCP servers have been extensively benchmarked on Apple Silicon (M1\/M2) hardware. Here are the results:<\/p>\n<p><strong>REST API MCP Server:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Operation<\/th>\n<th>Performance<\/th>\n<th>Comparison<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Swagger parsing<\/td>\n<td>2-3 seconds<\/td>\n<td>One-time cost<\/td>\n<\/tr>\n<tr>\n<td>Database ingestion<\/td>\n<td>1-2 seconds<\/td>\n<td>One-time cost<\/td>\n<\/tr>\n<tr>\n<td>Endpoint search (594 endpoints)<\/td>\n<td>&lt;100ms<\/td>\n<td>5x faster than web scraping<\/td>\n<\/tr>\n<tr>\n<td>Endpoint lookup<\/td>\n<td>&lt;50ms<\/td>\n<td>10x faster than API calls<\/td>\n<\/tr>\n<tr>\n<td>Schema retrieval<\/td>\n<td>&lt;30ms<\/td>\n<td>Instant<\/td>\n<\/tr>\n<tr>\n<td>Database size<\/td>\n<td>~10 MB<\/td>\n<td>Tiny footprint<\/td>\n<\/tr>\n<tr>\n<td>Startup (cached)<\/td>\n<td>2-3 seconds<\/td>\n<td>Near-instant<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>GraphQL Docs MCP Server:<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Operation<\/th>\n<th>Performance<\/th>\n<th>Comparison<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Doc parsing (350 files)<\/td>\n<td>2-3 seconds<\/td>\n<td>One-time cost<\/td>\n<\/tr>\n<tr>\n<td>Database ingestion<\/td>\n<td>1-2 seconds<\/td>\n<td>One-time cost<\/td>\n<\/tr>\n<tr>\n<td>Documentation search<\/td>\n<td>5.5ms average<\/td>\n<td><strong>18x faster than 100ms target<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Document retrieval<\/td>\n<td>8.2ms<\/td>\n<td>Instant<\/td>\n<\/tr>\n<tr>\n<td>GraphQL element search<\/td>\n<td>3.4ms<\/td>\n<td>Ultra-fast<\/td>\n<\/tr>\n<tr>\n<td>Direct FTS5 query<\/td>\n<td>0.7ms<\/td>\n<td>Near-zero latency<\/td>\n<\/tr>\n<tr>\n<td>Database size<\/td>\n<td>~30 MB<\/td>\n<td>Includes 963 examples<\/td>\n<\/tr>\n<tr>\n<td>Startup (cached)<\/td>\n<td><strong>0.87 seconds<\/strong><\/td>\n<td>Fastest startup<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"performance-comparison-mcp-vs-alternatives\">Performance Comparison: MCP vs Alternatives<\/h3>\n<table>\n<thead>\n<tr>\n<th>Approach<\/th>\n<th>Startup Time<\/th>\n<th>Search Time<\/th>\n<th>Offline<\/th>\n<th>Structured Data<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>MCP Servers<\/strong><\/td>\n<td>3-5s (first) \/ &lt;1s (cached)<\/td>\n<td>&lt;10ms<\/td>\n<td>\u2705 Yes<\/td>\n<td>\u2705 Yes<\/td>\n<\/tr>\n<tr>\n<td>Web Scraping<\/td>\n<td>30-60 seconds<\/td>\n<td>200-500ms<\/td>\n<td>\u274c No<\/td>\n<td>\u274c No<\/td>\n<\/tr>\n<tr>\n<td>Manual Docs<\/td>\n<td>N\/A<\/td>\n<td>Manual browsing<\/td>\n<td>\u2705 Yes<\/td>\n<td>\u274c No<\/td>\n<\/tr>\n<tr>\n<td>Direct API Calls<\/td>\n<td>0 seconds<\/td>\n<td>500ms-2s<\/td>\n<td>\u274c No<\/td>\n<td>\u2705 Yes<\/td>\n<\/tr>\n<tr>\n<td>In-Memory Search<\/td>\n<td>10-30 seconds<\/td>\n<td>50-200ms<\/td>\n<td>\u2705 Yes<\/td>\n<td>\u26a0\ufe0f Partial<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Key Advantages:<\/strong><\/p>\n<ol>\n<li><strong>Cached Performance:<\/strong> After first run, both servers start in under 1 second<\/li>\n<li><strong>Sub-10ms Searches:<\/strong> FTS5 indexes deliver Google-speed searches<\/li>\n<li><strong>No Network Dependency:<\/strong> Work anywhere, even offline<\/li>\n<li><strong>Consistent Performance:<\/strong> No variation based on network or API limits<\/li>\n<li><strong>Minimal Resource Usage:<\/strong> SQLite databases fit in memory, minimal CPU<\/li>\n<\/ol>\n<h3 id=\"scalability-considerations\">Scalability Considerations<\/h3>\n<p><strong>Database Scalability:<\/strong><\/p>\n<ul>\n<li>SQLite handles millions of rows efficiently<\/li>\n<li>FTS5 indexes scale logarithmically<\/li>\n<li>Current databases (~40 MB combined) easily fit in memory<\/li>\n<li>Tested with 10,000+ concurrent searches: no degradation<\/li>\n<\/ul>\n<p><strong>Multi-User Scenarios:<\/strong><\/p>\n<ul>\n<li>Each developer runs their own MCP server instance<\/li>\n<li>No shared database contention<\/li>\n<li>No API rate limits or quotas<\/li>\n<li>Perfect for team environments<\/li>\n<\/ul>\n<p><strong>Large Documentation Sets:<\/strong><\/p>\n<ul>\n<li>GraphQL server tested with 350+ documents: excellent performance<\/li>\n<li>REST server tested with 594+ endpoints: excellent performance<\/li>\n<li>Could scale to 10,000+ documents with same architecture<\/li>\n<li>FTS5 indexing strategy proven for large datasets<\/li>\n<\/ul>\n<p><strong>Update Frequency:<\/strong><\/p>\n<ul>\n<li>File modification time checking prevents unnecessary re-parsing<\/li>\n<li>Full re-ingestion takes 3-5 seconds when needed<\/li>\n<li>Can be automated with filesystem watchers<\/li>\n<li>CI\/CD integration possible for auto-updates<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"advanced-use-cases-beyond-basic-integration\">Advanced Use Cases: Beyond Basic Integration<\/h2>\n<h3 id=\"multi-api-strategy-rest-graphql\">Multi-API Strategy: REST + GraphQL<\/h3>\n<p>Modern Magento projects often use both REST and GraphQL APIs strategically:<\/p>\n<p><strong>REST API Best For:<\/strong><\/p>\n<ul>\n<li>Admin panel integrations<\/li>\n<li>Backend automation<\/li>\n<li>Simple CRUD operations<\/li>\n<li>Existing REST clients<\/li>\n<li>Third-party integrations (ERP, PIM)<\/li>\n<\/ul>\n<p><strong>GraphQL Best For:<\/strong><\/p>\n<ul>\n<li>Frontend applications (PWA, mobile)<\/li>\n<li>Complex queries with nested data<\/li>\n<li>Reducing over-fetching<\/li>\n<li>Real-time customer interactions<\/li>\n<li>Modern JavaScript frameworks<\/li>\n<\/ul>\n<p><strong>AI Agent Strategy with Both MCP Servers:<\/strong><\/p>\n<pre><code>Agent analyzes requiremen<span class=\"hljs-variable\">t:<\/span>\n<span class=\"hljs-string\">\"Build inventory sync between ERP and Magento\"<\/span>\n\nAgent decision proces<span class=\"hljs-variable\">s:<\/span>\n<span class=\"hljs-number\">1<\/span>. search_endpoints(queries=[<span class=\"hljs-string\">\"inventory\"<\/span>, <span class=\"hljs-string\">\"stock\"<\/span>]) via REST MCP\n   \u2192 Finds POST \/V1\/inventory\/<span class=\"hljs-keyword\">source<\/span>-<span class=\"hljs-built_in\">items<\/span>\n\n<span class=\"hljs-number\">2<\/span>. search_documentation(queries=[<span class=\"hljs-string\">\"inventory\"<\/span>, <span class=\"hljs-string\">\"stock\"<\/span>]) via GraphQL MCP\n   \u2192 Finds GraphQL queries <span class=\"hljs-keyword\">for<\/span> inventory <span class=\"hljs-keyword\">display<\/span>\n\n<span class=\"hljs-number\">3<\/span>. Agent decide<span class=\"hljs-variable\">s:<\/span> Use REST <span class=\"hljs-keyword\">for<\/span> inventory updates (admin), GraphQL <span class=\"hljs-keyword\">for<\/span> frontend <span class=\"hljs-keyword\">display<\/span>\n\n<span class=\"hljs-number\">4<\/span>. Agent generates hybrid solution:\n   - REST API client <span class=\"hljs-keyword\">for<\/span> ERP \u2192 Magento <span class=\"hljs-keyword\">sync<\/span>\n   - GraphQL queries <span class=\"hljs-keyword\">for<\/span> real-time stock <span class=\"hljs-keyword\">display<\/span>\n   - Shared TypeScript types from both schemas\n<\/code><\/pre>\n<h3 id=\"automated-testing-documentation-driven-test-generation\">Automated Testing: Documentation-Driven Test Generation<\/h3>\n<p>Use MCP servers to automatically generate comprehensive API test suites:<\/p>\n<p><strong>Workflow:<\/strong><\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-comment\"># Agent generates tests from documentation<\/span>\n<span class=\"hljs-attr\">agent_task<\/span> = <span class=\"hljs-string\">\"Generate API tests for all cart endpoints\"<\/span>\n\n<span class=\"hljs-comment\"># Step 1: Discover all cart endpoints (REST MCP)<\/span>\n<span class=\"hljs-attr\">endpoints<\/span> = search_endpoints(<span class=\"hljs-attr\">queries=[\"cart\"])<\/span>\n\n<span class=\"hljs-comment\"># Step 2: Get schema details for each<\/span>\nfor endpoint <span class=\"hljs-keyword\">in<\/span> endpoints:\n    <span class=\"hljs-attr\">details<\/span> = get_endpoint_details(endpoint.path, endpoint.method)\n\n    <span class=\"hljs-comment\"># Step 3: Find examples (GraphQL MCP)<\/span>\n    <span class=\"hljs-attr\">examples<\/span> = search_examples(<span class=\"hljs-attr\">query=endpoint.operation_id,<\/span> <span class=\"hljs-attr\">language=\"json\")<\/span>\n\n    <span class=\"hljs-comment\"># Step 4: Generate tests<\/span>\n    generate_test(\n        <span class=\"hljs-attr\">endpoint=details,<\/span>\n        <span class=\"hljs-attr\">examples=examples,<\/span>\n        <span class=\"hljs-attr\">test_framework=\"pytest\"<\/span>\n    )\n<\/code><\/pre>\n<p><strong>Generated Test Example:<\/strong><\/p>\n<pre><code class=\"lang-python\"><span class=\"hljs-keyword\">import<\/span> pytest\n<span class=\"hljs-keyword\">import<\/span> requests\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">TestCartEndpoints<\/span>:<\/span>\n    base_url = <span class=\"hljs-string\">\"https:\/\/magento.test\"<\/span>\n    api_token = <span class=\"hljs-string\">\"your_token_here\"<\/span>\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">test_create_empty_cart<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-string\">\"\"\"Test POST \/V1\/carts\/mine - Create empty cart\n\n        Schema: quote-data-cart-interface\n        Status codes: 200 (Success), 401 (Unauthorized)\n        \"\"\"<\/span>\n        response = requests.post(\n            f<span class=\"hljs-string\">\"{self.base_url}\/rest\/V1\/carts\/mine\"<\/span>,\n            headers={<span class=\"hljs-string\">\"Authorization\"<\/span>: f<span class=\"hljs-string\">\"Bearer {self.api_token}\"<\/span>}\n        )\n\n        <span class=\"hljs-keyword\">assert<\/span> response.status_code == <span class=\"hljs-number\">200<\/span>\n        data = response.json()\n        <span class=\"hljs-keyword\">assert<\/span> <span class=\"hljs-string\">\"id\"<\/span> <span class=\"hljs-keyword\">in<\/span> data\n        <span class=\"hljs-keyword\">assert<\/span> isinstance(data[<span class=\"hljs-string\">\"id\"<\/span>], int)\n\n    <span class=\"hljs-function\"><span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title\">test_add_product_to_cart<\/span><span class=\"hljs-params\">(self)<\/span>:<\/span>\n        <span class=\"hljs-string\">\"\"\"Test POST \/V1\/carts\/mine\/items - Add product\n\n        Schema: quote-data-cart-item-interface\n        Status codes: 200 (Success), 400 (Bad Request), 404 (Not Found)\n        \"\"\"<\/span>\n        <span class=\"hljs-comment\"># Test implementation from GraphQL examples<\/span>\n        <span class=\"hljs-comment\"># ...<\/span>\n<\/code><\/pre>\n<h3 id=\"code-migration-rest-to-graphql\">Code Migration: REST to GraphQL<\/h3>\n<p>Use both MCP servers to assist in migrating REST implementations to GraphQL:<\/p>\n<p><strong>Agent Workflow:<\/strong><\/p>\n<pre><code>1. <span class=\"hljs-keyword\">Analyze<\/span> existing REST code\n<span class=\"hljs-number\">2.<\/span> search_endpoints() <span class=\"hljs-keyword\">to<\/span> understand <span class=\"hljs-keyword\">current<\/span> REST endpoint\n<span class=\"hljs-number\">3.<\/span> get_endpoint_details() <span class=\"hljs-keyword\">to<\/span> <span class=\"hljs-keyword\">get<\/span> response <span class=\"hljs-keyword\">schema<\/span>\n<span class=\"hljs-number\">4.<\/span> search_graphql_elements() <span class=\"hljs-keyword\">to<\/span> find equivalent GraphQL <span class=\"hljs-keyword\">query<\/span>\n<span class=\"hljs-number\">5.<\/span> get_element_details() <span class=\"hljs-keyword\">to<\/span> compare <span class=\"hljs-keyword\">data<\/span> structures\n<span class=\"hljs-number\">6.<\/span> search_examples() <span class=\"hljs-keyword\">to<\/span> find working GraphQL implementation\n<span class=\"hljs-number\">7.<\/span> Generate <span class=\"hljs-keyword\">migration<\/span> code <span class=\"hljs-keyword\">with<\/span> <span class=\"hljs-keyword\">data<\/span> <span class=\"hljs-keyword\">mapping<\/span>\n<\/code><\/pre>\n<p><strong>Example Migration:<\/strong><\/p>\n<p><strong>Before (REST):<\/strong><\/p>\n<pre><code class=\"lang-javascript\">\/\/ Old REST implementation\nconst response = await fetch('\/rest\/V1\/products?searchCriteria[<span class=\"hljs-string\">filter_groups<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">filters<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">field<\/span>]=price&amp;searchCriteria[<span class=\"hljs-string\">filter_groups<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">filters<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">value<\/span>]=50&amp;searchCriteria[<span class=\"hljs-string\">filter_groups<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">filters<\/span>][<span class=\"hljs-symbol\">0<\/span>][<span class=\"hljs-string\">condition_type<\/span>]=gteq');\nconst products = await response.json();\n<\/code><\/pre>\n<p><strong>After (GraphQL &#8211; Generated by AI):<\/strong><\/p>\n<pre><code class=\"lang-graphql\">query GetProducts($minPrice: Float!) {\n  products(\n    filter: {\n      price: { from: $minPrice }\n    }\n  ) {\n    items {\n      id\n      sku\n      name\n      price_range {\n        minimum_price {\n          final_price {\n            value\n            currency\n          }\n        }\n      }\n    }\n  }\n}\n<\/code><\/pre>\n<p><strong>AI Agent Benefits:<\/strong><\/p>\n<ul>\n<li>Identifies equivalent GraphQL queries<\/li>\n<li>Maps REST response fields to GraphQL fields<\/li>\n<li>Handles breaking changes<\/li>\n<li>Optimizes query structure<\/li>\n<li>Adds error handling<\/li>\n<\/ul>\n<h3 id=\"documentation-generation-create-custom-integration-guides\">Documentation Generation: Create Custom Integration Guides<\/h3>\n<p>Use MCP servers to generate custom documentation for specific integration scenarios:<\/p>\n<pre><code>Agent task: <span class=\"hljs-string\">\"Create integration guide for B2B customer registration with custom attributes\"<\/span>\n\nAgent process:\n<span class=\"hljs-number\">1<\/span>. get_tutorial(tutorial_name=<span class=\"hljs-string\">\"customer\"<\/span>) via GraphQL MCP\n<span class=\"hljs-number\">2<\/span>. search_graphql_elements(query=<span class=\"hljs-string\">\"customer\"<\/span>, element_type=<span class=\"hljs-string\">\"mutation\"<\/span>)\n<span class=\"hljs-number\">3<\/span>. get_element_details(element_name=<span class=\"hljs-string\">\"createCustomer\"<\/span>)\n<span class=\"hljs-number\">4<\/span>. search_endpoints(queries=<span class=\"hljs-string\">[\"customer create\"]<\/span>, filter_by_method=<span class=\"hljs-string\">\"<span class=\"hljs-keyword\">POST<\/span>\"<\/span>)\n<span class=\"hljs-number\">5<\/span>. get_schema(name=<span class=\"hljs-string\">\"customer-data-customer-interface\"<\/span>)\n<span class=\"hljs-number\">6<\/span>. search_examples(query=<span class=\"hljs-string\">\"custom attributes\"<\/span>)\n\nAgent generates:\n- Markdown documentation with working examples\n- Code snippets in multiple languages\n- API reference tables\n- Step-by-step implementation guide\n- Error handling documentation\n<\/code><\/pre>\n<p><strong>Output: Custom Integration Guide<\/strong><\/p>\n<pre><code class=\"lang-markdown\"># B2B Customer Registration <span class=\"hljs-keyword\">with<\/span> Custom Attributes\n\n## Overview\nThis guide demonstrates how to register B2B customers <span class=\"hljs-keyword\">with<\/span> custom attributes using both REST and GraphQL APIs.\n\n## GraphQL Approach (Recommended)\n\n### Step <span class=\"hljs-number\">1<\/span>: Create Customer Account\n\\`\\`\\`graphql\nmutation {\n  createCustomer(input: {\n    firstname: <span class=\"hljs-string\">\"John\"<\/span>\n    lastname: <span class=\"hljs-string\">\"Doe\"<\/span>\n    email: <span class=\"hljs-string\">\"john@company.com\"<\/span>\n    password: <span class=\"hljs-string\">\"SecurePass123\"<\/span>\n    custom_attributes: [\n      { attribute_code: <span class=\"hljs-string\">\"company_name\"<\/span>, value: <span class=\"hljs-string\">\"Acme Corp\"<\/span> }\n      { attribute_code: <span class=\"hljs-string\">\"tax_vat\"<\/span>, value: <span class=\"hljs-string\">\"GB123456789\"<\/span> }\n    ]\n  }) {\n    customer {\n      id\n      email\n      firstname\n      lastname\n    }\n  }\n}\n\\`\\`\\`\n\n### Step <span class=\"hljs-number\">2<\/span>: Add B2B Company Association\n\\`\\`\\`graphql\nmutation {\n  assignCustomerToCompany(\n    customerId: <span class=\"hljs-number\">123<\/span>\n    companyId: <span class=\"hljs-number\">456<\/span>\n  ) {\n    success\n  }\n}\n\\`\\`\\`\n\n## REST Approach\n\n### POST \/V1\/customers\n\\`\\`\\`json\n{\n  <span class=\"hljs-string\">\"customer\"<\/span>: {\n    <span class=\"hljs-string\">\"email\"<\/span>: <span class=\"hljs-string\">\"john@company.com\"<\/span>,\n    <span class=\"hljs-string\">\"firstname\"<\/span>: <span class=\"hljs-string\">\"John\"<\/span>,\n    <span class=\"hljs-string\">\"lastname\"<\/span>: <span class=\"hljs-string\">\"Doe\"<\/span>,\n    <span class=\"hljs-string\">\"custom_attributes\"<\/span>: [\n      { <span class=\"hljs-string\">\"attribute_code\"<\/span>: <span class=\"hljs-string\">\"company_name\"<\/span>, <span class=\"hljs-string\">\"value\"<\/span>: <span class=\"hljs-string\">\"Acme Corp\"<\/span> }\n    ]\n  },\n  <span class=\"hljs-string\">\"password\"<\/span>: <span class=\"hljs-string\">\"SecurePass123\"<\/span>\n}\n\\`\\`\\`\n\n...\n<\/code><\/pre>\n<hr \/>\n<h2 id=\"comparison-with-traditional-approaches\">Comparison with Traditional Approaches<\/h2>\n<h3 id=\"mcp-servers-vs-web-documentation\">MCP Servers vs Web Documentation<\/h3>\n<p><strong>Traditional Web Documentation:<\/strong><\/p>\n<ul>\n<li>\u274c Manual browsing and searching<\/li>\n<li>\u274c Copy-paste code snippets<\/li>\n<li>\u274c Human interpretation required<\/li>\n<li>\u274c Slow context switching<\/li>\n<li>\u274c Risk of outdated information<\/li>\n<\/ul>\n<p><strong>MCP Server Approach:<\/strong><\/p>\n<ul>\n<li>\u2705 Programmatic access for AI agents<\/li>\n<li>\u2705 Instant search (&lt;10ms)<\/li>\n<li>\u2705 Structured, validated data<\/li>\n<li>\u2705 Context preserved automatically<\/li>\n<li>\u2705 Local, always consistent<\/li>\n<\/ul>\n<h3 id=\"mcp-servers-vs-api-testing-tools-postman-insomnia-\">MCP Servers vs API Testing Tools (Postman, Insomnia)<\/h3>\n<p><strong>API Testing Tools:<\/strong><\/p>\n<ul>\n<li>\u26a0\ufe0f Manual collection creation<\/li>\n<li>\u26a0\ufe0f Limited to REST (or limited GraphQL)<\/li>\n<li>\u26a0\ufe0f No AI integration<\/li>\n<li>\u26a0\ufe0f Requires manual updates<\/li>\n<li>\u2705 Good for testing<\/li>\n<\/ul>\n<p><strong>MCP Servers:<\/strong><\/p>\n<ul>\n<li>\u2705 Automatic documentation parsing<\/li>\n<li>\u2705 REST and GraphQL support<\/li>\n<li>\u2705 Native AI integration<\/li>\n<li>\u2705 Auto-updates from source<\/li>\n<li>\u2705 Documentation + testing<\/li>\n<\/ul>\n<p><strong>Use Both:<\/strong> MCP servers for AI development, Postman\/Insomnia for manual testing.<\/p>\n<h3 id=\"mcp-servers-vs-openapi-generators\">MCP Servers vs OpenAPI Generators<\/h3>\n<p><strong>OpenAPI Code Generators:<\/strong><\/p>\n<ul>\n<li>\u2705 Generate client libraries<\/li>\n<li>\u274c REST only<\/li>\n<li>\u274c No documentation access<\/li>\n<li>\u274c No AI integration<\/li>\n<li>\u274c Boilerplate only<\/li>\n<\/ul>\n<p><strong>MCP Servers:<\/strong><\/p>\n<ul>\n<li>\u2705 AI generates custom code<\/li>\n<li>\u2705 REST + GraphQL<\/li>\n<li>\u2705 Full documentation access<\/li>\n<li>\u2705 Native AI integration<\/li>\n<li>\u2705 Production-ready implementations<\/li>\n<\/ul>\n<p><strong>Complementary:<\/strong> Use OpenAPI generators for base clients, MCP servers for AI-powered customization.<\/p>\n<hr \/>\n<h2 id=\"future-roadmap-community-involvement\">Future Roadmap &amp; Community Involvement<\/h2>\n<h3 id=\"planned-features\">Planned Features<\/h3>\n<p><strong>REST API MCP Server:<\/strong><\/p>\n<p><strong>Q2 2025:<\/strong><\/p>\n<ul>\n<li>Multiple Magento version support (2.4.6, 2.4.7, 2.4.8)<\/li>\n<li>Deep <code>$ref<\/code> resolution for nested schemas<\/li>\n<li>Request\/response examples from OpenAPI<\/li>\n<li>Interactive schema explorer tool<\/li>\n<li>Custom swagger.json support for extensions<\/li>\n<\/ul>\n<p><strong>Q3 2025:<\/strong><\/p>\n<ul>\n<li>Webhook documentation integration<\/li>\n<li>Admin API vs Store API differentiation<\/li>\n<li>Performance optimization for 1000+ endpoints<\/li>\n<li>Export to Postman collections<\/li>\n<li>GraphQL schema comparison tool<\/li>\n<\/ul>\n<p><strong>GraphQL Documentation MCP Server:<\/strong><\/p>\n<p><strong>Q2 2025:<\/strong><\/p>\n<ul>\n<li>Real-time documentation updates via GitHub Actions<\/li>\n<li>Custom tutorial support for third-party extensions<\/li>\n<li>Code generation templates (React, Vue, Angular)<\/li>\n<li>Multi-version documentation (2.4.6, 2.4.7, 2.4.8)<\/li>\n<li>Tutorial completion tracking<\/li>\n<\/ul>\n<p><strong>Q3 2025:<\/strong><\/p>\n<ul>\n<li>Interactive query builder<\/li>\n<li>Video tutorial integration<\/li>\n<li>Community-contributed examples<\/li>\n<li>Translation support (multiple languages)<\/li>\n<li>Advanced search with semantic understanding<\/li>\n<\/ul>\n<h3 id=\"join-the-community\">Join the Community<\/h3>\n<p>Both MCP servers are fully open-source and welcome contributions!<\/p>\n<p><strong>GitHub Repositories:<\/strong><\/p>\n<ul>\n<li>REST API MCP: <a href=\"https:\/\/github.com\/florinel-chis\/magento-api-mcp\">github.com\/florinel-chis\/magento-api-mcp<\/a><\/li>\n<li>GraphQL Docs MCP: <a href=\"https:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\">github.com\/florinel-chis\/magento-graphql-docs-mcp<\/a><\/li>\n<\/ul>\n<p><strong>Ways to Contribute:<\/strong><\/p>\n<ol>\n<li><strong>Star the Repositories<\/strong> \u2b50 &#8211; Show support and help others discover the tools<\/li>\n<li><strong>Report Issues<\/strong> \ud83d\udc1b &#8211; Found a bug? Documentation unclear? Let us know!<\/li>\n<li><strong>Submit Pull Requests<\/strong> \ud83d\udcbb &#8211; Code improvements, new features, bug fixes<\/li>\n<li><strong>Add Examples<\/strong> \ud83d\udcda &#8211; Share your use cases and implementations<\/li>\n<li><strong>Improve Documentation<\/strong> \ud83d\udcdd &#8211; Help others get started<\/li>\n<li><strong>Share Your Experience<\/strong> \ud83d\udcac &#8211; Blog posts, videos, tutorials<\/li>\n<li><strong>Suggest Features<\/strong> \ud83d\udca1 &#8211; What would make these tools better?<\/li>\n<\/ol>\n<p><strong>Community Resources:<\/strong><\/p>\n<ul>\n<li>GitHub Issues &#8211; Bug reports and feature requests<\/li>\n<li>GitHub Discussions &#8211; Questions and use cases<\/li>\n<li>Pull Requests &#8211; Code contributions welcome<\/li>\n<li>Examples Gallery &#8211; Community-contributed examples<\/li>\n<\/ul>\n<p><strong>Contributing Guidelines:<\/strong><br \/>\nBoth repositories include comprehensive <code>CONTRIBUTING.md<\/code> files with:<\/p>\n<ul>\n<li>Code style guidelines<\/li>\n<li>Testing requirements<\/li>\n<li>Pull request process<\/li>\n<li>Development setup instructions<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"conclusion-the-future-is-ai-powered-mcp-enabled\">Conclusion: The Future is AI-Powered, MCP-Enabled<\/h2>\n<p>We&#8217;re witnessing a fundamental shift in software development. AI agents augmented with tools like MCP servers aren&#8217;t just making development faster\u2014they&#8217;re making it more accurate, more comprehensive, and more accessible.<\/p>\n<h3 id=\"key-takeaways\">Key Takeaways<\/h3>\n<p><strong>1. MCP Bridges AI and Documentation<\/strong><br \/>\nModel Context Protocol provides the missing link between AI agents and the vast documentation ecosystems that modern frameworks require. For Magento 2, this means AI agents can instantly access 594 REST endpoints and 350+ GraphQL documentation pages.<\/p>\n<p><strong>2. Two Servers, Complete Coverage<\/strong><br \/>\nThe REST API MCP Server delivers structured OpenAPI specifications perfect for API integration, while the GraphQL Documentation MCP Server provides narrative content, tutorials, and 963 working examples. Together, they cover every aspect of Magento API development.<\/p>\n<p><strong>3. Real Performance, Real Results<\/strong><br \/>\nThese aren&#8217;t prototype tools\u2014they&#8217;re production-ready with benchmarked performance:<\/p>\n<ul>\n<li>REST API searches: &lt;100ms across 594 endpoints<\/li>\n<li>GraphQL doc searches: 5.5ms average (18x faster than target)<\/li>\n<li>Startup time: &lt;1 second (cached)<\/li>\n<li>Zero network dependency (fully offline)<\/li>\n<\/ul>\n<p><strong>4. Agentic Development Works Today<\/strong><br \/>\nAI agents using these MCP servers can build production-ready Magento integrations in minutes. From custom checkout flows to complex B2B scenarios, the combination of instant documentation access and AI code generation transforms development speed.<\/p>\n<p><strong>5. Open Source, Community-Driven<\/strong><br \/>\nBoth servers are fully open-source, actively maintained, and welcoming contributors. This is just the beginning\u2014the roadmap includes multi-version support, enhanced search, code generation templates, and community features.<\/p>\n<h3 id=\"start-building-intelligent-magento-applications-today\">Start Building Intelligent Magento Applications Today<\/h3>\n<p>The tools are ready. The documentation is waiting. The AI agents are capable. Now it&#8217;s your turn to experience the future of Magento development.<\/p>\n<p><strong>Get Started in 3 Steps:<\/strong><\/p>\n<ol>\n<li><strong>Clone the Repositories<\/strong>\n<pre><code class=\"lang-bash\"><span class=\"hljs-comment\"># REST API MCP<\/span>\ngit <span class=\"hljs-keyword\">clone<\/span> <span class=\"hljs-title\">https<\/span>:\/\/github.com\/florinel-chis\/magento-api-mcp\n\n<span class=\"hljs-comment\"># GraphQL Docs MCP<\/span>\ngit <span class=\"hljs-keyword\">clone<\/span> <span class=\"hljs-title\">https<\/span>:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\n<\/code><\/pre>\n<\/li>\n<li><strong>Install and Configure<\/strong>\n<pre><code class=\"lang-bash\"><span class=\"hljs-built_in\">cd<\/span> magento-api-mcp &amp;&amp; pip install <span class=\"hljs-_\">-e<\/span> .\n<span class=\"hljs-built_in\">cd<\/span> magento-graphql-docs-mcp &amp;&amp; pip install <span class=\"hljs-_\">-e<\/span> .\n\n<span class=\"hljs-comment\"># Add to Claude Desktop config<\/span>\n<\/code><\/pre>\n<\/li>\n<li><strong>Try an Example<\/strong>\n<pre><code class=\"lang-bash\"># Run working examples\n<span class=\"hljs-keyword\">cd<\/span> magento-graphql-docs-mcp\/examples\n<span class=\"hljs-keyword\">python3<\/span> example_cart_checkout.<span class=\"hljs-keyword\">py<\/span>\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><strong>Join the Community:<\/strong><\/p>\n<ul>\n<li>\u2b50 Star both repositories on GitHub<\/li>\n<li>\ud83d\ude80 Try the servers with your next Magento project<\/li>\n<li>\ud83d\udcac Share your experience and use cases<\/li>\n<li>\ud83e\udd1d Contribute improvements and examples<\/li>\n<li>\ud83d\udce3 Help others discover these tools<\/li>\n<\/ul>\n<h3 id=\"the-promise-of-ai-powered-development\">The Promise of AI-Powered Development<\/h3>\n<p>These MCP servers represent more than just tools\u2014they&#8217;re a glimpse into the future of software development. A future where:<\/p>\n<ul>\n<li><strong>AI agents<\/strong> understand complex API ecosystems instantly<\/li>\n<li><strong>Documentation<\/strong> is instantly accessible, not manually searched<\/li>\n<li><strong>Code generation<\/strong> is accurate, complete, and production-ready<\/li>\n<li><strong>Developers<\/strong> focus on architecture and business logic, not boilerplate<\/li>\n<li><strong>Development speed<\/strong> is measured in minutes, not days<\/li>\n<\/ul>\n<p>For Magento 2 specifically, this means:<\/p>\n<ul>\n<li>Build complex integrations in hours, not weeks<\/li>\n<li>Generate correct API implementations without trial and error<\/li>\n<li>Explore the complete API surface area instantly<\/li>\n<li>Learn best practices from official documentation<\/li>\n<li>Scale development with AI augmentation<\/li>\n<\/ul>\n<h3 id=\"your-next-steps\">Your Next Steps<\/h3>\n<p><strong>For Magento Developers:<\/strong><\/p>\n<ul>\n<li>Install both MCP servers today<\/li>\n<li>Try building your next integration with AI assistance<\/li>\n<li>Compare your speed with and without MCP servers<\/li>\n<li>Share your results with the community<\/li>\n<\/ul>\n<p><strong>For AI Engineers:<\/strong><\/p>\n<ul>\n<li>Study how MCP protocol works<\/li>\n<li>Explore building custom MCP servers for other platforms<\/li>\n<li>Experiment with agentic development patterns<\/li>\n<li>Contribute to the open-source ecosystem<\/li>\n<\/ul>\n<p><strong>For Technical Leaders:<\/strong><\/p>\n<ul>\n<li>Evaluate MCP servers for your team<\/li>\n<li>Measure productivity improvements<\/li>\n<li>Consider AI-powered development toolchains<\/li>\n<li>Plan your AI integration strategy<\/li>\n<\/ul>\n<hr \/>\n<h2 id=\"resources-links\">Resources &amp; Links<\/h2>\n<h3 id=\"official-documentation\">Official Documentation<\/h3>\n<ul>\n<li><a href=\"https:\/\/modelcontextprotocol.io\/\">Model Context Protocol<\/a> &#8211; MCP specification and guides<\/li>\n<li><a href=\"https:\/\/claude.ai\/\">Anthropic Claude<\/a> &#8211; AI assistant with native MCP support<\/li>\n<li><a href=\"https:\/\/developer.adobe.com\/commerce\/\">Magento DevDocs<\/a> &#8211; Official Magento documentation<\/li>\n<li><a href=\"https:\/\/github.com\/jlowin\/fastmcp\">FastMCP Framework<\/a> &#8211; Python MCP server framework<\/li>\n<\/ul>\n<h3 id=\"mcp-server-repositories\">MCP Server Repositories<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/florinel-chis\/magento-api-mcp\">Magento REST API MCP Server<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/florinel-chis\/magento-graphql-docs-mcp\">Magento GraphQL Docs MCP Server<\/a><\/li>\n<\/ul>\n<h3 id=\"related-tools\">Related Tools<\/h3>\n<ul>\n<li><a href=\"https:\/\/swagger.io\/specification\/\">OpenAPI Specification<\/a> &#8211; REST API spec format<\/li>\n<li><a href=\"https:\/\/graphql.org\/\">GraphQL<\/a> &#8211; Query language for APIs<\/li>\n<li><a href=\"https:\/\/www.sqlite.org\/fts5.html\">SQLite FTS5<\/a> &#8211; Full-text search extension<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: The Dawn of AI-Powered E-Commerce Development Picture this: You&#8217;re building a complex Magento 2 integration\u2014maybe a custom checkout flow, an advanced product import system, or a sophisticated order management dashboard. Traditionally, this means hours of browsing documentation, cross-referencing REST and GraphQL APIs, and constantly switching between browser tabs and your IDE. But what if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":109,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[1],"tags":[26,25,27,29,28,22,23,24],"class_list":["post-106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","tag-agenticdevelopment-2","tag-aiagents-2","tag-claudeai-2","tag-fastmcp","tag-graphql-2","tag-magento2-2","tag-mcp-2","tag-restapi-2"],"_links":{"self":[{"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":1,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/posts\/106\/revisions\/108"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/media\/109"}],"wp:attachment":[{"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/magendoo.ro\/insights\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}