KGLite MCP
KGLite keeps a knowledge graph in one file, and its bundled MCP server gives agents Cypher queries with no separate database.
- 77 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The MCP server reads the graph and, with `source_root` set, source files, and Cypher queries can change data.
Install
- Works in
Manual install
pip install kgliteThe MCP server is bundled in the wheel: start it with `kglite-mcp-server --graph my_graph.kgl`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The MCP server reads the graph and, with `source_root` set, source files, and Cypher queries can change data.
This is third-party code. Review the repository files before installing.
What it does
KGLite is an embedded knowledge graph for Python and Rust queried with Cypher. The graph runs in-process and needs no external database. Nodes and relationships load from pandas tables, the graph saves to a `.kgl` file atomically with `fsync`, and a frozen snapshot is read in parallel by several threads. The `kglite` wheel bundles an MCP server: `kglite-mcp-server --graph my_graph.kgl` exposes the graph to an agent over MCP stdio in Claude Desktop, Cursor and other clients. The `describe()` call returns a schema sized for the context window, from a full type list to a statistical summary. Queries with `FOR VALID_TIME AS OF` answer how data looked on a given date, and a declared ontology gates the build and every write.
Who it is for. Developers and analysts who build a knowledge graph from tables or code and want an agent to ask it questions itself.
Good fit when
- CSV tables of people, companies and links must become a graph handed to an agent.
- Data changes over time and the question is who managed a contract in 1999.
- The graph schema is large and model context is limited, so `describe()` with detail tiers is needed.
- The graph should sit as one file next to the project with no database server.
- An MCP that validates writes against an ontology with domains and cardinality is needed.
Not a fit when
- A ready MCP for PostgreSQL or another server database is needed: KGLite stores its own `.kgl` format.
- The project has neither Python nor Rust and the graph must be built in another language without bindings.
- The graph is huge and needs a distributed cluster.
Example request
Connect the `company.kgl` graph, show node types through `describe()`, then find all contracts the company managed on 30 June 1999.MCP
- Transport
- stdio
- Authentication
- not required
Limitations
The graph is built in Python or Rust and the MCP server only serves a ready `.kgl` file. In MCP clients give the absolute path to `kglite-mcp-server` inside the virtual environment: a bare command name may not be found. The `text_score()` text search needs your own embedder, for example `fastembed`. Code graph building, repository cloning and code watching live in a separate codingest-mcp project. You can verify the connection with `kglite-mcp-server --selftest --graph path/to/graph.kgl`.
How to disable. Remove the `kglite-mcp-server` entry from the MCP client config and uninstall the package with `pip uninstall kglite`. `.kgl` graph files sit in your folders and are deleted by hand.
FAQ
How do I connect KGLite to an agent?
Install `pip install kglite` and run `kglite-mcp-server --graph my_graph.kgl`. In the Claude Desktop or Cursor config give the full path to the binary from the virtual environment.
How do I create a graph?
Load nodes with `graph.add_nodes` from a pandas table, then relationships with `graph.add_relationships`. `graph.save("my_graph.kgl")` writes the file and `kglite.load` reads it back.
What does `describe()` give an agent?
A schema sized for context: up to 16 types appear in full, then a compact list, then a top 50 and a statistical summary. Types carry flags for time series, geometry and embeddings.
How do I configure the server for a graph?
Put a `<name>_mcp.yaml` file next to the graph, for example `wikidata_mcp.yaml` beside `wikidata.kgl`. The `skills: true` setting attaches methodology hints to tools.
Can I query the state at a past date?
Yes, the `FOR VALID_TIME AS OF date('1999-06-30')` prefix before a Cypher query returns data as of that date. Without a prefix a query reads today's state.
Discussion
No questions or reviews yet.
Related
MCP serversA knowledge graph with an MCP server: the agent searches concepts by meaning and sees how well each is supported.
myKG builds a confidence scored knowledge graph from mixed documents and serves it to an agent through MCP or a Claude Code skill.
The official Graphlit MCP server: an agent collects material from Slack, GitHub, mail and websites into a knowledge base and searches it
A .NET graph database with an MCP server of 185 tools: Claude creates nodes and edges, searches vectors and traverses the graph.
A CLI and MCP server that extracts structured knowledge from documents: graphs, hypergraphs, and fact search with sources
A Cypher graph database in one binary for agents: CLI, embedded engine, MCP server and a skill for Claude Code, Cursor and Codex.
README in short
The graph serves an application, an analyst or an agent, with three storage modes by size: memory, mapped file and disk for hundreds of millions of nodes. The Python wheel has no required dependencies, the license is MIT.