Knowledge Graph MCP Server
Supports Markdown as a resource type for knowledge graph nodes, enabling storage and management of Markdown documents within the knowledge graph structure.
Supports SVG as a resource type for knowledge graph nodes, enabling storage and management of SVG visualizations and graphics within the knowledge graph structure.
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., "@Knowledge Graph MCP Server create a timeline graph for our project milestones"
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.
Knowledge Graph MCP Server
A Model Context Protocol (MCP) service for creating, managing, analyzing, and visualizing knowledge graphs. This service fully complies with the MCP standard and seamlessly integrates with MCP-compatible AI assistants (such as Claude).
Core Features
Multiple Graph Types: Support for topology structures, timelines, changelogs, requirement documents, knowledge bases, ontologies, and more
Complete Error Handling: Clear error messages and handling suggestions for common issues
Resource Management: Support for SVG and Markdown resource association and management
Version Status: Support for multiple status management including draft, published, and archived
Related MCP server: GID MCP Server
Installation & Configuration
Installing via Smithery
To install knowledge-graph-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @aiuluna/knowledge-graph-mcp --client claudeRequirements
Node.js >= 16.0.0
pnpm >= 7.0.0
Configure Knowledge Graph Directory
Create a directory to store knowledge graph data, for example:
mkdir ~/knowledge_graphUsage in Cursor
Add the following configuration to your Cursor config file:
{
"mcpServers": {
"knowledge-graph": {
"command": "npx",
"args": [
"-y",
"@aiuluna/knowledge-graph-mcp"
],
"env": {
"KNOWLEDGE_GRAPH_DIR": "/path/to/your/knowledge_graph/dir"
}
}
}
}Note:
Replace
KNOWLEDGE_GRAPH_DIRwith your actual knowledge graph storage directory pathYou can specify a particular version number, such as
@0.0.1
Usage in Claude Desktop
Add the following configuration to claude_desktop_config.json:
{
"mcpServers": {
"knowledge-graph": {
"command": "npx",
"args": [
"-y",
"@aiuluna/knowledge-graph-mcp"
],
"env": {
"KNOWLEDGE_GRAPH_DIR": "/path/to/your/knowledge_graph/dir"
}
}
}
}Prompt Usage Guide
Project Structure
Prompt files are located in the /src/rules/prompts directory. Please copy these files to your Cursor and add them as default rules for Agent mode (refer to Cursor Rules Configuration):
.cursor/
└── rules/
└── graph-query.mdc # Knowledge graph query prompt fileUsing Agent Mode
When using Agent mode in Cursor, you can trigger knowledge graph queries by:
Type
/ckcommand in the editorThe Agent will automatically invoke the prompt defined in
@graph-query.mdcThe prompt will:
Analyze current context
Query relevant knowledge graph nodes
Generate summary content
Integrate query results into the conversation
Other Rules
The project also includes prompts for generating hand-drawn style graphics and Markdown documents as knowledge graph resources. Since Cursor doesn't support the MCP standard for prompts, this project uses tools to obtain these rules. You can also integrate them into Cursor's rules like above and modify them to your desired style for use in Cursor Agent mode.
Tool List
Graph Management
create_graphCreate a new knowledge graph
Parameters:
name(string): Graph namedescription(string, optional): Graph descriptiontype(string): Graph type (topology/timeline/changelog/requirement/kb/ontology)
list_graphsList all knowledge graphs
Parameters:
status(string, optional): Filter by status (draft/published/archived)type(string, optional): Filter by type
publish_graphPublish a knowledge graph
Parameters:
graphId(string): Graph ID
Node Management
add_nodeAdd a node to the graph
Parameters:
graphId(string): Graph IDtype(string): Node typename(string): Node namedescription(string, optional): Node descriptionfilePath(string, optional): Associated file pathmetadata(object, optional): Node metadata
update_nodeUpdate node information
Parameters:
graphId(string): Graph IDnodeId(string): Node IDname(string, optional): New node namedescription(string, optional): New node descriptionfilePath(string, optional): New file pathmetadata(object, optional): New metadata
delete_nodeDelete a node
Parameters:
graphId(string): Graph IDnodeId(string): Node IDconfirmDelete(boolean): Delete confirmation
get_node_detailsGet detailed node information
Parameters:
graphId(string): Graph IDnodeId(string): Node ID
Edge Management
add_edgeAdd an edge
Parameters:
graphId(string): Graph IDtype(string): Edge typesourceId(string): Source node IDtargetId(string): Target node IDlabel(string, optional): Edge labelweight(number, optional): Edge weightmetadata(object, optional): Edge metadata
update_edgeUpdate edge information
Parameters:
graphId(string): Graph IDedgeId(string): Edge IDlabel(string, optional): New edge labelweight(number, optional): New edge weightmetadata(object, optional): New metadata
delete_edgeDelete an edge
Parameters:
graphId(string): Graph IDedgeId(string): Edge IDconfirmDelete(boolean): Delete confirmation
Resource Management
get_creation_guidelinesGet resource creation guidelines
Parameters:
type(string): Guideline type (svg/markdown/all)
save_resourceSave a resource
Parameters:
graphId(string): Graph IDnodeId(string, optional): Associated node IDresourceType(string): Resource type (svg/markdown)title(string): Resource titledescription(string, optional): Resource descriptioncontent(string): Resource content
update_resourceUpdate resource information
Parameters:
graphId(string): Graph IDresourceId(string): Resource IDname(string, optional): New resource nametitle(string, optional): New resource titledescription(string, optional): New resource description
delete_resourceDelete a resource
Parameters:
graphId(string): Graph IDresourceId(string): Resource IDconfirmDelete(boolean): Delete confirmation
unlink_resourceUnlink a resource from a node
Parameters:
graphId(string): Graph IDnodeId(string): Node IDresourceId(string): Resource ID
Development
# Install dependencies
pnpm install
# Development mode
pnpm dev
# Build project
pnpm build
# Run tests
pnpm test
# Code check
pnpm lintError Handling
The service uses a standard error handling mechanism. All errors are logged to the md/error_log.txt file, including timestamps, error messages, and stack traces.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
15 toolsadd_edgeA
Add edges in the knowledge graph, connecting two nodes to build a relationship network. Edges represent relationship types between nodes, such as dependencies, containment, associations, etc. Prerequisites:
Must first create a graph (using create_graph)
Source and target nodes must already exist
Edge type must match the graph type
Usage recommendations:
First use list_graphs to get graph and node information
Confirm both source and target nodes exist and their types match
Choose appropriate edge type based on graph type
Add meaningful labels to edges to help understand relationships
If relationships have varying strengths, use the weight parameter
Return data:
data: Newly created edge information
id: Edge ID
type: Edge type
sourceId: Source node ID
targetId: Target node ID
label: Edge label
weight: Edge weight
Inputs: graphId (required), type (required), sourceId (required), targetId (required), +2 more.
add_nodeA
Add a node to the knowledge graph. Nodes are the basic units of the graph, and different types of graphs support different types of nodes. Use cases:
Create component or module nodes in topology graphs
Add event or decision nodes in timeline graphs
Create requirement or feature nodes in requirement documents
Build concept hierarchies in knowledge bases
Usage recommendations:
First create the graph using create_graph
Select the appropriate node type based on graph type
Provide meaningful names and descriptions
Link related files when applicable
Add metadata for additional structured information
Return data:
data: Created node information
id: Node ID
type: Node type
name: Node name
description: Node description
createdAt: Creation time
Inputs: graphId (required), type (required), name (required), description, +2 more.
create_graphA
Create a new knowledge graph. Supports multiple graph types such as topology, timeline, changelog, requirement documentation, etc. Design guidelines for each graph type:
topology: Used to represent dependencies between system components and modules. Recommended to first create main module nodes, then add component nodes, and finally represent relationships through edges like calls, dependencies, and containment
timeline: Used to record important project events and decisions. Recommended to add event nodes in chronological order and link related personnel and decisions
changelog: Used to track change history of features and components. Recommended to create nodes for each significant change, marking change types and impact scope
requirement: Used for requirement management and tracking. Recommended to first create high-level requirements, then break down into specific features, and finally link to responsible persons and iterations
knowledge_base: Used to build domain knowledge systems. Recommended to start from core concepts and gradually expand related concepts and relationships
ontology: Used for formal representation of domain concepts and relationships, suitable for building standardized knowledge models
Inputs: name (required), description, type.
delete_edgeA
Delete edges from the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools, and the operation cannot be undone. Use cases:
Delete incorrectly created relationships
Update relationship structure between nodes
Clean up redundant relationships when restructuring the graph
Usage recommendations:
First call list_graphs to get target graph information
Use get_node_details to get edge details
Confirm deletion won't break important relationship structures
Set confirmDelete to true to confirm deletion
Important notes:
Deleting edges won't affect related nodes
Need to call get_node_details again to view updated relationships
Return data:
data: Deletion result
id: Deleted edge ID
deletedAt: Deletion time
Inputs: graphId (required), edgeId (required), confirmDelete (required).
delete_nodeA
Delete nodes from the knowledge graph. This tool must be used in conjunction with list_graphs tool, and the operation cannot be undone. Use cases:
Delete incorrectly created nodes
Delete nodes that are no longer needed
Delete redundant nodes when restructuring the graph
Usage recommendations:
First call list_graphs to get target graph and node information
Use get_node_details to check node's associated resources and relationships
Confirm deletion won't affect other important nodes
Set confirmDelete to true to confirm deletion
Recommended to backup important data before deletion
Important notes:
Deleting a node will also delete all edges related to that node
If the node has associated resources, they won't be deleted but will be unlinked
Return data:
data: Deletion result
id: Deleted node ID
name: Node name
type: Node type
deletedAt: Deletion time
Inputs: graphId (required), nodeId (required), confirmDelete (required).
delete_resourceA
Delete resources from the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools, and the operation cannot be undone. Use cases:
Delete outdated resource files
Clean up unnecessary documents
Remove incorrectly created resources
Usage recommendations:
First call list_graphs to get target graph information
Use get_node_details to confirm resource associations
Confirm deletion won't affect other nodes
Set confirmDelete to true to confirm deletion
Recommended to backup important resources before deletion
Important notes:
Deleting a resource will also delete the physical file
Will automatically unlink from all nodes
This operation cannot be recovered
Return data:
data: Deletion result
id: Deleted resource ID
type: Resource type
deletedAt: Deletion time
Inputs: graphId (required), resourceId (required), confirmDelete (required).
get_creation_guidelinesA
Get creation guidelines and standards for SVG graphics and Markdown documents. This tool is a prerequisite for the save_resource tool and must be called before creating and saving any resources. Use cases:
Get drawing standards before creating SVG visualizations
Get format requirements before creating Markdown documents
Get complete guidelines before batch resource creation
Usage recommendations:
Call this tool before starting any resource creation
Carefully read and follow the naming rules and directory structure
Create resources according to guidelines, then use save_resource tool
Recommended to save guidelines for team reference
Return data:
data: Guidelines content
guidelines: Guidelines text content
File naming rules
Directory structure requirements
Format specifications
Style guide
type: Guidelines type (svg/markdown/all)
version: Guidelines version
Inputs: type (required).
get_node_detailsA
Get detailed information about a specific node in the graph. This tool must be used in conjunction with the list_graphs tool, as the nodeId must be obtained from the list_graphs response. Use cases:
View complete node attributes
Check associated resources (SVG/Markdown)
Analyze node relationships with others
Check current state before modifying a node
Usage recommendations:
First call list_graphs to get the node list of the target graph
Get the required nodeId from the returned nodes array
Use the obtained graphId and nodeId to call this tool
Check the returned relationship data to determine if further action is needed
Return data:
data: Node details
id: Node ID
name: Node name
type: Node type
description: Node description
filePath: Associated file path
metadata: Node metadata
resources: Associated resource list
id: Resource ID
type: Resource type (svg/markdown)
title: Resource title
relationships: Relationship list
id: Edge ID
type: Edge type
targetNode: Target node information
Inputs: graphId (required), nodeId (required).
list_graphsA
List all knowledge graphs with support for filtering by status and type. This is the main tool for getting information about existing graphs and an important path for obtaining node IDs. Use cases:
View all available graphs and their basic information
Get the node list of a specific graph for subsequent edge addition or node detail queries
Filter graphs by status, such as viewing all drafts or published graphs
Filter graphs by type, such as viewing only topology or timeline graphs
Usage recommendations:
First call this tool to get the graph list and node information
Get the required graph ID and node ID from the returned data
Use these IDs to call other tools (like add_edge, get_node_details)
Recommended to use this tool to confirm the target graph's status before performing any node or edge operations
Return data:
data: List of graphs, each graph contains:
id: Graph ID (used for graphId parameter in other tools)
name: Graph name
description: Graph description
type: Graph type
status: Graph status
nodesCount: Number of nodes
edgesCount: Number of edges
createdAt: Creation time
updatedAt: Update time
publishedAt: Publication time (if published)
nodes: Node list, each node contains:
id: Node ID (used for add_edge and get_node_details tools)
name: Node name
type: Node type
Inputs: status, type.
publish_graphA
Publish a knowledge graph, changing its status from draft to published. Published graphs can still be modified, but it's recommended to track important changes through version management. Prerequisites:
Graph must exist and be in draft status
Recommended to ensure graph content is complete before publishing
Ensure all necessary nodes and edges have been added
Usage recommendations:
First use list_graphs to check the current status of the graph
Use get_node_details to check the completeness of key nodes
Review the graph structure before publishing
Record publication time for version management
Notify relevant team members after publication
Return data:
data: Published graph information
id: Graph ID
name: Graph name
type: Graph type
status: Published
publishedAt: Publication time
Inputs: graphId (required).
save_resourceA
Save AI-generated SVG graphics or Markdown documents to the knowledge graph. This tool must be used in conjunction with get_creation_guidelines and list_graphs tools. Use cases:
Save SVG visualization representation of the graph
Save Markdown documents related to nodes
Batch save multiple resource files
Usage recommendations:
First call get_creation_guidelines to get resource creation standards
Use list_graphs to get target graph ID and node ID (if needed)
Create resource content according to standards
Use this tool to save the resource
After saving, use get_node_details to check resource association status
Return data:
data: Saved resource information
id: Resource ID
type: Resource type (svg/markdown)
title: Resource title
description: Resource description
nodeId: Associated node ID (if any)
createdAt: Creation time
Inputs: graphId (required), resourceType (required), title (required), content (required), +2 more.
unlink_resourceA
Unlink resource associations from nodes. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:
Adjust resource associations
Remove incorrect resource associations
Reorganize node resource structure
Usage recommendations:
First call list_graphs to get target graph information
Use get_node_details to view node's resource associations
Confirm unlinking won't affect other functionality
Record changes for potential re-association
Important notes:
Only removes association, does not delete resource
Resource can still be used by other nodes
Association can be re-established at any time
Return data:
data: Operation result
resourceId: Resource ID
nodeId: Node ID
unlinkedAt: Time when association was removed
Inputs: graphId (required), nodeId (required), resourceId (required).
update_edgeA
Modify edges in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:
Update edge label information
Adjust edge weight values
Update edge metadata information
Usage recommendations:
First call list_graphs to get target graph information
Use get_node_details to view edge list of related nodes
Only update fields that need to be modified, keep others unchanged
After updating, call get_node_details again to confirm changes
Return data:
data: Updated edge information
id: Edge ID
type: Edge type
sourceId: Source node ID
targetId: Target node ID
label: Edge label
weight: Edge weight
metadata: Edge metadata
updatedAt: Update time
Inputs: graphId (required), edgeId (required), label, weight, +1 more.
update_nodeA
Modify nodes in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:
Update basic node information (name, description, etc.)
Update file paths associated with nodes
Update node metadata information
Usage recommendations:
First call list_graphs to get target graph and node ID
Use get_node_details to check current node status
Only update fields that need to be modified, keep others unchanged
After updating, call get_node_details again to confirm changes
Return data:
data: Updated node information
id: Node ID
name: Node name
type: Node type
description: Node description
filePath: Associated file path
metadata: Node metadata
updatedAt: Update time
Inputs: graphId (required), nodeId (required), name, description, +2 more.
update_resourceA
Update resource information in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:
Modify resource title or description
Update resource metadata information
Improve resource documentation
Usage recommendations:
First call list_graphs to get target graph information
Use get_node_details to check current resource information
Only update fields that need to be modified
Maintain consistency in resource naming
Return data:
data: Updated resource information
id: Resource ID
name: Resource name
title: Resource title
description: Resource description
updatedAt: Update time
Inputs: graphId (required), resourceId (required), name, title, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose targeting specific graph elements (nodes, edges, graphs, resources) with precise actions (add, delete, update, list, get). No overlap exists; for example, delete_edge, delete_node, and delete_resource handle different entities, and update tools are clearly separated by target. The descriptions reinforce these distinctions, making misselection unlikely.
All tool names follow a consistent verb_noun pattern with snake_case throughout, such as add_edge, list_graphs, update_node, and get_node_details. The verbs (add, create, delete, get, list, publish, save, unlink, update) are used predictably across similar operations, enhancing readability and predictability for agents.
With 15 tools, the count is well-scoped for a knowledge graph management server, covering CRUD operations for graphs, nodes, edges, and resources, plus auxiliary tools like publish_graph and get_creation_guidelines. Each tool earns its place by addressing specific needs in graph lifecycle management, avoiding redundancy while ensuring comprehensive coverage.
The tool set provides complete CRUD/lifecycle coverage for knowledge graphs, including creation (create_graph), modification (add/update/delete for nodes, edges, resources), querying (list_graphs, get_node_details), and publishing (publish_graph). No obvious gaps exist; tools like get_creation_guidelines and unlink_resource address nuanced needs, ensuring agents can handle all typical workflows without dead ends.
Related MCP Connectors
AI knowledge graph for architecture, portfolio, and digital strategy management.
Knowledge graph ingestion, entity search, ontology analysis, and CoSync scoring.
Knowledge coverage map and health score. Ingest docs into a governed knowledge graph via MCP.
Knowledge graph for AI agents. Query concepts, walk edges, get advisories.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables storage and retrieval of knowledge in a graph database format, allowing users to create, update, search, and delete entities and relationships in a Neo4j-powered knowledge graph through natural language.5-
- AlicenseAqualityDmaintenanceEnables AI to analyze, query, and manage a graph-based representation of software architecture for impact analysis, dependency tracking, and design.201AGPL 3.0
- AlicenseBqualityCmaintenanceEnables building and querying vector-based knowledge graphs with node and edge management and semantic search.53 npm28 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables sophisticated reasoning workflows using graph-based representations for AI models.12Apache 2.0