ontology-mcp
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., "@ontology-mcpWhy can't leosmab.admin login? Get the diagnostic descriptor."
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.
Login Query Agent — Ontology MCP & Knowledge Graph
A production-ready POC that uses an OWL/SHACL/SKOS Knowledge Graph + two MCP servers to route login-diagnosis queries across SQL Server and MongoDB, with conditional New Relic escalation.
Architecture at a Glance
User prompt (VS Code Copilot)
│
▼
ontology-mcp ──► Fuseki KG (Fuseki SPARQL)
│ returns: intent_id, entities,
│ validation_sequence, decision_rules
▼
data-mcp ──► SQL Server (UM_Users, UM_UserPartnermapping,
│ UM_UserMobileNumberVerified)
├──────► MongoDB (users collection — 9 projected fields)
├──────► SHACL Validator (7 shapes evaluated in order)
└──────► New Relic (only when all shapes pass — 2-step NRQL)Related MCP server: GrACE-MCP
Services Overview
Service | Type | Who starts it | Required for |
Apache Jena Fuseki | Local process | You (manual) | ontology-mcp to work |
| stdio child process | VS Code auto-spawns | KG / intent resolution |
| stdio child process | VS Code auto-spawns | DB queries + validation |
SQL Server | Remote/LocalDB | Already running | Data queries |
MongoDB | Remote server | Already running | Data queries |
New Relic | Cloud service | Always available | Escalation (all shapes pass) |
Only Fuseki requires a manual start. Both MCP servers are auto-spawned by VS Code.
Prerequisites
1. Java 11+
java -version2. Apache Jena Fuseki JAR
The JAR is excluded from git (54 MB). Download from jena.apache.org and place at:
infra/fuseki/fuseki-server.jar3. Python 3.12+
python --version4. Python dependencies
cd c:\Ontology
python -m pip install -r requirements.txt5. ODBC Driver for SQL Server
Download ODBC Driver 17 or 18 for SQL Server from Microsoft if not already installed.
6. VS Code with GitHub Copilot (Agent mode)
VS Code 1.99+ with the GitHub Copilot extension.
Step-by-Step Local Startup
Step 1 — Start Fuseki
cd c:\Ontology
java -jar infra\fuseki\fuseki-server.jar --config infra\fuseki\config\login-kg.ttlKeep this terminal open. Verify at http://localhost:3030.
Step 2 — Load the Knowledge Graph
Required on first run or after any schema/artifact change.
$env:PYTHONIOENCODING = "utf-8"
python scripts/kg/load_kg.py --schema login --version 1.0.0
python scripts/kg/promote.py --schema login --version 1.0.0Step 3 — Configure secrets
Copy .env.example to .env and fill in your values:
SQL_SERVER_HOST=your-server
SQL_SERVER_DATABASE=your-database
SQL_SERVER_TRUSTED_CONNECTION=yes
SQL_SERVER_ENCRYPT=yes
SQL_SERVER_TRUST_CERT=yes
MONGODB_URI=mongodb://your-host:27017
MONGODB_DATABASE=your-database
NEW_RELIC_API_KEY=NRAK-xxxxxxxxxxxxxxxxxxxx
NEW_RELIC_ACCOUNT_ID=your-account-id
NEW_RELIC_REGION=US
APP_ENV=prodStep 4 — Register both MCP servers
Create .vscode/mcp.json in the workspace root:
{
"servers": {
"ontology-mcp": {
"type": "stdio",
"command": "python",
"args": ["-m", "mcp_server.server"],
"cwd": "c:\\Ontology",
"env": {
"PYTHONPATH": "c:\\Ontology\\src",
"PYTHONIOENCODING": "utf-8"
}
},
"data-mcp": {
"type": "stdio",
"command": "python",
"args": ["-m", "mcp_server.diagnostic_server"],
"cwd": "c:\\Ontology",
"env": {
"PYTHONPATH": "c:\\Ontology\\src",
"PYTHONIOENCODING": "utf-8"
}
}
}
}Reload VS Code (Ctrl+Shift+P → Developer: Reload Window).
Full Diagnostic Flow (8 Tool Calls)
User: "testgdpr1235@gep.com can't reset password"
│
▼
① ontology-mcp / resolve_intent(prompt)
Fuseki SPARQL → KG returns intent_id, validation_sequence, decision_rules
│
▼ (agent extracts username; asks user if missing)
│
② data-mcp / query_sql_user(username)
SELECT from UM_Users → islocked, isactive, isdeleted, usertype, ...
│
③ data-mcp / query_sql_mobile_verification(username)
SELECT from UM_UserMobileNumberVerified → ismobilenumberverified
│
④ data-mcp / query_sql_partner_mappings(username)
SELECT from UM_UserPartnermapping → bpc, partnercode, isactive, contactcode
│
⑤ data-mcp / query_mongo_user(username)
db.users.find_one({...}, { 9 diagnostic fields }) → MongoDB document
│
⑥ data-mcp / validate_login_shapes(username, validation_sequence)
7 SHACL shapes evaluated in order → PASS/FAIL per shape
│
┌────┴──────────────────┐
violations all pass
│ │
report dr_003..dr_008 ⑦a data-mcp / query_newrelic_login_mfa(username)
(from KG rules) OR
⑦b data-mcp / query_newrelic_reset_password(username, email)
→ Transaction → Log per traceId (max 7 days)MCP Tools Reference
ontology-mcp — Knowledge Graph tools
Tool | Input | Returns |
|
| intent_id, entities, validation_sequence, decision_rules |
|
| Full column/field mapping for one entity |
|
| All supported intent patterns |
data-mcp — Data & diagnostic tools
Tool | Step | Source | Returns |
| 1a |
| Full user row + SQL executed |
| 1b |
| ismobilenumberverified + SQL |
| 1c |
| All mapping rows + active count |
| 1d |
| 9 projected fields + query |
| 2 | SQL + MongoDB | Per-shape PASS/FAIL + next_step |
| 3a | New Relic | Transaction + Log for |
| 3b | New Relic | Transaction + Log for 3 reset URIs |
Supported intents
Intent ID | Matches |
| "can't login", "login not working", "login failed" |
| "not receiving OTP", "SMS OTP not received" |
| "OTP email not received", "email OTP not coming" |
| "can't reset password", "reset link not received" |
| "account locked", "locked after multiple attempts" |
| "mobile OTP issue", "OTP on mobile not received" |
SHACL Shapes (evaluated in order)
Shape | Condition | Rule |
| isLocked=1 OR isActive=0 OR isDeleted=1 | dr_003 |
| isSystemUser=1 | dr_005 |
| userType=Buyer AND authenticationType=SSO | dr_006 |
| No active partner mapping | dr_004 |
| Supplier with no valid BPC | dr_007 |
| SQL vs MongoDB isMobileNumberVerified mismatch | dr_002 |
| SQL vs MongoDB partner mapping fields mismatch | dr_008 |
New Relic Query Structure (2-step)
Step 1: Transaction table (max 7 days ago)
/Account/Login → LoginUserName, traceId, RequiresTwoFactor, TwoFactorDetails
/Account/RecoverPassword → traceId, errorMessage, RecoveryUserName, RecoveryEmail
/Account/PreResetPassword → traceId, errorMessage, PreResetUserName
/Account/ResetPassword → LoginUserName, traceId, errorMessage
Step 2: Log table (per traceId from Step 1)
SELECT * FROM Log WHERE trace.id = '{traceId}' SINCE {transaction_timestamp}Artifact Regeneration
When any YAML schema file changes:
$env:PYTHONIOENCODING = "utf-8"
python scripts/generate/generate.py --schema login --version 1.0.0
python scripts/kg/load_kg.py --schema login --version 1.0.0
python scripts/kg/promote.py --schema login --version 1.0.0Project Structure
c:\Ontology\
├── src/
│ └── mcp_server/ # PYTHONPATH=c:\Ontology\src
│ ├── server.py # ontology-mcp entrypoint (KG tools)
│ ├── diagnostic_server.py # data-mcp entrypoint (DB/NR tools)
│ ├── connectors/
│ │ ├── sql_connector.py # pyodbc — UM_Users, UM_UserPartnermapping, ...
│ │ ├── mongo_connector.py # pymongo — users collection (projected)
│ │ └── newrelic_connector.py # NerdGraph GraphQL — 2-step NRQL
│ ├── diagnostics/
│ │ ├── data_fetcher.py # orchestrates SQL + MongoDB fetch
│ │ ├── shacl_validator.py # programmatic 7-shape evaluation
│ │ └── rule_engine.py # maps violations → rules, dispatches NR
│ ├── tools/
│ │ ├── resolve_intent.py # KG tool handler
│ │ ├── get_descriptor.py # KG tool handler
│ │ ├── list_intents.py # KG tool handler
│ │ ├── fetch_user_data.py # DB tool handlers (4 SQL/Mongo queries)
│ │ ├── validate_shapes.py # shape validation handler
│ │ ├── query_newrelic.py # New Relic tool handlers
│ │ └── diagnose_login.py # combined flow (legacy)
│ ├── kg/sparql_client.py
│ └── registry/schema_registry.py
│
├── ontology/
│ ├── schemas/
│ │ ├── registry.yaml
│ │ └── login/v1.0.0/
│ │ ├── login.yaml # root: imports + intents + rules + shapes
│ │ ├── shared/types.yaml
│ │ ├── shared/enums.yaml # AuthenticationTypeEnum, UserTypeEnum
│ │ ├── shared/subsets.yaml
│ │ └── entities/
│ │ ├── abstract_user.yaml
│ │ ├── user.yaml # SQL UM_Users
│ │ ├── partner_mapping.yaml # SQL UM_UserPartnermapping
│ │ ├── mobile_verification.yaml # SQL UM_UserMobileNumberVerified
│ │ └── user_document.yaml # MongoDB users (+ IsdCode, MongoPartnerMapping)
│ └── sparql/
│ ├── resolve_intent.sparql
│ ├── get_entity_descriptor.sparql
│ ├── list_intents.sparql
│ └── get_decision_rules.sparql
│
├── artifacts/login/v1.0.0/
│ ├── owl/login.owl.ttl
│ ├── shacl/login.shacl.ttl
│ ├── skos/login.skos.ttl
│ ├── rules/login.rules.ttl
│ ├── descriptors/login.descriptors.json
│ └── jsonld/login.context.jsonld + login.agent_template.json
│
├── scripts/
│ ├── generate/generate.py + gen_*.py + _yaml_loader.py
│ └── kg/load_kg.py + promote.py
│
├── infra/fuseki/
│ ├── fuseki-server.jar # not committed — download separately
│ ├── config/login-kg.ttl
│ └── data/ # TDB2 storage — gitignored
│
├── .vscode/mcp.json # MCP server registration (2 servers)
├── config/settings.yaml
├── .env / .env.example
├── requirements.txt
└── README.mdTroubleshooting
Error | Cause | Fix |
| Fuseki not running | Start Fuseki (Step 1) |
| Prompt not matching any pattern | Call |
| Wrong host/credentials in | Check |
| Missing dependency |
|
| Windows console encoding | Add |
Fuseki graphs empty | Fresh Fuseki start | Run load_kg.py + promote.py |
Daily Workflow
# 1. Start Fuseki
java -jar infra\fuseki\fuseki-server.jar --config infra\fuseki\config\login-kg.ttl
# 2. Load KG (only after schema or artifact changes)
$env:PYTHONIOENCODING = "utf-8"
python scripts/kg/load_kg.py --schema login --version 1.0.0
python scripts/kg/promote.py --schema login --version 1.0.0
# 3. Open VS Code — both MCP servers start automaticallyExtending the Schema
Add a new entity (new SQL table or MongoDB collection)
Create
ontology/schemas/login/v1.0.0/entities/new_entity.yamlAdd
- entities/new_entitytologin.yamlimportsRun generate + load + promote
Add a new schema version
Copy
ontology/schemas/login/v1.0.0/→v1.1.0/Edit entity files in
v1.1.0/Run generate + load + promote for
v1.1.0
Both versions coexist in the KG — rollback is always available.
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.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that enables LLMs to perform semantic and fulltext searches within Neo4j while executing complex, search-augmented Cypher queries for GraphRAG applications. It provides tools for database schema discovery and supports multi-provider embeddings to facilitate advanced graph traversals.52MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA knowledge graph MCP server that integrates Graphiti and the ACE framework for conversational management of Neo4j-based entities and relationships. It enables AI agents to perform semantic searches, manage data isolation, and utilize automatic learning strategies.2
- FlicenseCqualityDmaintenanceMCP server allowing AI agents to query New Relic for debugging incidents.2
- AlicenseAqualityBmaintenanceAn MCP server that ingests semiconductor PDFs into a Neo4j knowledge graph, enabling AI agents to query domain knowledge, verify claims against source text, and record design reasoning.35MIT
Related MCP Connectors
Official Microsoft MCP Server to query Microsoft Entra data using natural language
GibsonAI MCP server: manage your databases with natural language
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/JiteAgar-Code/ontology-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server