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.
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
Installation & Configuration
Installing via Smithery
To install knowledge-graph-mcp for Claude Desktop automatically via Smithery:
Requirements
Node.js >= 16.0.0
pnpm >= 7.0.0
Configure Knowledge Graph Directory
Create a directory to store knowledge graph data, for example:
Usage in Cursor
Add the following configuration to your Cursor config file:
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:
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):
Using 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
Error 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.
This server cannot be installed