# OKF MCP PDF Knowledge Project

This Python project converts MCP-related PDF inputs into an **Open Knowledge Format (OKF)** bundle: a directory of Markdown files with YAML frontmatter, cross-links, source metadata, and a simple searchable catalog.

## What this project does

- Reads PDF files from `input_pdfs/`
- Extracts text with Python
- Creates OKF-style Markdown concept files
- Adds YAML frontmatter fields: `type`, `title`, `description`, `resource`, `tags`, and `timestamp`
- Produces an `index.md` for agent-friendly browsing
- Builds `catalog.json` for programmatic search
- Includes a lightweight CLI to query the generated knowledge bundle

## Why this project is related to the OKF blog

The Open Knowledge Format approach represents knowledge as plain Markdown files with YAML frontmatter. This project applies that pattern to MCP documents so people and AI agents can read, navigate, and reuse the extracted knowledge without a proprietary catalog system.

## Folder structure

```text
okf_mcp_pdf_knowledge_project/
├── input_pdfs/                 # Put input PDF files here
├── okf_bundle/                 # Generated OKF knowledge bundle
│   ├── index.md
│   ├── catalog.json
│   ├── sources/
│   ├── concepts/
│   ├── risks/
│   └── strategies/
├── src/
│   ├── build_okf_bundle.py
│   ├── search_okf.py
│   └── okf_utils.py
├── requirements.txt
└── README.md
```

## Setup

```bash
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

pip install -r requirements.txt
```

## Run

```bash
python src/build_okf_bundle.py --input input_pdfs --output okf_bundle
```

## Search generated OKF knowledge

```bash
python src/search_okf.py --bundle okf_bundle --query "MCP audit logs"
python src/search_okf.py --bundle okf_bundle --query "tool scoping"
python src/search_okf.py --bundle okf_bundle --query "security recommendations"
```

## Example OKF frontmatter

```yaml
---
type: concept
title: MCP Governance Strategy
description: Authentication, authorization, rate limiting, metrics, and lifecycle governance for MCP servers.
resource: sources/mcp-strategies.md
tags: [mcp, governance, authorization, rate-limiting, metrics]
timestamp: 2026-06-30
---
```

## Notes

- This is a local/offline project. It does not call external APIs.
- Generated content should be reviewed before production use.
- The `okf_bundle/` output is intentionally Git-friendly and can be published to a repository, static site, or consumed by an agent.
