magento-api-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@magento-api-mcpsearch for cart endpoints"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Magento 2 REST API MCP Server
A local STDIO MCP server that provides tools to search and retrieve Magento 2 REST API documentation from OpenAPI (swagger) specifications.
Features
Search Endpoints: Full-text search across all Magento 2 REST API endpoints
Get Endpoint Details: Retrieve complete documentation for specific API endpoints
List Categories: Browse endpoints by category tags (carts, customers, products, etc.)
Search Schemas: Find data models and schema definitions
Get Schema Details: View complete schema/model definitions with all properties
Offline Operation: Works entirely offline using local swagger.json file
Fast Startup: Only re-parses if swagger.json has been modified
Related MCP server: Swagger Navigator MCP Server
How it Works
Parsing: On startup, the server parses the OpenAPI 3.0 swagger.json file
Indexing: Extracts endpoints, parameters, responses, and schemas
Storage: Stores data in a local SQLite database with FTS5 indexes
Searching: Provides full-text search across paths, descriptions, parameters, and schemas
Installation
Requirements
Python 3.10 or higher
uv (recommended) or pip
Install from Source
cd magento-api-mcp
pip install -e .Usage
Running the Server
magento-api-mcpThe server starts immediately and parses the swagger.json file on first run or when the file has been modified.
Configuration
Database Location: Default is
~/.mcp/magento-api/database.dbOverride with
MAGENTO_API_DB_PATHenvironment variable
Swagger File: Default is
data/swagger.jsonin the package directoryOverride with
MAGENTO_API_SWAGGER_PATHenvironment variable
Using with an MCP Client
Configure your MCP client to run the magento-api-mcp command:
{
"mcpServers": {
"magento-api": {
"command": "magento-api-mcp"
}
}
}Or with custom swagger file:
{
"mcpServers": {
"magento-api": {
"command": "magento-api-mcp",
"env": {
"MAGENTO_API_SWAGGER_PATH": "/path/to/your/swagger.json"
}
}
}
}MCP Tools
1. search_endpoints
Search for API endpoints using keywords.
Parameters:
queries: List of 1-3 short keyword queries (e.g., ["cart", "customer"])filter_by_method: Optional HTTP method filter (GET, POST, PUT, DELETE)filter_by_tag: Optional category filter (e.g., "carts/mine")
Example:
search_endpoints(queries=["cart operations"], filter_by_method="GET")2. get_endpoint_details
Get complete documentation for a specific endpoint.
Parameters:
path: Exact API path (e.g., "/V1/carts/mine")method: Optional HTTP method (if omitted, returns all methods for this path)
Example:
get_endpoint_details(path="/V1/carts/mine", method="GET")Returns:
HTTP method and path
Category and operation ID
Summary and description
Parameters table with types and descriptions
Request body schema (if applicable)
Response codes and schemas
3. list_tags
List all available API category tags.
Returns: Hierarchical list of all endpoint categories with counts.
4. search_schemas
Search for data schemas/models by keyword.
Parameters:
query: Keyword to search for
Example:
search_schemas(query="customer")5. get_schema
Get complete definition of a schema/model.
Parameters:
schema_name: Exact schema name (e.g., "quote-data-cart-interface")
Returns: Full schema with type, description, and all properties in JSON format.
Verification Scripts
Test each component independently:
# Test the OpenAPI parser
python3 tests/verify_parser.py
# Test database ingestion
python3 tests/verify_db.py
# Test MCP server and all tools
python3 tests/verify_server.pyDatabase Schema
The server uses SQLite with the following tables:
endpoints: All API endpoints with FTS5 index
parameters: Endpoint parameters
responses: Response definitions
schemas: Data model definitions with FTS5 index
metadata: Ingestion tracking
Advantages Over Web Scraping
No Network Dependency: Works completely offline
Instant Startup: ~2-5 seconds vs minutes of web scraping
Structured Data: Access to complete OpenAPI metadata
Precise Search: Filter by method, category, response code
Schema Resolution: Navigate complex nested data structures
Deterministic: No HTML parsing or website structure changes
Example Queries
Query | Tool | Purpose |
| search_endpoints | Find all cart-related endpoints |
| search_endpoints | Find customer auth endpoints |
| get_endpoint_details | Get complete cart endpoint docs |
| search_schemas | Find customer-related schemas |
| get_schema | View cart data structure |
Development
Project Structure
magento-api-mcp/
├── magento_api_mcp/
│ ├── __init__.py
│ ├── config.py # Configuration
│ ├── parser.py # OpenAPI parser
│ ├── ingest.py # Database ingestion
│ └── server.py # MCP server with tools
├── tests/
│ ├── verify_parser.py # Parser verification
│ ├── verify_db.py # Database verification
│ └── verify_server.py # Server verification
├── data/
│ └── swagger.json # OpenAPI specification
├── pyproject.toml
└── README.mdAdding New Tools
To add new MCP tools, edit magento_api_mcp/server.py and use the @mcp.tool() decorator.
Using Different Swagger Files
The server can work with any OpenAPI 3.0 swagger file. Simply set the MAGENTO_API_SWAGGER_PATH environment variable:
export MAGENTO_API_SWAGGER_PATH=/path/to/different-api-swagger.json
magento-api-mcpLicense
MIT
Contributing
Contributions welcome! Please test all changes with the verification scripts before submitting.
Support
For issues or questions, please check:
Run verification scripts to diagnose issues
Check database location and permissions
Verify swagger.json is valid OpenAPI 3.0 format
Available Tools
5 toolsget_endpoint_detailsA
Get complete documentation for a specific Magento 2 REST API endpoint. Provide the exact path and optionally the HTTP method to get full details including parameters, request/response schemas.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The exact API path, e.g., '/V1/carts/mine' | |
| method | No | Optional HTTP method (GET, POST, PUT, DELETE). If omitted, returns all methods for this path. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explains the output includes parameters and schemas but does not mention authentication, rate limits, or any constraints. It is adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no fluff: first states purpose, second provides usage instructions. Highly efficient and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists, the description need not detail return structure. It covers what input to provide and what output to expect (including parameters and schemas). Contextually complete for a documentation retrieval tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds value by clarifying the behavior when the optional 'method' is omitted: 'returns all methods for this path', which is not evident from schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Get' and resource 'complete documentation for a specific Magento 2 REST API endpoint', clearly distinguishing it from siblings like search_endpoints or get_schema by requiring an exact path.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states to provide exact path and optionally HTTP method, implying usage for retrieving documentation for a known endpoint. However, it does not explicitly contrast with alternatives or mention when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_schemaB
Get the complete definition of a Magento 2 data schema/model. Schemas define the structure of request/response data objects (e.g., quote-data-cart-interface, customer-data-customer-interface).
| Name | Required | Description | Default |
|---|---|---|---|
| schema_name | Yes | The exact schema name, e.g., 'quote-data-cart-interface' |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description only states a read operation without disclosing behavior on invalid input, error handling, or performance characteristics.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: one for the action and one providing context and examples. No unnecessary words, well structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, so return values are covered. However, the description is minimal and could include edge cases (e.g., what happens if schema_name is invalid). Adequate but not comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds no extra parameter information beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it retrieves the complete definition of a Magento 2 data schema/model. Provides examples of schema names. Does not explicitly differentiate from sibling tools like search_schemas, but the action is distinct.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool vs alternatives. Does not mention when not to use it or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tagsA
List all available API category tags in the Magento 2 REST API. Tags group related endpoints together (e.g., carts, customers, products, orders).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, description must disclose behavior; it indicates a read operation and gives examples but omits details like authentication needs or pagination.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two efficient sentences: first states action, second adds context; no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks explicit return format description, but output schema exists; adequate for a simple list tool with no parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100% and description adds no param info; baseline 4 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists all available API category tags in Magento 2 REST API and provides examples, distinguishing it from sibling tools like get_endpoint_details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like search_endpoints; missing context on prerequisites or exclusion scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_endpointsB
Search for Magento 2 REST API endpoints using keywords. Use SHORT keyword queries (1-3 words) to find endpoints by path, method, category, or description. You can optionally filter by HTTP method or category tag.
| Name | Required | Description | Default |
|---|---|---|---|
| queries | Yes | List of 1-3 short keyword queries. Examples: ['cart', 'customer'], ['product catalog'], ['order invoice'] | |
| filter_by_method | No | Optional: Filter by HTTP method (GET, POST, PUT, DELETE, PATCH) | |
| filter_by_tag | No | Optional: Filter by category tag (e.g., 'carts/mine', 'customers', 'products') |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description only outlines basic search behavior and optional filters. It lacks disclosure of pagination, return format, or error handling, which are important for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two sentences, front-loading the purpose in the first sentence and adding usage guidance in the second. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description does not need to explain return values. It covers purpose and basic usage, but fails to differentiate from sibling tools like search_schemas, leaving some context gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% description coverage, so baseline is 3. The description adds minimal value by specifying '1-3 words' for queries and reminding of optional filters, but does not significantly enhance understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it searches for Magento 2 REST API endpoints using keywords, which is specific and action-oriented. However, it does not explicitly differentiate from sibling tools like get_endpoint_details or search_schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides guidance to use short keyword queries (1-3 words) and optional filters by method or tag. Does not mention when to use this tool versus siblings or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_schemasA
Search for Magento 2 data schemas by keyword. Use this to find data structure definitions by name or description (e.g., 'cart', 'customer', 'product').
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Keyword to search for in schema names and descriptions |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It explains that the tool searches by keyword in names and descriptions, but does not disclose limitations such as pagination, result counts, or search behavior (e.g., exact vs. fuzzy matching).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences: first states purpose, second provides usage guidance with examples. No unnecessary words, efficiently communicates essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple search tool with one parameter and an output schema (not shown), the description covers purpose and usage adequately. Could mention whether wildcards or partial matches are supported, but overall sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (query parameter described as 'Keyword to search for in schema names and descriptions'). The tool description adds minimal extra meaning beyond repeating 'keyword' and providing examples. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches for Magento 2 data schemas by keyword, distinguishing it from siblings like get_schema (retrieves a specific schema) and search_endpoints (searches endpoints). Examples of keywords are provided, enhancing clarity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description advises using the tool to find data structure definitions by name or description, implying when to use it. However, it does not explicitly state when not to use it or mention alternatives like get_schema for exact schema retrieval.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
get_endpoint_details - First observed
get_schema - First observed
list_tags - First observed
search_endpoints - First observed
search_schemas
TDQS
Scored across 5 tools
Each tool targets a distinct aspect of the Magento API: endpoints, schemas, tags, and two separate search functionalities. There is no overlap, and agents can easily differentiate them.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., get_endpoint_details, search_schemas). This predictability helps agents understand their purpose.
With 5 tools, the server is well-scoped for its purpose of providing Magento API documentation. The count is neither too small nor too large, and each tool serves a clear role.
The tool set covers all essential operations for exploring Magento API documentation: listing tags, searching and retrieving endpoint details, and searching and retrieving schema definitions. There are no obvious gaps.
Maintenance
Related MCP Connectors
Search the Final POS REST API documentation.
DevDocs.io keyless docs index + entry search + content (Angular, MDN, Rust, etc.).
Versioned documentation registry and semantic search for AI tools and coding assistants.
Get up-to-date, version-specific documentation and code examples from official sources directly in…
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides offline search and retrieval of Magento 2 GraphQL API documentation with 8 specialized tools for finding queries, mutations, types, tutorials, and code examples across 350+ locally indexed markdown files.89-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to discover, search, and interact with REST APIs by parsing OpenAPI/Swagger specifications with intelligent fuzzy search across endpoints, supporting both local and remote API sources.5 npm2MIT
- AlicenseAqualityDmaintenanceEnables progressive exploration of Swagger/OpenAPI API documentation. Supports loading multiple specs, browsing endpoints and schemas, and searching across documentation.125 npm1MIT
- FlicenseAqualityDmaintenanceEnables reading and parsing Swagger/OpenAPI specifications to list API endpoints, get detailed endpoint info, search APIs, and generate TypeScript types for request/response.9-