MCP.so
Sign In

KnowledgeGraph MCP Server

@n-r-w

About KnowledgeGraph MCP Server

MCP server for enabling persistent knowledge storage for Claude through a knowledge graph with multiple storage backends and fuzzy search

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "knowledgegraph-mcp": {
      "command": "npx",
      "args": [
        "knowledgegraph-mcp",
        "--help"
      ]
    }
  }
}

Tools

11

SEARCH ENTITIES by TEXT or TAGS across names, types, observations, and tags. Supports exact/fuzzy search modes, multiple query batching, tag filtering, and pagination. Returns entities and their relationships. MUST USE BEFORE create_entities, add_observations, and create_relations to verify entity existence. PAGINATION: Use page parameter to navigate large result sets (page=0 for first page, page=1 for second, etc.).

CREATE new entities with OBSERVATIONS and optional tags. MANDATORY: If creating multiple entities, use a SINGLE call (batch). Each entity requires a unique name, type, and at least one observation. Ignores existing names. Use search_knowledge first.

ADD new factual observations to existing entities. Requires exact entity names that exist in the knowledge graph. Use search_knowledge first to verify entity existence.

CREATE directional RELATIONSHIPS between existing entities. Both source and target entities must exist. Use active voice relationship types (e.g., 'works_at', 'manages', 'depends_on'). Verify entity existence with search_knowledge first.

Permanently DELETE entities and all their RELATIONSHIPS. This action is irreversible and cascades to remove all connections. Verify entity existence with search_knowledge first. Consider delete_observations for partial updates.

DELETE specific OBSERVATIONS from entities while preserving the entity, its relationships, and tags. Use for correcting errors or removing outdated facts without deleting the entire entity.

DELETE specific RELATIONSHIPS between entities while preserving both entities. Use for updating connection status when relationships change (job changes, project completion, etc.).

RETRIEVE the complete KNOWLEDGE GRAPH with all entities and relationships for a project. Returns comprehensive view of the entire network structure. Can be large for projects with many entities.

RETRIEVE specific ENTITIES by exact names along with their interconnections. Returns detailed information about the specified entities and relationships between them. Requires knowing exact entity names.

ADD categorical TAGS to existing entities for filtering and organization. Tags are case-sensitive exact-match labels used for quick retrieval with search_knowledge. Common categories: status, priority, type, domain.

REMOVE specific TAGS from existing entities to maintain accurate categorization. Use for status updates, priority changes, or cleaning up outdated classifications. Tags must match exactly (case-sensitive).

Overview

What is KnowledgeGraph MCP Server?

KnowledgeGraph MCP Server gives LLMs persistent memory across conversations by storing and retrieving information via a knowledge graph. It lets Claude or VS Code remember user preferences, project details, and personal data using structured entities, relations, observations, and tags.

How to use KnowledgeGraph MCP Server?

Install the server via npx (npx knowledgegraph-mcp --help) or Docker (build from source). Choose SQLite (default, no setup) or PostgreSQL. Configure your client (Claude Desktop or VS Code) by adding the server definition to the MCP configuration file, optionally setting environment variables for storage type, connection strings, and search limits. Restart the client and test with commands like “Remember that I prefer morning meetings.”

Key features of KnowledgeGraph MCP Server

  • Multiple storage backends: PostgreSQL (recommended) or SQLite (local file)
  • Project separation: keep different projects isolated
  • Better search: fuzzy search and pagination
  • Entities, relations, observations, and tags for rich knowledge modeling
  • Performance optimizations: entity loading limits and chunked processing
  • Comprehensive input validation to prevent errors

Use cases of KnowledgeGraph MCP Server

  • Remember user preferences (e.g., meeting times) across conversations
  • Store and query project-related information (team members, technologies, deadlines)
  • Track team structures with relations (e.g., “who leads which project”)
  • Filter entities by tags for urgent or status-based queries
  • Search for people, companies, or tasks using fuzzy matching

FAQ from KnowledgeGraph MCP Server

What storage backends are supported?

The server supports SQLite (default, no setup needed) and PostgreSQL (recommended for production with multiple concurrent users).

How do I configure the server for PostgreSQL?

Set the environment variables KNOWLEDGEGRAPH_STORAGE_TYPE=postgresql and KNOWLEDGEGRAPH_CONNECTION_STRING to your PostgreSQL connection string. Ensure the database knowledgegraph exists before starting.

Can I use the server with VS Code?

Yes. Add the server configuration to your VS Code User Settings (JSON) or .vscode/mcp.json using the same commands and environment variables as for Claude Desktop.

What environment variables control search behavior?

Variables include KNOWLEDGEGRAPH_SEARCH_MAX_RESULTS (default 100), KNOWLEDGEGRAPH_SEARCH_BATCH_SIZE (default 10), KNOWLEDGEGRAPH_SEARCH_MAX_CLIENT_ENTITIES (default 10000), and KNOWLEDGEGRAPH_SEARCH_CLIENT_CHUNK_SIZE (default 1000). All are clamped to safe ranges automatically.

Does the server automatically create the database?

For SQLite, the database file is created automatically in ~/.knowledge-graph/knowledgegraph.db. For PostgreSQL, you must create the knowledgegraph database manually before use.

Frequently asked questions

What storage backends are supported?

The server supports SQLite (default, no setup needed) and PostgreSQL (recommended for production with multiple concurrent users).

How do I configure the server for PostgreSQL?

Set the environment variables `KNOWLEDGEGRAPH_STORAGE_TYPE=postgresql` and `KNOWLEDGEGRAPH_CONNECTION_STRING` to your PostgreSQL connection string. Ensure the database `knowledgegraph` exists before starting.

Can I use the server with VS Code?

Yes. Add the server configuration to your VS Code User Settings (JSON) or `.vscode/mcp.json` using the same commands and environment variables as for Claude Desktop.

What environment variables control search behavior?

Variables include `KNOWLEDGEGRAPH_SEARCH_MAX_RESULTS` (default 100), `KNOWLEDGEGRAPH_SEARCH_BATCH_SIZE` (default 10), `KNOWLEDGEGRAPH_SEARCH_MAX_CLIENT_ENTITIES` (default 10000), and `KNOWLEDGEGRAPH_SEARCH_CLIENT_CHUNK_SIZE` (default 1000). All are clamped to safe ranges automatically.

Does the server automatically create the database?

For SQLite, the database file is created automatically in `~/.knowledge-graph/knowledgegraph.db`. For PostgreSQL, you must create the `knowledgegraph` database manually before use.

Comments

More Other MCP servers