# Code Knowledge Graph

> GKG is Pre-indexed code knowledge graph for Claude Code, Codex, Cursor, OpenCode, and Hermes Agent — to save 💰💲, 🌟 Star if you like it! 🌟

- **Type:** MCP server
- **Install:** `agentstack add mcp-ishandutta2007-code-knowledge-graph`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ishandutta2007](https://agentstack.voostack.com/s/ishandutta2007)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ishandutta2007](https://github.com/ishandutta2007)
- **Source:** https://github.com/ishandutta2007/Code-Knowledge-Graph

## Install

```sh
agentstack add mcp-ishandutta2007-code-knowledge-graph
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 🧠 Code Knowledge Graph (GKG)

**The Pre-indexed Intelligence Layer for your AI Agents**

[](https://opensource.org/licenses/MIT)
[](#)
[](#)
[](http://makeapullrequest.com)

---

### 🚀 Stop Wasting Tokens. Start Coding Faster.

*Code-Knowledge-Graph* is a high-performance, local indexing engine that maps your codebase into a structured graph. It allows AI agents to understand your project instantly without exhaustive file crawling.

[Features](#-key-features) • [Getting Started](#-quick-start) • [Supported Agents](#-agent-compatibility) • [Why Graph?](#-why-code-knowledge-graph)

---

## ✨ Key Features

- 🏗️ **Graph-Based Indexing**: Transforms flat files into a rich semantic network of classes, functions, and dependencies.
- 📉 **Token Optimization**: Drastically reduces the "context window tax" by providing surgical code snippets instead of full-file dumps.
- ⚡ **Zero Latency**: 100% local processing. No API calls required for indexing.
- 🤖 **Agent Ready**: Native support for Claude Code, Codex, Cursor, OpenCode, and Hermes Agent.
- 🛡️ **Privacy First**: Your code never leaves your machine.

---

## 📽️ Demo

  
  Example: Rapidly mapping a 100k LOC repository in seconds.

---

## 🧩 Agent Compatibility

| Agent | Support Level | Integration Method |
| :--- | :---: | :--- |
| **Claude Code** | 💎 Full | Custom Tool / Hook |
| **Cursor** | ✅ Native | `.cursorrules` / Indexing |
| **Codex** | ✅ High | Plugin |
| **OpenCode** | 🛠️ Beta | API Bridge |
| **Hermes Agent** | 🚀 Optimized | Native Protocol |

---

## 🛠️ Quick Start

### 1. Installation
```bash
# Clone the repository
git clone https://github.com/ishandutta2007/Code-Knowledge-Graph.git

# Navigate to the directory
cd Code-Knowledge-Graph

# Install dependencies
npm install
```

### 2. Index your codebase
```bash
npm run ckg -- index ./path/to/your/project
```

### 3. Query the graph
```bash
npm run ckg -- query SymbolName
```

### 4. Run the MCP Server
To use this with Claude Code or other MCP-compatible agents:
```bash
npm run mcp
```
Then add it to your agent's config (e.g., in `claude_desktop_config.json`):
```json
{
  "mcpServers": {
    "code-knowledge-graph": {
      "command": "node",
      "args": ["--loader", "ts-node/esm", "C:/path/to/Code-Knowledge-Graph/src/index.ts", "mcp"],
      "cwd": "C:/path/to/Code-Knowledge-Graph"
    }
  }
}
```

---

## 📈 Why Code Knowledge Graph?

Traditional AI agents spend **~40% of their tokens** just trying to find where a function is defined. By providing a pre-indexed graph, we flip the script:

| Metric | Without CKG | With CKG | Improvement |
| :--- | :--- | :--- | :--- |
| **Initial Context Load** | 15,000 Tokens | 1,200 Tokens | **92% Reduction** |
| **Tool Call Latency** | 5-10s | 

Built with ❤️ for the AI Engineering Community.

[](https://twitter.com/ishandutta2007)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ishandutta2007](https://github.com/ishandutta2007)
- **Source:** [ishandutta2007/Code-Knowledge-Graph](https://github.com/ishandutta2007/Code-Knowledge-Graph)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-ishandutta2007-code-knowledge-graph
- Seller: https://agentstack.voostack.com/s/ishandutta2007
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
