sprinixtech/magento-mcp-server
3.2
If you are the rightful owner of magento-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Sprinix_MageMCPServer is a Magento 2 module designed to expose REST and GraphQL APIs in an MCP-compatible format, facilitating integration with AI agents and autonomous tools.
Sprinix_MageMCPServer
A Magento 2 module to expose REST and GraphQL APIs in MCP-compatible format for use with AI agents like LangChain, OpenAI Assistants, and autonomous tools.
š§ What It Does
This module dynamically generates MCP-style tool metadata (as JSON schema) for all Magento REST endpoints. These metadata files can be consumed by:
- LangChain agents
- OpenAI Assistants API
- RAG pipelines
- Custom AI workflows
š Features
- ā
REST API metadata via
/mcp/metadata
- ā Admin config for enable/disable and cache TTL
- ā
Cached metadata in
var/
for speed - ā
OpenAPI-style JSON at
/mcp/metadata/openapi
- ā LangChain & Assistant-API friendly output
š ļø Installation
composer require sprinixtech/magento-mcp-server
php bin/magento setup:upgrade
php bin/magento cache:flush
āļø Admin Configuration
Navigate to:
Stores ā Configuration ā MCP Server
You can:
- Enable/disable the MCP server
- Set metadata cache lifetime (in seconds)
š± Available Endpoints
Endpoint URL | Description |
---|---|
/mcp/metadata | MCP metadata for REST APIs |
/mcp/metadata/graphql | MCP metadata for GraphQL queries/mutations |
/mcp/metadata/openapi | REST metadata in OpenAPI style |
š§ LangChain Usage Example (Node.js)
import { ChatOpenAI } from "langchain/chat_models/openai";
import { DynamicTool } from "langchain/tools";
const res = await fetch("https://your-magento.com/mcp/metadata/graphql");
const toolsJson = await res.json();
const tools = toolsJson.map(tool => new DynamicTool({
name: tool.name,
description: tool.description,
func: async (input) => {
const response = await fetch(tool.api.url, {
method: tool.api.method,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query: `{ ${tool.name} { id name } }` })
});
return await response.text();
}
}));
š® Future Enhancements
- ā CLI command to flush cached metadata
- 𧬠Argument and return type introspection
- š Swagger UI for OpenAPI metadata
- š Multi-store view support
- š Auth/token integration
šØāš» Author
Gulshan Maurya
š§ gulshan.4dream@gmail.com
š LinkedIn
š License
MIT