- 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.
- Authentication on the project, so only your team can read the knowledge graph and connect to its MCP server. Without authentication, anyone can read pages that describe your internal code.
- 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
- What the repository does and who owns it
- The endpoints or events it exposes
- What it calls and what calls it
- Its key data models
- How to run and test it
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
2
Repeat for each repository
Repeat for your other repositories, then ask the agent for the overview pages.
Example prompt
3
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
On each repository card, click Show advanced options. Set Listening to changes in to source paths such as
src/**, and add bot accounts to Exclude author. 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
Leave Update and merge changes off at first. The agent then opens a pull request and assigns the source change’s authors as reviewers. When the agent’s pull requests stop needing edits, turn on Update and merge changes. If your deploy branch has 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. Because the knowledge graph requires authentication, connect your agents to the/authed/mcp path of your site URL. The first time an agent connects, you sign in with the same credentials you use for the site, and the agent reads only the pages that your user groups can access. See Enable authenticated MCP.
- Claude Code
- Codex
- Cursor
knowledge-graph server and answers from its pages.
To have agents search the knowledge graph on their own, add a line to the 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.