OWL MCP Server
The OWL MCP Server enables AI assistants to directly query, modify, and reason over OWL/TTL/RDF ontology files, abstracting away complex syntax like SPARQL.
Load & Save
Load ontologies from local paths or IRIs (TTL, OWL, RDF formats)
Save changes in RDF/XML, Turtle, or N-Triples format
Query & Explore
Get ontology overview (class, individual, and property counts; namespaces)
List classes, individuals, and properties with optional filters/limits
Describe a specific class (parent/child classes, restrictions, equivalents, individuals) or individual (types, property values)
Search entities by keyword (fuzzy, case-insensitive)
Execute SPARQL 1.1 SELECT queries
Modify
Add new classes (with optional parent, rdfs:label, rdfs:comment)
Add new individuals (with associated class and property values)
Add object property assertions
Note: all modifications are in-memory until
save_ontologyis explicitly called
Reason
Run Pellet or HermiT reasoners to check ontology consistency and infer new knowledge (requires JDK 8+)
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., "@OWL MCP Server 描述BankStatement类的结构"
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.
🦉 OWL MCP Server
Let AI read and write your OWL / TTL / RDF ontology files directly
English | 简体中文
Quick Start · Tools · Examples
Introduction
OWL MCP Server is an ontology manipulation server built on the Model Context Protocol (MCP).
It lets AI assistants such as Claude, Cursor, and WorkBuddy query, modify, and reason over your OWL/TTL/RDF ontology files as easily as ordinary files — no hand-written SPARQL, no OWL syntax details; complex knowledge-graph operations done through natural-language conversation.
You: "Find all individuals of class XX, sorted by amount in descending order"
AI: [calls sparql_query] → returns structured resultsUse Cases
🏦 Finance: CRUD on bank-statement and invoice ontologies
🏥 Healthcare: exploration and reasoning over clinical knowledge graphs
🏗️ Engineering: management and validation of equipment and process ontologies
🎓 Research: rapid prototyping and testing of OWL ontologies
Related MCP server: Ontology MCP
Quick Start
Step 1: Install dependencies
pip install mcp owlready2 rdflibOr via requirements.txt:
pip install -r requirements.txt⚠️ Reasoners need Java:
run_reasoner(Pellet/HermiT) requires a local JDK 8+ installation.
Step 2: Configure your MCP client
WorkBuddy
Add to ~/.workbuddy/mcp.json:
{
"mcpServers": {
"owl": {
"command": "python",
"args": ["/absolute/path/server.py"]
}
}
}💡 Recommended: use the absolute path of a virtualenv Python to avoid dependency conflicts:
"command": "C:/Users/yourname/.workbuddy/binaries/python/envs/default/Scripts/python.exe"
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"owl-mcp": {
"command": "python",
"args": ["/absolute/path/server.py"]
}
}
}Cursor
Add the same configuration to .cursor/mcp.json, restart Cursor, and the server is available in Agent mode.
Step 3: Enable it and start talking
In the WorkBuddy connector management page, find owl, click Trust to enable it, then just chat in natural language:
"Load the ontology file C:/work/xxxx.ttl"
"List all classes, only the ones starting with xxx:"
"Describe the full structure of the BankStatement class"
"Run the HermiT reasoner to check ontology consistency"
"Save the new classes back to the original file"Tools
📖 Query tools
Tool | Description |
| Load an ontology file (local path or IRI; formats: TTL / OWL / RDF) |
| Get an overview (counts of classes, individuals, properties; namespaces) |
| List all classes, with prefix filtering and limit |
| List all individuals, optionally filtered by class |
| List object properties / data properties |
| Describe a class in detail (parents, children, restrictions, known individuals) |
| Describe an individual (types and all property values) |
| Fuzzy-search classes / individuals / properties by keyword |
| Run a SPARQL 1.1 SELECT query |
✏️ Modification tools
Tool | Description |
| Add a new class (with optional parent, rdfs:label, rdfs:comment) |
| Add a new individual (with optional initial property values) |
| Add an object-property triple assertion |
| Save the ontology (rdfxml / turtle / ntriples) |
🧠 Reasoning tools
Tool | Description |
| Run a reasoner (Pellet or HermiT) to check consistency and infer implicit knowledge |
Note:
add_*operations are not saved automatically — callsave_ontologyexplicitly.
Examples
Exploring the ontology structure
You: Load xxx.ttl and give me an overview
AI: This ontology has 47 classes, 213 individuals, 18 object properties...
You: Describe the BankStatement class
AI: BankStatement is a subclass of FinancialDocument, with the following data
properties: amount, currency, date...SPARQL queries
-- Find all BankStatement individuals and their amounts (descending)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://test.com/t#>
SELECT ?ind ?amount WHERE {
?ind rdf:type :BankStatement .
?ind :amount ?amount .
}
ORDER BY DESC(?amount)Incremental modification
You: Add a new class AA whose parent is BB, with label "CC"
AI: [calls add_class] → class AA added
You: Save the change in turtle format
AI: [calls save_ontology] → saved to xxx.ttlConsistency checking
You: Run the HermiT reasoner and check the ontology for logical contradictions
AI: [calls run_reasoner] → the ontology is consistent; 3 new implicit class
memberships were inferred...Tech Stack
Component | Purpose |
OWL ontology loading, modification, reasoner invocation | |
SPARQL 1.1 query engine | |
Model Context Protocol SDK |
Notes
Reasoners need Java: Pellet / HermiT depend on JDK 8+; make sure
javais on your system PATHLarge ontologies: beyond ~100k triples, use the
limitparameter with thelist_*toolsChanges are not auto-saved: all
add_*operations only update the in-memory model; callsave_ontologyexplicitlySPARQL syntax: standard SPARQL 1.1, executed by the rdflib engine
Compatible MCP Clients
✅ WorkBuddy
✅ Trae/Traw-work
✅ Claude
✅ Cursor (Agent mode)
✅ Any MCP-compliant AI client
License
☕ Buy Me a Coffee
OWL MCP Server is an open-source project I develop and maintain in my spare time, and it will stay free forever.
If it has saved you even half an hour of hand-writing SPARQL, consider buying me a coffee (¥9.9 is enough ☕) — every bit of support goes straight into new features and bug fixes.
Prefer not to donate? Giving the project a ⭐ Star, opening an Issue, or sharing it with someone who needs it is equally great support!
Available Tools
14 toolsadd_classA
向本体添加一个新类,可指定父类、标签和注释。修改不会自动保存,需调用 save_ontology。
Inputs: class_name (required), label, comment, parent_class.
add_individualA
向本体添加一个新个体,并指定所属类。修改不会自动保存,需调用 save_ontology。
Inputs: class_name (required), individual_name (required), properties.
add_object_property_assertionA
为个体添加对象属性断言(subject --property--> object)。修改不会自动保存,需调用 save_ontology。
Inputs: object (required), subject (required), property (required).
describe_classA
描述一个类:父类、子类、等价类、限制条件、所有个体。
Inputs: class_name (required).
describe_individualA
描述一个个体:所属类、属性值(数据属性和对象属性)。
Inputs: individual_name (required).
get_ontology_infoB
获取当前加载本体的基本信息:IRI、类数量、个体数量、属性数量等。
Inputs: no named parameters.
list_classesA
列出本体中所有类(OWL Class)。可选按名称前缀过滤。
Inputs: limit, prefix.
list_individualsA
列出本体中所有个体(OWL Individual)。可选按类名过滤。
Inputs: limit, class_name.
list_propertiesB
列出本体中所有对象属性(ObjectProperty)和数据属性(DataProperty)。
Inputs: prop_type.
load_ontologyA
加载一个 OWL/TTL/RDF 本体文件(本地路径或 IRI)。后续所有操作都在这个本体上进行。
Inputs: path (required).
run_reasonerA
运行推理器(Pellet 或 HermiT)对本体进行推理,检查一致性并推断隐含知识。需要本机安装 JDK 8+。
Inputs: reasoner.
save_ontologyA
将当前本体(含所有未保存的修改)保存到文件。
Inputs: path, format.
search_entityA
按名称关键词搜索类、个体、属性(大小写不敏感模糊匹配)。
Inputs: keyword (required), limit.
sparql_queryA
对当前本体执行 SPARQL SELECT 查询,返回结果列表。
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose: loading, saving, listing, describing, adding, searching, reasoning, and querying. No two tools overlap in functionality.
Most tool names follow a <verb>_<noun> pattern (e.g., add_class, describe_individual). The exception is sparql_query, which uses noun_noun, but it's still consistent with the underscore convention and clearly understandable.
14 tools is well-scoped for an ontology server, covering essential operations without being overwhelming or too sparse.
Missing delete and update operations for classes, individuals, and properties. Only object property assertions can be added, not data property assertions or property definitions. However, core loading, saving, listing, describing, reasoning, and querying are present.
Related MCP Connectors
Query, explore, and manage your databases through natural conversation.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Personal wiki and memory layer for AI assistants. Persistent, structured memory across sessions.
Knowledge graph ingestion, entity search, ontology analysis, and CoSync scoring.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn improved implementation of persistent memory using a local knowledge graph with a customizable --memory-path. This lets Claude remember information about the user across chats.10887MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that connects GraphDB's SPARQL endpoints and Ollama models to Claude, enabling Claude to query and manipulate ontology data while leveraging various AI models.283MIT
- FlicenseNot gradedqualityDmaintenanceA Model-Context-Protocol server that enables AI assistants to create, edit, and manage Web Ontology Language (OWL) ontologies through function calls using OWL functional syntax.22-
- AlicenseAqualityDmaintenanceEnables creating, managing, analyzing, and visualizing knowledge graphs with support for multiple graph types (topology, timelines, changelogs, requirements, knowledge bases, ontologies) including node/edge management and resource association.1520 npm1MIT