This is a submission for the Algolia MCP Server Challenge
What I Built
AutoDoc is an AI agent that analyzes recent code commits, detects affected documentation pages, and intelligently suggests updates—ensuring your documentation stays accurate and up-to-date with every push.
Demo
AutoDoc
This is a submission for the Algolia MCP Server Challenge
What I Built
AutoDoc is an AI-powered agent that analyzes recent code commits, detects which documentation pages are affected, and intelligently suggests updates—ensuring your documentation stays accurate and up-to-date with every push.
Setup Instructions
1. Clone Algolia MCP Server Repo
Run the following command in your terminal to clone the Algolia MCP Server:
git clone https://github.com/algolia/mcp-node
2. Self-Host n8n
Self-host n8n to use the n8n-nodes-mcp
community node, which enables integration with external MCP servers.
As the workflow uses webhooks, you’ll need a publicly accessible URL:
- Start the n8n instance with the
--tunnel
flag or - Preferably, create a dedicated ngrok tunnel using:
ngrok http 5678
Ensure
ngrok
is installed on your system.
3. Install MCP Client node
Install the n8n-nodes-mcp
node to enable communication with the Algolia MCP server.
4. Create a new workflow
Create a new workflow in…
How I Utilized the Algolia MCP Server
I used the Algolia MCP server to help the LLM discover documentation pages containing outdated code references. This reduces the amount of data passed to the model, keeping it within its context window and ensuring the LLM remains accurate, performant, and cost-effective.
Key Takeaways
Development Process
- I started by creating a dummy Next.js documentation site for an SDK and wrote a script to generate an Algolia index from it.
- Uploaded the generated index to Algolia.
- Chose to use n8n for orchestrating my AI agent, with Google Gemini as the model to analyze code changes and suggest documentation updates.
- Set up a webhook to listen for GitHub push events and trigger the workflow.
- Built a workflow in n8n to:
- Fetch commit data from GitHub
- Identify renamed, replaced, or modified code, and search the Algolia index for documentation pages referencing them
- Pass the resulting documentation pages one at a time to the model for update suggestions
- Create a new GitHub branch for each suggested update
- Open a GitHub issue summarizing all proposed changes
- Tested the system by modifying lines of code.
- Iteratively improved the prompts, indexing strategy, and workflow based on the test results.
Challenges Faced
I encountered two major challenges while building my AI agent:
- Webhook integration without paid hosting I struggled to get the webhook working without having to pay to host my n8n instance. Using ngrok for local tunneling solved this issue and allowed me to test workflows reliably during development.
-
Fetching outdated documentation data
I had difficulty retrieving documentation pages that referenced outdated code. To resolve this, I added extra fields to each Algolia record:
- An array of all unique code snippets
- A string containing all unique, searchable code-related terms I then searched for code references in batches, which significantly improved matching accuracy.
Top comments (0)