Metadata-Version: 2.4
Name: gknowledge-mcp
Version: 0.2.2
Summary: MCP server for gknowledge: let Claude Code, Codex or Cursor search, read and grow a Karpathy-style LLM wiki.
Author: gknowledge contributors
License: MIT License
        
        Copyright (c) 2026 Openapi®
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://openapi.github.io/gknowledge
Project-URL: Source, https://github.com/openapi/gknowledge
Project-URL: Issues, https://github.com/openapi/gknowledge/issues
Keywords: mcp,mcp-server,llm-wiki,knowledge-base,markdown,claude-code,codex,cursor
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: pdf
Requires-Dist: pypdf>=4.0; extra == "pdf"
Dynamic: license-file

# gknowledge-mcp

<!-- mcp-name: io.github.openapi/gknowledge -->

**An MCP server for [gknowledge](https://github.com/openapi/gknowledge) wikis.** Claude Code, Codex, Cursor and any other Model Context Protocol client can search, read and grow a linked Markdown wiki that an LLM keeps up to date, following [Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).

Sources are compiled into the wiki once. Agents then read the wiki instead of re-reading raw documents on every question.

- **Plain files.** Markdown with `[[wikilinks]]` and YAML frontmatter, an `index.md` catalogue and an append-only `log.md`. The folder opens in Obsidian or any editor.
- **Cited and incremental.** Each new source updates only the pages it touches. Every page records its sources, and answers cite pages.
- **Offline by default.** A built-in heuristic engine ingests and answers with no model and no API key. For better synthesis, set `provider`, `base_url` and `model` in the project's `settings/settings.json` (or from the desktop app) to use Ollama or any OpenAI-compatible endpoint.
- **No dependencies.** Standard library only; `pip install "gknowledge-mcp[pdf]"` adds PDF import.

## Install and register

```bash
claude mcp add gknowledge -- uvx gknowledge-mcp --init ~/Knowledge/my-project    # Claude Code
codex mcp add gknowledge -- uvx gknowledge-mcp --init ~/Knowledge/my-project     # Codex CLI
```

For Cursor or other clients:

```json
{ "mcpServers": { "gknowledge": { "command": "uvx", "args": ["gknowledge-mcp", "--init", "/home/you/Knowledge/my-project"] } } }
```

`--init` creates the project folder the first time. Without it, the server only opens an existing project. You can also `pipx install gknowledge-mcp` and use `gknowledge-mcp` as the command.

## Tools

| Tool | What the agent can do |
|---|---|
| `search_wiki` | find pages by keyword |
| `read_page` | read a page with its sources and backlinks |
| `list_pages` | list pages by type |
| `ask` | get a cited answer, optionally saved back into the wiki |
| `add_source` | import and ingest a file |
| `recent_activity` | see what changed recently |

## The desktop app

This package is the headless part of gknowledge. The full app is a native GNOME application (GTK 4 and Libadwaita) with sources, wiki, assistant and a review queue in one window, and it opens the same project folders. Install it from the [signed APT repository or Flatpak](https://openapi.github.io/gknowledge).

MIT licensed. Issues and contributions: [github.com/openapi/gknowledge](https://github.com/openapi/gknowledge).
