manufacturing-defect-mcp
Provides tools for interacting with a Neo4j knowledge graph, enabling graph analytics (centrality, community detection), graph machine learning (node classification, embeddings, similar case retrieval), and text-to-cypher querying for manufacturing defect investigation.
Uses Ollama to run local LLM agents for generating Cypher queries from natural language and for generating investigation reports based on graph evidence.
Click on "Install 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., "@manufacturing-defect-mcpinvestigate defect case UID000001"
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.
Explainable Manufacturing Defect Investigation Using Knowledge Graphs, Neo4j GDS, MCP, and Agentic AI
A manufacturing investigation platform that combines Computer Vision outputs, Knowledge Graphs, Graph Data Science (GDS), Model Context Protocol (MCP), and Local LLM Agents to support defect analysis and engineering investigations.
The system extends traditional defect detection by providing contextual information, graph analytics, graph-based machine learning, and natural language access to manufacturing knowledge.
Overview
Traditional defect detection systems answer:
Is the product defective?
Quality engineers typically require additional context:
Which machine produced it?
Which supplier provided the materials?
Have similar defects occurred before?
Are there recurring defect patterns?
What actions should be investigated?
This project combines manufacturing telemetry, traceability data, graph analytics, and LLM reasoning to generate explainable investigation reports.
System Architecture
AI4I Telemetry Dataset
+
MVTec Transistor Dataset
+
Synthetic Traceability Data
↓
Data Integration Pipeline
↓
Manufacturing Dataset
↓
Neo4j Knowledge Graph
↓
Neo4j Graph Data Science
↓
FastAPI + MCP Server
↓
LLM Investigation Agent
↓
Investigation ReportCore Components
Knowledge Graph
Manufacturing entities are represented as graph nodes.
Node Types
ProductCase
Machine
Supplier
Batch
MaterialLot
Operator
Shift
ProductionLine
Defect
FailureType
Document
Relationships
(ProductCase)-[:PRODUCED_BY]->(Machine)
(ProductCase)-[:SUPPLIED_BY]->(Supplier)
(ProductCase)-[:BELONGS_TO_BATCH]->(Batch)
(ProductCase)-[:HAS_DEFECT]->(Defect)
(ProductCase)-[:EXHIBITS_FAILURE]->(FailureType)
(ProductCase)-[:WORKED_IN_SHIFT]->(Shift)
(ProductCase)-[:MENTIONED_IN]->(Document)Graph Analytics
Implemented using Neo4j Graph Data Science.
Related MCP server: GrACE-MCP
PageRank Centrality
Identifies machines that are most influential within the manufacturing network.
Endpoint:
GET /analytics/centralityExample Insight:
Machine M5 exhibits the highest centrality score.Louvain Community Detection
Groups machines and suppliers with similar manufacturing behavior.
Endpoint:
GET /analytics/communitiesExample Insight:
Machines and suppliers within the same community
share similar defect patterns.Graph Machine Learning
Node Classification
Uses Neo4j GDS Node Classification Pipeline.
Workflow:
ProductCase Nodes
↓
FastRP Embeddings
↓
Logistic Regression
↓
Defect ClassificationTraining Endpoint:
POST /ml/trainPrediction Endpoint:
GET /ml/predict/{uid}FastRP Embeddings
Generates graph embeddings for ProductCase nodes.
Endpoint:
POST /ml/embeddingsEmbedding Size:
64 dimensionsStored as:
pc.embeddingSimilar Case Retrieval
Uses cosine similarity between FastRP embeddings.
Example:
MATCH (target:ProductCase)
MATCH (other:ProductCase)
WITH target, other,
gds.similarity.cosine(
target.embedding,
other.embedding
) AS similarityEndpoint:
GET /ml/similar/{uid}Purpose:
Historical defect comparison
Similar case retrieval
Context-aware investigations
Text-to-Cypher
Natural language queries are converted into Cypher using a local LLM.
Example:
Which machines have the highest defect rates?Generated Query:
MATCH ...
RETURN ...Endpoint:
POST /text-to-cypherGraph Builder
Documents can be ingested into the Knowledge Graph.
Supported Examples:
Maintenance logs
SOP documents
Engineering reports
Endpoint:
POST /ingest-documentGenerated Knowledge:
Machine
↓
MENTIONED_IN
↓
DocumentMCP Investigation Agent
The MCP server exposes graph operations as tools.
Examples:
get_case_context
find_similar_cases
calculate_machine_centrality
detect_defect_communities
text_to_cypher
The LLM agent invokes these tools to collect evidence and generate investigation reports.
Example Investigation Workflow
UID000001
↓
Retrieve Context
↓
Find Similar Cases
↓
Analyze Graph Patterns
↓
Collect Evidence
↓
Generate Investigation ReportExample Report Sections:
Case Summary
Evidence
Hypothesis
Recommendations
REST API
Data
POST /syncInvestigation
POST /investigate/{uid}Graph Analytics
GET /analytics/centrality
GET /analytics/communitiesGraph Machine Learning
POST /ml/train
POST /ml/embeddings
GET /ml/predict/{uid}
GET /ml/similar/{uid}Knowledge Graph Querying
POST /text-to-cypherGraph Builder
POST /ingest-documentTechnology Stack
FastAPI
Neo4j
Neo4j Graph Data Science
MCP
Ollama
Qwen 2.5
Python
Docker
PatchCore
OpenCV
Project Goal
This project demonstrates how Knowledge Graphs, Graph Analytics, Graph Machine Learning, MCP, and LLM Agents can be combined to transform manufacturing defect detection into explainable manufacturing investigations.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/darrellathaya/manufacturing-defect-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server