- Generate the initial knowledge graph with the Mintlify agent or your own coding agent.
- Set up automations to keep it current.
- Use the knowledge graph through MCP.
The repositories, pull requests, and answers in the examples on this page are sample data.
Prerequisites
- A Mintlify project connected to a Git repository. This hub repository holds the knowledge graph and can start empty. See the Quickstart.
- The Mintlify GitHub App installed on the hub repository and on every source repository you want to document.
- An Enterprise plan for custom automations.
- The Mintlify agent, or a coding agent such as Claude Code, Codex, or Cursor.
Plan the structure
Put every repository in one hub project, so agents query one MCP server and pages can link across repositories. Give each repository its own group, plus an overview section.docs.json
Step 1: Generate the initial knowledge graph
Have an agent read your source code and write the first pages into the hub repository. Use the Mintlify agent, or clone the repositories and run your own coding agent.- Mintlify agent
- Clone and push
The Mintlify agent reads any repository with the Mintlify GitHub App installed, so you don’t clone anything.
1
Connect your source repositories
Install the Mintlify GitHub App on each source repository you want to document. See Connect repositories as context.
2
3
Repeat for each repository
Repeat for your other repositories, then ask the agent for the overview pages.
Example prompt
4
Merge the pull requests
When the pull requests merge, Mintlify deploys the knowledge graph and indexes it for search and MCP.
Step 2: Keep the knowledge graph current
Create a custom automation with a code change trigger so the agent updates the hub whenever a pull request merges in a source repository.1
Create the automation
- Open your Automations settings.
- Click New automation.
- Select the Code change trigger.
- Click Add repo for each source repository you documented in step 1. One automation can listen to up to 50 repositories.
2
Filter the trigger
Under Show advanced options on each repository card, set Listening to changes in to source paths such as
src/**, and use Excluding PRs from to skip bots. See Filter code change triggers.3
Write the instructions
Tell the agent how repositories map to hub pages and what to change.
Example instructions
4
Choose an update mode
Start with Modify and wait for review, which opens a pull request and assigns the source change’s authors as reviewers. Switch to Update and merge changes once results are consistent. With branch protection, see Configure automerge.
5
Test the automation
Save and run it manually, then check the run history and refine the instructions.
src/** in the three example repositories and excludes dependabot[bot].
To add a repository later, generate its pages as in step 1, then add it to the trigger.
Each run that updates the hub uses credits, and runs that change nothing are free. For busy repositories, a schedule trigger batches many merges into one run. See Control credit usage.
The estimate assumes every merge changes documented code, so actual usage is likely lower.
Step 3: Use the knowledge graph through MCP
Every project has a hosted search MCP server at the/mcp path of your site URL. With authentication, use /authed/mcp and enable authenticated MCP first.
- Claude Code
- Codex
- Cursor
CLAUDE.md, AGENTS.md, or Cursor rules file in each source repository.
AGENTS.md
Next steps
Automations
Learn about trigger types, update modes, and usage limits.
Search MCP server
Configure indexing, authentication, and client credentials for your MCP server.
Skills
Teach agents how to use your knowledge graph with skill files.
Authentication
Restrict the knowledge graph to your team.