loading…
Search for a command to run...
loading…
Enables searching AWS Amplify documentation using natural language queries with advanced search syntax, smart ranking, and generation selection.
Enables searching AWS Amplify documentation using natural language queries with advanced search syntax, smart ranking, and generation selection.
A Model Context Protocol (MCP) server that provides powerful search functionality for AWS Amplify documentation. This server clones the official AWS Amplify documentation repository and makes it searchable through a simple MCP tool interface.
Disclaimer: This is a personal project and is not affiliated with, endorsed by, or officially connected to AWS Amplify or Amazon Web Services. This tool is provided as-is without any guarantees or warranty.
git clone https://github.com/ykethan/amplify-doc-mcp.git
cd amplify-doc-mcp
npm install
npm run build
The server is configured using the docs-mcp.config.json file:
{
"gitUrl": "https://github.com/aws-amplify/docs.git",
"gitRef": "main",
"autoUpdateInterval": 60,
"toolName": "search_amplify_docs",
"toolDescription": "Search AWS Amplify documentation using the probe search engine.",
"ignorePatterns": [
"node_modules",
".git",
"dist",
"build",
"coverage",
".vitepress/cache",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.svg",
"*.mp4",
"*.webm"
],
"amplifyGeneration": "gen2"
}
| Option | Description | Default |
|---|---|---|
gitUrl |
URL of the Git repository to clone for documentation | "https://github.com/aws-amplify/docs.git" |
gitRef |
Git branch or tag to checkout | "main" |
autoUpdateInterval |
Interval in minutes to check for updates (0 to disable) | 60 |
dataDir |
Directory to store documentation data | "./data" |
toolName |
Name of the search tool | "search_amplify_docs" |
toolDescription |
Description of the search tool | "Search AWS Amplify documentation using the probe search engine." |
ignorePatterns |
Array of patterns to ignore when searching | ["node_modules", ".git", ...] |
amplifyGeneration |
Which Amplify documentation generation to include | "gen2" |
The server includes an automatic update mechanism that keeps the documentation up-to-date:
gitUrl.autoUpdateInterval is set to a value greater than 0, the server will periodically check for updates.autoUpdateInterval minutes, the server:This ensures that your documentation search results always include the latest information without requiring a server restart.
npm start
Or use the provided start script with options:
./start-server.sh [--gen <1|2|both>] [--rebuild]
--gen 1: Include only Gen 1 documentation (reduces disk space usage)--gen 2: Include only Gen 2 documentation (default, reduces disk space usage)--gen both: Include both Gen 1 and Gen 2 documentation--rebuild: Force rebuild of data directory# Start with Gen 2 documentation (default)
./start-server.sh
# Start with only Gen 1 documentation
./start-server.sh --gen 1
# Start with both Gen 1 and Gen 2 documentation
./start-server.sh --gen both
# Start with only Gen 2 documentation and force rebuild
./start-server.sh --gen 2 --rebuild
Important: When switching between different generation options (e.g., from Gen 1 to Gen 2 or vice versa), it's recommended to use the
--rebuildflag to ensure a clean repository. This will remove the data directory and clone the repository again, ensuring that the correct files are included based on the selected generation.For example:
# Switch from Gen 2 to Gen 1 with a clean rebuild ./start-server.sh --gen 1 --rebuild # Switch from Gen 1 to Gen 2 with a clean rebuild ./start-server.sh --gen 2 --rebuild
The server provides a tool called search_amplify_docs that can be used to search the Amplify documentation.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query |
string | Yes | - | Elasticsearch query string |
page |
number | No | 1 | Page number for pagination |
includeContent |
boolean | No | false | Include content snippets in results |
maxResults |
number | No | 10 | Maximum number of results to return |
filesOnly |
boolean | No | false | Only return file paths without content |
useJson |
boolean | No | false | Return results in JSON format |
sessionId |
string | No | - | Session ID for related searches |
fullContent |
boolean | No | false | Get full content of a specific file |
filePath |
string | No | - | Path to a specific file to get full content |
{
"query": "authentication react",
"page": 1,
"includeContent": true,
"maxResults": 15
}
The search tool supports advanced search syntax:
"authentication flow"authentication -fluttertitle:authenticationauth*authentication AND (react OR javascript) NOT flutterWhen you submit a search query, the server processes it through several steps:
Query Processing: The server parses your query to understand advanced syntax like boolean operators and wildcards.
Directory Optimization: The server uses the directory structure to narrow down which files to search based on your query terms and the selected Amplify generation (Gen 1, Gen 2, or both).
Smart Ranking: Results are ranked using a sophisticated algorithm that considers:
Content Extraction: For each matching file, relevant content is extracted and formatted for display.
Caching: Search results are cached to improve performance for repeated queries.
This intelligent processing ensures that the most relevant documentation appears at the top of your search results, saving you time and effort.
The server supports three modes for Amplify documentation generation:
"amplifyGeneration": "gen2"
"amplifyGeneration": "gen1"
"amplifyGeneration": "both"
src/index.ts: Main server implementationsrc/config.ts: Configuration loading and processingsrc/git.ts: Git repository managementsrc/cache.ts: Search result cachingsrc/directory.ts: Directory structure managementsrc/types/: TypeScript type definitionsscripts/build.js: Build script for preparing documentationbin/mcp: Executable script for running the serverOptimize for Your Environment:
"amplifyGeneration" as "gen1" or "gen2" onlySearch Optimization:
Performance Considerations:
autoUpdateInterval based on your needs (higher values reduce server load)filesOnly: true for initial broad searches to improve performanceWe welcome contributions and feedback to improve this MCP server. If you have suggestions for:
Please open an issue or submit a pull request on GitHub. Your feedback helps make this tool more effective for everyone. Along the way learn something new.
This project is licensed under the MIT License.
Выполни в терминале:
claude mcp add aws-amplify-documentation-mcp-server -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.